0

I have tried all combination and still not achieved what i want so please help me!

What I want

I need keyboard without auto prediction and with enter key for multi purpose

  1. single press : should go next line
  2. long press : should show emoji keyboard and

here is code

<EditText
        android:id="@+id/editTextWord"
        android:gravity="top|start"
        android:paddingStart="8dp"
        android:scrollbarStyle="insideInset"
        android:scrollbars="vertical"
        android:overScrollMode="always"
        android:background="@color/background_walk_through_six"
        android:paddingEnd="8dp"
        android:focusable="true"
        android:focusableInTouchMode="true"
        android:layout_above="@+id/txtCharacters"
        android:backgroundTint="@android:color/transparent"
        android:inputType="textMultiLine"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

What i have tried

  1. android:inputType="textMultiLine"

or

  1. android:inputType="textMultiLine|textNoSuggestions"

With above lines showing enter key fulfilled but i can't prevent auto prediction

  1. android:inputType="textMultiLine|textNoSuggestions|textVisiblePassword"

With above line showing enter key with nextline[single press] and prevent auto prediction means when i add textVisiblePassword emoji not showing on long press of Enter Key

I have tried programmitically but then it showing done button

editTextWord.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);

I guess you understood now what i need!!

Kishore Jethava
  • 6,666
  • 5
  • 35
  • 51

1 Answers1

0

You can do that programmatically like this:

editText.setImeOptions(EditorInfo.IME_ACTION_UNSPECIFIED);
editText.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS |  InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD | InputType.TYPE_TEXT_FLAG_MULTI_LINE);

As the inputType needs multiple values, you could add it to your xml as described there: How to add many values in android:tag

CarHa
  • 1,148
  • 11
  • 31