use IME_FLAG_NAVIGATE_NEXT and IME_FLAG_NAVIGATE_PREVIOUS by default

NEW
Assigned to

Status

()

P3
normal
7 years ago
2 months ago

People

(Reporter: blassey, Assigned: shubham2892, Mentored, NeedInfo)

Tracking

Trunk
ARM
Android
Points:
---

Firefox Tracking Flags

(blocking-fennec1.0 -)

Details

(Whiteboard: [good first bug][lang=java])

Attachments

(2 attachments)

http://developer.android.com/reference/android/view/inputmethod/EditorInfo.html#IME_FLAG_NAVIGATE_NEXT

these flags will put next and previous buttons on the keyboard when normally only the enter key would be shown. If available (its only API level 11) we should use it to make form navigation easier
tracking-fennec: --- → ?
tracking-fennec: ? → 11+
Priority: -- → P2
Created attachment 593694 [details] [diff] [review]
Fix

It looks like none of the current IME's supports these flag yet, at least I haven't yet found any, which does. Tried the flags separately, and together with IME_ACTION_NEXT - no effect.
I may be doing something wrong though, but I guess it's just because the API is very new, not widely spread yet.
Assignee: alex.mozilla → cpeterson
Keywords: fennecnative-releaseblocker
blocking-fennec1.0: --- → +
Status: NEW → ASSIGNED
OS: Linux → Android
Hardware: All → ARM
This bug was marked blocking-fennec1.0+ but I do not think it should be a 1.0 blocker.

As alexp points out in comment 1, this is a recent Honeycomb API and current IMEs do not seem to have implemented it yet.
blocking-fennec1.0: + → ?
Moving to - and 14+ based on comment 2.
tracking-fennec: 11+ → 12+
blocking-fennec1.0: ? → -
tracking-fennec: 12+ → 14+
Duplicate of this bug: 731604
Component: Widget: Android → IME
Product: Core → Fennec Native
Version: unspecified → Trunk
Priority: P2 → P3
I don't think we care about this bug for Firefox 14, 15, or 16.
Status: ASSIGNED → NEW
tracking-fennec: 14+ → ?
This would be a good first bug for someone interested in Android and improving Firefox's form input.

