Android: How to remove customize keyboard button from keyboard? - android

Please find below the screenshot wherein the circular box shows the customize button option.
XMl Code:
<EditText
android:id="#+id/et_cost_per_mile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:hint="Cost Per Mile(₤)"
android:inputType="numberSigned"
/>
All I want to remove :: button from keyboard.

You have change input type like..
android:inputType="phone"

You can not. This is your android keyboard app and you cant change it. The keyboard settings can be modified in the android settings. But obviously it depends on the user, not the developer.
The only way I think it will allow you to do that is that you include in your app a fake numeric keypad as a layer (Similar to the keyboard that appears when you have to type the pin of the app of your bank). However, I don't think this is worth it. With...
android:inputType = "numberSigned"
you are already blocking the user from entering letters or other characters, even if they change their keyboard.

Related

Is it possible to wrap default android keyboard

I am trying to implement extension to keyboard (input method).
I wonder if there is a defualt keyboard resourses/implementation which I can wrap. Eg if user presses 'Default kbd' block 'qwerty' is shown as default android keyboard, and i i press 'my extension' block qwerty replace with extension.
note: I looking for the way (if exists) to create custom input method without rebuilnd defualt keyboard, not the app only keyboard cover like this https://github.com/chiragjain/Emoticons-Keyboard
What you're trying to do unfortunately is not possible.
Try to find an open source keyboard implementation and build upon it.
See this GitHub repository for a working implementation of the default LatinIME, use it as your base.
You have to create your own custom keyboard to display such scenario. On your keyboard you can maintain two different layer at a time. So all you would need is KeyboardView class:
<android.inputmethodservice.KeyboardView
android:id="#+id/keyboardView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:visibility="gone"
android:keyBackground="#color/background_color"
android:keyTextColor="#37474F"
android:keyTextSize="20sp"
android:fontFamily="sans-serif"
android:background="#ECEFF1"/>
Resources to follow:
https://code.tutsplus.com/tutorials/create-a-custom-keyboard-on-android--cms-22615
http://www.fampennings.nl/maarten/android/09keyboard/index.htm
Though these examples would display example only on key representation you can easily add any xml as a keyboard layer.
You can try the next trick:
Detect the moment of the keyboard being shown.
Evaluate the bottom of your layout.
Show your UI just above the keyboard.
Hide your UI on the moment of keyboard hiding.
"2" and "3" are slightly different depending on the keyboard showing mode (adjustResiz or adjustPan).
Usefull links:
https://android-developers.googleblog.com/2009/04/updating-applications-for-on-screen.html
https://developer.android.com/training/keyboard-input/visibility.html
https://developer.android.com/guide/topics/manifest/activity-element.html#wsoft

MultiAutoCompleteTextView not showing keyboard suggestions

I'm using MultiAutoCompleteTextView in my app. It's an awesome control in Android API. But there are a few issues I'm facing. One, the most annoying is, that on my Nexus 5, it doesnot shows keyboard suggestions. On Xperia Z, shows keyboard suggestions though. Unable to find the cause. Can anybody help/guide me about it? Here the XML of my MultiAutoCompleteTextView.
<MultiAutoCompleteTextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:hint="Post a question, idea or update"
android:gravity="top"
android:textColorHint="#9e9e9e"
android:textColor="#000000"
android:textSize="15sp"
android:padding="10dp"
android:background="#null" />
I have looked into the source code and found this in AutoCompleteTextView
// Always turn on the auto complete input type flag, since it
// makes no sense to use this widget without it.
int inputType = getInputType();
if ((inputType&EditorInfo.TYPE_MASK_CLASS)
== EditorInfo.TYPE_CLASS_TEXT) {
inputType |= EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE;
setRawInputType(inputType);
}
And in the javaDoc page of the InputType, TYPE_TEXT_FLAG_AUTO_COMPLETE defined as.
Flag for TYPE_CLASS_TEXT: the text editor (which means the application) is performing auto-completion of the text being entered based on its own semantics, which it will present to the user as they type.
It means that you have your own semantics for completion, which means that it is logical for the keyboard to disable its suggestions.
I think when you change the inputType with setInputType() method programatically you can disable this behaviour and get the keyboard suggestions.
You can try this:
mAutoCompletetextView.setInputType(EditText.TYPE_CLASS_TEXT | EditText.TYPE_TEXT_FLAG_AUTO_CORRECT);

HTC One keyboard does not change language, inputType=textVisiblePassword

I have a problem with native HTC One keyboard in multilanguage environment.
There is a button on the keyboard which allows to switch the language:
When I enter the text in "plain" EditText this button is enabled, so I can enter text using any language.
However when the inputType=textVisiblePassword is added:
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textVisiblePassword" />
the change-the-language button becomes disabled:
Any another keyboard (Swype+Dragon, ...) works ok.
Does anybody know how to fix this problem?
I think for password fields only english language is supported as you need to validate it with server and so.

Android SoftKeyBoard - rename the Enter Key

i have several EditText in my App. If you hit the Enter Key you can tab to the next EditText without a problem but i would like to change the Enter Key so that this button doesn't shows the Enter Simbol but instead it shows "Next" or "Done". i tried many things but without any results. Here is the XML code for my EditText:
<EditText
android:id="#+id/et_nt_name"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="top"
android:imeOptions="actionNext|flagNoEnterAction"
android:imeActionLabel="Next"
android:singleLine="true"
android:inputType="textShortMessage"
/>
it is the case that some soft keyboards actually change the default text on the enter key by design, so it may not be your fault that it's not showing what you want it to show. the functionality should be the what you programmed it to do, though.
i recommend you switch to the default keyboard (long press on any edit text, then select input method) to verify that it's showing the correct text, and don't care about the what the other soft keyboards look like .
if your phone didn't come with the default soft keyboard, the Android emulator is your best friend.
Add this to your EditText,
android:imeOptions="actionDone"

Why input type "number" is showing alphabet keyboard for an edit text...?

I have a edit text, whose input type is number.
in emulator its working fine i.e, showing the num-pad as soft keypad.
but in the device its showing alphabets keyboard why?
<EditText android:layout_width="110dp"
android:layout_height="30dp" android:id="#+id/phone"
android:layout_alignParentRight="true" android:background="#drawable/edit_text_bg"
android:inputType="number" android:maxLength="10"
android:paddingLeft="4dp" android:textColor="#1b0a00"
android:layout_marginRight="8dp"/>
Thanks in advance....!
So from what i've observed setting the inputType to phone should solve the problem . But try a different device to check if ur code works by giving input as number before moving to this option .
I think you must change inputType
FROM :
android:inputType="number"
TO:
android:inputType="phone"
When you give the InputType as number there is a completely new keyboard that gets loaded very different to what you will get by pressing the corner button on your normal keyboard to get numbers . Only certain phones/android versions(i think 2.2+) have this separate keyboard . For the ones that dont have this , The normal keyboard is shown and manual switching has to be done .
It could be that the device you're testing has some sort of custom keyboard enabled by default that doesn't support a number pad. Try changing the keyboard settings to the standard keyboard on the device and see if it works.

Categories

Resources