UPDATE: this is now a Swype-related issue: turn off the automatic capitalization of the first character sentence in EditText

I am implementing an EditText which is used to get the rtsp URI from the user. Although this is not a huge problem functionally, I would like to disable the default behavior on the on-screen keyboard, where the caps key state is enabled for the first character of each sentence. From what I have compiled, this cannot be done in XML via the android:inputType . Any guidance on how to do this programmatically would be helpful.

I would like to include the code, but the nature of the project prevents me from doing this. But I can say that nothing unusual is being done here. EditText itself has no other input flags used, and the only IME option in place is a flag to disable the extraction user interface in the landscape. The layout is implemented using XML, and not programmatically, so there are no custom classes or extensions in the mix.

EDIT: The android:capitalize constant inherited from TextView does not work. I specifically target 2.2 on the Galaxy Tab, so I don’t know if this is due to Samsung OS settings, or if it is due to the fact that the capitalize constant is out of date.

EDIT 2: Swype is the culprit in the inability to use the capitalize constant. Does anyone know if there is a way to make Swype play well without telling the end user to disable Swype?

+4
source share
3 answers

You can use the inherited android:capitalize attribute of the TextView. It accepts none (without caps, what you want), sentences (the first first word of each sentence), words (the first letters of the first letter of each word) and character (all caps).

+2
source

Putting this in XML for EditText, it worked to stop Swype 2.17.59.15552.t100 from forcing capital:

Android: inputType = "text | textEmailAddress"

+2
source

Since EditText is a subclass of TextView, you can use the TextView: capize configuration to change the presentation title scheme. It looks like you can only install in xml.

+1
source

Source: https://habr.com/ru/post/1336481/


All Articles