The code changes are straightforward (see AlexP's patch). The tricky part is testing different IMEs, since this IME_FLAG_NAVIGATE_NEXT feature is pretty new. I don't know which IMEs implement it yet.
Assignee: cpeterson → nobody
tracking-fennec: ? → ---
Whiteboard: [good first bug][lang=java][mentor=cpeterson@mozilla.com]

Comment 7

6 years ago
Hi I'm new here, this seems to be a good one for me to start contribute. I have experience with developing Android apps and Firefox extensions and I'm really interested in working on this bug, can u give me some clue on how to start? A lot thanks
Welcome, Pushkar! Have you built the Firefox for Android source code? That's the first step. The build instructions are on the following wiki page. They are perpetually out-of-date, so please feel free to ask questions.

  https://wiki.mozilla.org/Mobile/Fennec/Android

Mozilla's Mercurial wiki has instructions on how to download the source code and prepare a patch:

  https://developer.mozilla.org/en-US/docs/Mercurial_FAQ
  https://developer.mozilla.org/en-US/docs/Mercurial_Queues

IRC is the best place for Q&A. Mozilla's Android team hangs out in the #mobile channel on Mozilla's IRC server:

  https://wiki.mozilla.org/IRC

Comment 9

6 years ago
I built the code and its working fine, I am now going to try my hands on the bug. How should I start?
hi Pushkar, most of Firefox's Android IME key code is in the file mozilla/mobile/android/base/GeckoInputConnection.java.

From what I understand, android.view.inputmethod.EditorInfo's IME_FLAG_NAVIGATE_NEXT and IME_FLAG_NAVIGATE_PREVIOUS flags are supposed to tell the IME virtual keyboard to provide NEXT and PREVIOUS buttons so the user can move the cursor to adjacent text fields. On the desktop browser, you would use TAB or SHIFT+TAB to move the cursor.

https://developer.android.com/reference/android/view/inputmethod/EditorInfo.html#IME_FLAG_NAVIGATE_NEXT

Different IMEs may implement the NEXT and PREVIOUS behavior differently... or not at all! Unfortunately, I do not know which third-party IMEs actually implement NEXT and PREVIOUS. I have seen other Android apps provide NEXT and PREVIOUS buttons on a Gingerbread device, but I have not actually seen this on any Ice Cream Sandwich or Jelly Bean device!

To find a test case, you may need to test different combinations of third-party IMEs and Android apps (such as Android's stock browser or Google Chrome) on an ICS or JB device. If you find a combination that displays NEXT and PREVIOUS buttons on the virtual keyboard, please share the information in this bug.


*** I recommend finding such a test case BEFORE writing any code. Otherwise we won't know whether your code has actually implemented the feature! :)


To implement the feature, I think you can just "or" the `imeOptions` flags with the new flags in GeckoInputConnection's onCreateInputConnection() method. Something like this:

https://hg.mozilla.org/mozilla-central/file/9a0b706c41d6/mobile/android/base/GeckoInputConnection.java#l841

I do not know if we should only "or" these flags only for certain content. We will need to test that once we have a test case that we can compare.

Unfortunately, EditorInfo.IME_FLAG_NAVIGATE_NEXT and IME_FLAG_NAVIGATE_PREVIOUS flags are only available in Honeycomb (API Level 11) and newer. You will need to check whether `(Build.VERSION.SDK_INT >= 11)` at runtime before using IME_FLAG_NAVIGATE_NEXT and IME_FLAG_NAVIGATE_PREVIOUS.
Assigning bug to Ian Patterson.
Assignee: nobody → ipatterson
Status: NEW → ASSIGNED

Comment 12

6 years ago
Created attachment 703636 [details]
Keyboard Screens.zip

Test case I ran to investigate the visibility of the "Next" button. The following keyboards were tested on my Galaxy S2:

Ice Cream Sandwich Stock - https://play.google.com/store/apps/details?id=com.vllwp.inputmethod.latin
Gingerbread Stock - https://play.google.com/store/apps/details?id=com.moo.android.inputmethod.latin.free
SwiftKey3 - https://play.google.com/store/apps/details?id=com.touchtype.swiftkey.phone.trial
Samsung Stock - Pre-installed.
Swype - Pre-installed.

Attached zip file has screenshots of the keyboards' layouts when an input field in the browser is triggered. (Screenshots archived here: https://www.dropbox.com/sh/yx32dx36vx4yy0b/v8QoWhD8mL)

Browsers tested were Firefox, Chrome, and Android's stock ICS Browser.

Firefox
- In Swype, the Space translates to the Tab key when long-pressed or when pressing Shift and can tab over to the next field. The function is not appear available in the other keyboards; seems specific to Swype.
 
Chrome & Stock
- Gingerbread and ICS have a tab key created next to or near the spacebar
- Swype’s functionality is the same
- Feature isn’t present in SwiftKey 3 and Samsung’s stock

Comment 13

6 years ago
I am stepping down from this task due to a shift in priorities. Adding my notes for future reference.

Keyboard is triggered at:
https://mxr.mozilla.org/mozilla-central/source/mobile/android/base/GeckoInputConnection.java#308

IME_ACTION is delegated here:
https://mxr.mozilla.org/mozilla-central/source/mobile/android/base/GeckoInputConnection.java#351

IME_ACTION_NEXT is used at:
https://mxr.mozilla.org/mozilla-central/source/mobile/android/base/GeckoInputConnection.java#333

Notes:
- mIMEActionHint appears to always equal "go", so the check is skipped by default
- mIMEActionHint is set in GeckoInputConnection's notifyIMEEnabled() method. notifyIMEEnabled() is called from Gecko's C++ code:
https://mxr.mozilla.org/mozilla-central/source/widget/android/AndroidBridge.cpp#323
- That action hint value comes from <input mozactionhint="next"> tag:
https://developer.mozilla.org/en-US/docs/HTML/Element/Input#Using_mozactionhint_on_Firefox_mobile

- Force-setting outAttr.imeOptions = EditorInfo.IME_FLAG_NAVIGATE_NEXT replaces the Go button with the Next button, but with no functionality.

General Sites:
http://developer.android.com/training/keyboard-input/style.html
http://stackoverflow.com/questions/2577956/how-to-add-go-button-in-android-softkeyboard-and-its-functionality
http://stackoverflow.com/questions/tagged/android-softkeyboard
http://developer.android.com/reference/android/view/inputmethod/EditorInfo.html (reference for outAttrs)
Assignee: ipatterson → nobody
Status: ASSIGNED → NEW
Comment on attachment 703636 [details]
Keyboard Screens.zip

Attachment is a zip file.
Attachment #703636 - Attachment description: Screenshots of various soft keyboards that show 'Next' Arrows. → Keyboard Screens.zip
Attachment #703636 - Attachment mime type: text/plain → application/zip

Comment 15

6 years ago
Hello.  I was wondering if my partner and I could work on this issue for a class project.  Please let me know if this bug is still open.  Thank you so much.
It's all yours. Feel free to ask Chris Peterson any questions here or in #mobile on IRC.
Assignee: nobody → sjtsai
Status: NEW → ASSIGNED
hi, Tsai! Thanks for your interest! Sorry for the delay.

Have you built Firefox for Android yet? Compiling and installing your own build is the first step. See comment 8 above for build instructions.

See comment 10, 12, and 13 above for details about this bug.

As a starting point, you should also look at the "Fix" patch file that Ian attached in comment 1 above.
Tsai - Are you still working on this?
Flags: needinfo?(sjtsai)
Mentor: cpeterson
Whiteboard: [good first bug][lang=java][mentor=cpeterson@mozilla.com] → [good first bug][lang=java]
Jim, could you mentor this bug?
Assignee: sjtsai → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(nchen)
Sure
Mentor: nchen
Flags: needinfo?(nchen)

Comment 21

3 years ago
Hi there,

I'd like to start working on this bug and I'm quite new to this. Do you have any advice on how to proceed?

Thanks

Updated

3 years ago
Flags: needinfo?(nchen)
(In reply to ben94lim from comment #21)
> Hi there,
> 
> I'd like to start working on this bug and I'm quite new to this. Do you have
> any advice on how to proceed?
> 
> Thanks

Hi! Check out this link for a quick way to get started, https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_for_Android_build.

And feel free to ask questions on IRC, in the #mobile channel.

For this particular bug, there is more information in comment 10.
Flags: needinfo?(nchen)
Hi. I would like to work on this bug if no one else is working on it. It would be my first bug.
(Assignee)

Comment 24

2 years ago
Tuhina are you working on this. 
Jim: If Tuhina is not working on it, would it be okay If I take this up.
Flags: needinfo?(tuhinatwyla)
Flags: needinfo?(nchen)
(In reply to Shubham from comment #24)
> Tuhina are you working on this. 
> Jim: If Tuhina is not working on it, would it be okay If I take this up.

Ok, I'm assigning it to you, since Tuhina's comment was from two months ago.
Assignee: nobody → shubham2892
Flags: needinfo?(nchen)

Updated

2 years ago
Flags: needinfo?(tuhinatwyla)
Hi, any progress here? If no one is currently working on this, I'd like to help.

Comment 27

2 years ago
The Android Keyboard has remove support of prev and next flag (if I understand the code correctly). I couldn't find a good test case where the flag is used by any other keyboard or browser.

I saw an issue with tab navigation e.g. on github.com/join with keyboard Hacker's Keyboard (full layout). But that is a different issue, I guess.
You need to log in before you can comment on or make changes to this bug.