It's easy to disable key previews: just call setPreviewEnabled(false) and these annoying tiny previews won't show up anymore. But if I attach a popup keyboard to any key then these previews will show up inside that popup:
qwerty.xml:
<Key android:codes="101"
android:keyLabel="E"
android:popupKeyboard="@xml/popup"
android:keyTextSize="60sp"/>
popup.xml:
<Row>
<Key android:codes="-10000"
android:keyLabel="test"
android:keyOutputText="test"/>
</Row>
<Row>
<Key android:codes="-10001"
android:keyLabel="test2"
android:keyOutputText="test2"/>
</Row>
Can't post images, but if I long press letter 'E' and then press test or test2 button they will show that white key preview.
Is there any way to disable these key previews too?
You can force Android to hide the virtual keyboard using the InputMethodManager, calling hideSoftInputFromWindow , passing in the token of the window containing your focused view. This will force the keyboard to be hidden in all situations. In some cases, you will want to pass in InputMethodManager.
You can force Android to hide the virtual keyboard using the InputMethodManager, calling hideSoftInputFromWindow, passing in the token of the window containing your edit field. This will force the keyboard to be hidden in all situations.
The Android system shows an on-screen keyboard—known as a soft input method—when a text field in your UI receives focus.
set this in your popup layout set this attribute:
android:keyPreviewLayout="0"
or
android:keyPreviewLayout="@null"
Call setPreviewEnabled(false)
for the popup keyboard view too
// Find popup keyboard by its view-id
pKeyboardView
android.inputmethodservice.KeyboardView = (KeyboardView)mHostActivity.findViewById(viewid);
// Disable key-previews for the popup keyboard too
pKeyboardView.setPreviewEnabled(false);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With