I have 2 same identical EditText:
<EditText
android:id="#+id/card_num_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:digits="0123456789"
android:ems="13"
android:inputType="phone"
android:singleLine="true"
android:textSize="14sp"
/>
Other one:
<EditText
android:id="#+id/phoneRegEdit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:digits="0123456789"
android:ems="13"
android:inputType="phone"
android:singleLine="true"
android:textSize="14sp" />
One of them have a "next one" action button when the virtual keyboard shows up, the other have an "ok" action button.
The "next one" is passing focus to the next EditText but the "ok" is doing nothing just hiding the virtual keyboard.
My question is, what conditions decide which button is showing up? In my opinion Android have a huge deficiency with EditText's focus flow.
It is done by IME_OPTIONs More info here
<EditText android:id="#+id/some_edittext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:imeOptions="actionDone"><!-- Here you set whatever option you want -->
Related
I have a normal Dialog with an EditText:
http://imageshack.com/a/img673/4729/UPuwot.png
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Player 1 name"
android:inputType="textPersonName"
android:ems="10"
android:id="#+id/editText"/>
And I have an AlertDialog with an EditText:
http://imageshack.com/a/img537/416/jmkW6r.png
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:hint="custom score"
android:ems="10"
android:id="#+id/editText5"
android:textAlignment="gravity"
android:layout_gravity="center_horizontal"/>
How can I make both look the same. I prefer the AlertDialog's layout. I use AppCompat 21.
Moreover, I think i can remember that in the beginning of programming, all EditTexts looked the same. Then I started playing around with themes and now there is this problem.
I have these EditText in my app:
<EditText
android:id="#+id/text_url_servidor"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:hint="#string/text_url"
android:singleLine="true"
android:textSize="7pt" />
and
<EditText
android:id="#+id/login_password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#id/login_username"
android:hint="#string/login_password"
android:password="true"
android:singleLine="true"/>
When I run the app, the first one shows the letters pop-up, but not the second one. They are in different layouts (xml). Both are inside a RelativeLayout. The only difference is that the first one are shown in a Dialog. Why second one is not showing letters as pop-up? Thanks.
I think it may be because of android:password="true" remove it and try
Android Soft keyboard is not automatically switching to Alphabet mode from numeric mode during navigating to other text box, why?
android:inputType="select ur appropriate mode"
for your particular textbox
example ,shown below
<EditText
android:id="#+id/editText1"
android:inputType="text"=========returns text keyboard
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<EditText
android:id="#+id/editText1"
android:inputType="number"=======returns numeric keyboard
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
You have to use the inputType property to indicate what type of keyboard you want.
For example, say you have 2 edit boxes:
//alphabet keyboard is shown when user focus is on this box
<EditText
android:id="#+id/editText1"
android:inputType="text"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
//numeric keyboard is shown when user focus is on this box
<EditText
android:id="#+id/editText2"
android:inputType="number"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
i have two text view & two edittext view .....here is my xml
<TextView
android:id="#+id/txt_email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="#string/email"
android:textColor="#color/gray"
android:textSize="#dimen/medium"
app:font="font/trebuc_normal" />
<EditText
android:id="#+id/et_un"
style="#style/EditText"
android:layout_width="fill_parent"
android:background="#drawable/edittext_roundcorner"
android:imeOptions="actionNext"
/>
<FontedTextView
android:id="#+id/txt_pass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/password"
android:textColor="#color/gray"
android:textSize="#dimen/medium"
app:font="font/trebuc_normal" />
<EditText
android:id="#+id/password"
style="#style/EditText"
android:layout_width="fill_parent"
android:background="#drawable/edittext_roundcorner"
android:inputType="textPassword"
/>
I want my control to pass to edit text with id password when user enters some text in email edit text view & presses enter.I have used imoptions but not working.After entering text when i press next button control goes to next line of same edit text view.Please help?
You can also use editText.setNextFocusUpId(R.id.editText);
Set below Property of all Edittext, it will solve your problem.
android:singleLine="true"
I was wondering if its possible to change magnifying glass on the Search button to text "Search". We want to preserve the imeOptions setting to android:imeOptions="actionSearch" because we respond to a certain event.
Here is what I have:
<EditText
android:id="#+id/txtSearch"
android:textSize="14px"
android:textColor="#color/main_text_black"
android:layout_width="189px"
android:layout_height="fill_parent"
android:imeOptions="actionSearch"
android:gravity="center_vertical"
android:singleLine="true"
android:background="#null"
android:layout_alignParentLeft="true"
android:layout_marginLeft="24px"/>
Tried this:
<EditText
android:id="#+id/txtSearch"
android:textSize="18dp"
android:textColor="#color/main_text_black"
android:layout_width="247dp"
android:layout_height="fill_parent"
android:imeOptions="actionSearch"
android:imeActionLabel="Search"
android:gravity="center_vertical"
android:singleLine="true"
android:background="#null"
android:layout_alignParentLeft="true"
android:layout_marginLeft="38dp"/>
This only works in landscape mode which our app does not support and the word Search shows up in the wrong place.
You can try it!
<EditText
android:id="#+id/edt_search_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:imeOptions="actionSearch"
android:inputType="text"/>
No, this is impossible unless you implement your own Keyboard for that EditText. The Text (or icons) on the keys of a keyboard is controlled by the person who wrote the keyboard.