1

This is not a duplicate of How to disable auto-capitalization of an EditText . I want to disable auto-capitalization for each line. I've tried using

android:inputType="textMultiLine|textEmailAddress"

but textEmailAddress disables multi-line input as the return key does not create a new line.

Here is my multiline EditText

<EditText 
    android:background="#00ffff" 
    android:inputType="textMultiLine" 
    android:lines="8" 
    android:minLines="1" 
    android:gravity="top|left" 
    android:maxLines="8" 
    android:layout_height="wrap_content" 
    android:layout_width="fill_parent" 
    android:scrollbars="vertical"
/>

Any help?

Thanks

the_prole
  • 8,275
  • 16
  • 78
  • 163

1 Answers1

0

You need to change your thinking. "textEmailAddress" does not turn off the enter key. It tells the keyboard- which is a separate app and changes by OEM, model, and user preference- that the field is an email address. The keyboard will do whatever it wants with that. It can turn every key into the poop emoji if it wants to. There are no rules. Some keyboards will show the enter key, some won't. And there's no way to find out.

There is no setting for what you want to do, and definitely none that will work across all keyboards. What will work is to set a TextWatcher on the edit text that checks for capitals and converts them to lowercase.

Gabe Sechan
  • 90,003
  • 9
  • 87
  • 127
  • What do you mean by text watcher? Do you mean just blindly force letters to lower case? What if the user chooses to Capitalize a letter? – the_prole Jun 20 '17 at 06:03
  • If you don't know what a TextWatcher is, Google it. It's an important concept for edit texts. I assumed you wanted to force all lower case. If not, then three really is no feature doing what you want. Generally that's controlled by the keyboards auto capitalization combines with the type, but there's nothing that will always turn it off across all keyboards – Gabe Sechan Jun 20 '17 at 06:06
  • What if I subclass the EditText such that additional EditText views are added dynamically and stacked on each-other when user presses the return key. Then I can set input type to `email` for each edit text and expect any keyboard to maintain lower caps. Think it will work nicely? – the_prole Jun 20 '17 at 15:47