Is there an idea to show numeric soft keyboard with % symbol programmatically?
For example I need to enter 13% in EditText, so I need numbers and percent symbol and I don't want to show letters in soft keyboard.
The below code shows only numbers and .
editText.setRawInputType(InputType.TYPE_CLASS_NUMBER);
Any help is appreciated
For a customer i have allowed the '-' char within the layout.xml file (android:digits attribute, see bellow):
Then, before searching i replace the '-' char occurences by '%'. Of course, you must inform your users about this logic. Other solution is to build a simple Digits + '%' keyboard with buttons in a DialogFragment or even in your search layout directly.
Update: Integrated numeric keyboard view example
keyboard_num.xml
The KeyboardNumeric class:
EditText that avoids Soft input keyboard to be shown:
fragment_search.xml using CustomEditText + Keyboard:
Finally, in your SearchFragment code (Attached to fragment_search.xml), just add this: (ie: in onCreate after inflating view)