Last active
April 6, 2018 12:22
-
-
Save Subtle-fox/a7e26e367054208006ca52c3a8e5d6d8 to your computer and use it in GitHub Desktop.
Set soft keyboard action for multiline text
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void setMultilineImeAction(EditText view, int imeAction) { | |
int inputType = view.getInputType(); | |
inputType &= ~InputType.TYPE_TEXT_FLAG_MULTI_LINE; | |
view.setInputType(inputType); | |
view.setHorizontallyScrolling(false); | |
view.setMaxLines(Integer.MAX_VALUE); | |
view.setImeOptions(imeAction); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment