Reputation: 3104
Goal is to use multiline EditText
with android:inputType="textMultiLine"
and with "next view button" such as android:inputType="text"
(see picture 2).
<EditText
android:id="@+id/addAffirmationContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textMultiLine"
android:maxLength="255"
android:imeOptions="flagNoExtractUi" />
I tried many combinations with:
android:inputType, singleLine, nextFocusDown, nextFocusUp, nextFocusLeft, nextFocusRight, nextFocusForward, imeOptions, lines
, but android:inputType="textMultiLine"
always forces new line button.
Tested on Nexus 5 Android 7.
Upvotes: 2
Views: 2929
Reputation: 2894
I think what you are looking for is the same as in this answer:
In code:
editText.setImeOptions(EditorInfo.IME_ACTION_NEXT);
editText.setRawInputType(InputType.TYPE_CLASS_TEXT);
and in xml:
android:inputType="textMultiLine"
Upvotes: 9
Reputation: 11090
These three lines in combination should replace your "enter" with "next"
<EditText
android:inputType="text"
android:maxLines="1"
android:imeOptions="actionNext" />
Android have a lot of"android:imeOptions
" to specify the keyboard action button
android:imeOptions="actionGo"
android:imeOptions="actionDone"
android:imeOptions="actionNext"
android:imeOptions="actionPrevious"
android:imeOptions="actionSend"
and there are even more
Upvotes: 0