1

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.

Picture 1.: new line button:
new line button

Picture 2.: next view button:
next view button

Phantômaxx
  • 37,352
  • 21
  • 80
  • 110
t0m
  • 2,850
  • 27
  • 50

2 Answers2

4

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"
MikeL
  • 2,496
  • 1
  • 21
  • 37
0

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

Rainmaker
  • 8,993
  • 5
  • 45
  • 72
  • I do not want block Enter. I want to see and use next view button (see picture 2) instead of Enter button. – t0m Feb 21 '18 at 18:45
  • @t0m i'm sorry didn't get it right, now I see, I managed to do it in one of my projects with this combination (see edited code), I understand that you tried some combinations but maybe you didn't try this – Rainmaker Feb 21 '18 at 19:09
  • This is not multiline `EditText`. – t0m Feb 22 '18 at 08:48