Change "Done" button in Android numeric keyboard - android

I have an EditText in Android configured for the number keyboard, and I would like the keyboard's button to say "next", while mine is saying "done".
How can I change that?
I already tried:
<com.innovattic.font.FontEditText
style="#style/CadastroTextBoxStyle"
android:hint="CEP"
android:id="#+id/etCEP"
android:inputType="number"
android:singleLine="true"
android.imeOptions="actionNext" />
And also this:
etCEP.setImeActionLabel("Next", KeyEvent.KEYCODE_ENTER);
But it still says done.
What else can I do?
Thanks

As can be seen in Specifying the Input Method Type, you do not need to call TextView.setImeActionLabel(CharSequence, int) and you have to instead just provide a android:imeOptions value such as actionSend or actionNext in XML attributes to change the label accordingly.
This is not working for you because you have mistyped : as . in your attributes. Switching those out should fix your issue in no time.

Related

How to remove the double underline from EditText? [duplicate]

How can I disable spelling corrections in an EditText's soft-keyboard programmatically in Android? The user can disable it from settings, but I need to disable it in my application.
Is there any way to do this?
Set this in your layout's xml for your EditText:
android:inputType="textNoSuggestions"
Or call setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS) in your Activity'
If you need to support API 4 and below, use android:inputType="textFilter"
If setting:
android:inputType="textNoSuggestions"
still doesn't work (and your text field is small), a quick work-around is to use:
android:inputType="textVisiblePassword"

android - handle virtual keyboard enter key behaviour

I have five edittext in my layout. by default when i click on any of the edittext the virtual keyboard shows like following
Is it possible to modify the behavior of enter key ? I want when the key pressed the focus should be transferred to next edit text. Keyboard should look like
notice the change in enter key and also suggestions are disabled. Is there any way to achieve it ?
To disable text suggestions, add the following parameter to your EditText:
<EditText
android:inputType="textNoSuggestions"
(…)
/>
And to go to the next field upon pressing "enter" add the ID of the next field on the following parameter:
<EditText
android:nextFocusForward="#+id/nextEditTextId"
(…)
/>
Details can be found here.
Hope it helps!

how to disable spellcheck Android edittext

I want to remove the underlines from texts inside edittext fields.
How can I do that?
You can do it with following code. Just paste it in layout of EditText.
android:inputType="textNoSuggestions"
In order to get rid of spell checking you have to specify the EditText's InputType in the XML as the following:
android:inputType="textNoSuggestions"
However, if your EditText is multiline and also you need to get rid of spell checking,then you have to specify the EditText's InputType in the XML as the following:
android:inputType="textMultiLine|textNoSuggestions"
Minor addition to Chintan's answer - such (and other) combination is also allowed:
android:inputType="textCapSentences|textNoSuggestions"
Or if you want to just disable the red underline (and the autocorrect dialog), you can override the isSuggestionsEnabled() method on TextView.
This will keep the keyboard autocomplete working.
I just Added a line in for EditText
editText.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
and it worked fine for me.
So I was not able to find out any direct way of doing it. So went ahead with below workaround:
editText.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
As the input type becomes a visible password, even if the spell check is enabled from the device settings, the Red underline won't appear. :)

Android: inputType none and physical keyboard

I have a problem with TextEdit,
if I do editText.setInputType(InputType.TYPE_NONE); the user is not able to type anything.
Anyway, if there is a physical keyboard attached, then the user can type by using it (of course the soft keyboard doesn't work).
Is there any way to fully disable editing on a EditText?
PS: I need to do that programmatically at runtime
Try
android:editable="false"
in xml layout file
android:editable="false" is deprecated ,prefer not to use it.
Another solution to this that I used is given below
first_password_EditTextBox = (EditText) findViewById(R.id.editText1);
first_password_EditTextBox.setEnabled(false);

Put constrains to an EditText

I have an edit text and I'd like to put the following constrains (in the XML code if possible):
Disable all the capital Letters (the inverse of android:capitalize or the same fonction than toLowerCase())
Block to EditText to 1 line max. (for instance avoid that when I press enter the editText
get bigger to create a new line)
In fact , my editText is a Search Field (but in my case I don't want to use the special Search Widget).
Thanks
To make the edittext single line add this to its tag:
android:singleLine="true"
Also android:capitalize is depreciated and the following should be used instead
android:inputType="textCapCharacters"
However there seems to be no matching lowercase inputType, so you may have to implement it manually using a setOnKeyListener.
use android:lines="1" in the android xml page and then see the layout.

Categories

Resources