question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

actionNext doesn't work

See original GitHub issue

Hi,

I have a problem, when somebody presses “Enter” I want to move focus for the next input, in another inputs it works fine, but when I have one with your mask, it’s not working. Here is a sample:

<LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:gravity="center"
                android:orientation="vertical">

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="left"
                    android:layout_marginEnd="21dp"
                    android:layout_marginStart="21dp"
                    android:textColor="@color/purple"
                    android:text="@string/text_fullname"
                    android:textSize="12sp"
                    />

                <android.support.design.widget.TextInputEditText
                    android:id="@+id/etConfigPersonalDataFullName"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="16dp"
                    android:layout_marginStart="16dp"
                    android:imeOptions="flagNoFullscreen|actionNext"
                    android:nextFocusForward="@+id/etConfigPersonalDataCpf"
                    android:maxLines="1"
                    android:textColor="@color/purple"
                    android:textColorHint="@color/purple"
                    android:textSize="13sp"
                    android:inputType="text"
                    />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="left"
                    android:layout_marginEnd="21dp"
                    android:layout_marginStart="21dp"
                    android:textColor="@color/purple"
                    android:text="@string/text_cpf"
                    android:textSize="10sp"
                    />

                <br.com.sapereaude.maskedEditText.MaskedEditText
                    android:id="@+id/etConfigPersonalDataCpf"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="16dp"
                    android:layout_marginStart="16dp"
                    android:inputType="number"
                    android:typeface="monospace"
                    android:textColor="@color/purple"
                    android:textColorHint="@color/purple"
                    mask:mask="###.###.###-##"
                    apptools:hint="123.456.789-01"
                    android:textSize="13sp"
                    apptools:keep_hint="true"
                    android:imeOptions="flagNoFullscreen|actionNext"
                    android:nextFocusForward="@+id/etConfigPersonalDataBirthdate"
                    />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="left"
                    android:layout_marginEnd="21dp"
                    android:layout_marginStart="21dp"
                    android:textColor="@color/purple"
                    android:text="@string/text_birthdate"
                    android:textSize="10sp"
                    />

                <br.com.sapereaude.maskedEditText.MaskedEditText
                    android:id="@+id/etConfigPersonalDataBirthdate"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="16dp"
                    android:layout_marginStart="16dp"
                    android:inputType="number"
                    android:typeface="monospace"
                    android:textColor="@color/purple"
                    android:textColorHint="@color/purple"
                    android:textSize="13sp"
                    mask:mask="##/##/#####"
                    apptools:hint="__/__/____"
                    apptools:keep_hint="true"
                    android:imeOptions="flagNoFullscreen|actionNext"
                    android:nextFocusForward="@+id/etConfigPersonalDataPhone"
                    />
</LinearLayout>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
esdeguzmancommented, Apr 2, 2018

For those having this issue, you can also override the setOnEditorListener, like so,

maskedBirthDate.setOnEditorActionListener(new TextView.OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                return false;
            }
        });

This solved my problem without editing the library itself. Depends on your situation though. Cheers!

2reactions
egslavacommented, Sep 8, 2019
mask:enable_ime_action="true"

With the next release this behavior is not default anyway, so there should no be any problem for you anymore. However on 8 of September 2019, it’s not in the bintray (as a gradle dependency) yet, so you should clone the repo or to apply the advices above.

Read more comments on GitHub >

github_iconTop Results From Across the Web

android:imeOptions="actionNext" not working - Stack Overflow
When you set android:digits in EditText orTextInputEditText, it allows only digit or character which you have defined in it.
Read more >
Specify the input method type - Android Developers
You should always declare the input method for your text fields by adding the android:inputType attribute to the <EditText> element. Figure 1.
Read more >
Refresh/Update Default Action Button in Android Keyboard
I have a RecyclerView that contains EditText(s). The default (from what I can tell) Action Button (android:imeOptions) is either actionNext ...
Read more >
How to Handle IME Options on Action Button Click in Android?
Step 2: Working with the activity_main.xml file ... IME_ACTION_NEXT = When IME options is actionNext; EditorInfo.
Read more >
authentication event fail action next-method, does not fail over ...
Also, when I run into issues I always take advantage of ISE's Evaluate Configuration Validator located under Operations > Troubleshoot > General Tools....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found