android-softkeyboard

Android: How to track if soft-keyboard is openned?

痴心易碎 提交于 2019-12-08 21:28:57
问题 In my application, the device soft-keyboard is covering the EditTextViews, so user cannot see what he is typing. So i want to hide other Views(like a button in my case), to make the EditTextViews visible. But instead on doing something like EditText.onFocus(){ //hide button } for every EditText, i want to do something like if(soft-keyboard.isOpenned()) //hide button } how to track if soft-keyboard is openned or closed? Edit: Actually my layout is this: <?xml version="1.0" encoding="utf-8"?>

Setting keyPreviewLayout for android virtual keyboard is causing a crash

倖福魔咒の 提交于 2019-12-08 19:26:28
I have a custom virtual keyboard in android which appears when a button is clicked. If i set a keyPreviewLayout with the statement android:keyPreviewLayout="@layout/mykeypreviewlayout" and include some layout statements in res/layout/mykeypreviewlayout.xml at runtime, when a key on the custom soft keyboard is touched, the app crashes. Here are the code snippets: The following is from the main xml file. <LinearLayout android:layout_height="wrap_content" android:layout_gravity="bottom" android:layout_width="wrap_content"> <android.inputmethodservice.KeyboardView android:id="@+id/keyboardView"

How to send out pointer event in Android

蓝咒 提交于 2019-12-08 18:03:16
问题 I'm trying to detect the virtual keyboard height in Android. I found a similar topic: Get the height of virtual keyboard in Android It seems the author found a way to detect the height: I found a way to get it. After I request to open virtual keyboard, I send pointer event that I generate. their y coordinate starts from height of device and decreases. I don't understand how to do that. 回答1: I'll be using the code provided at the link that you posted: // Declare Variables int softkeyboard

How Show soft keyboard automatically when EditText receives focus

霸气de小男生 提交于 2019-12-08 17:38:20
问题 I want show keyboard when my EditText receives focus. I tried many methods but nothing not helped. I tried: 1. InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(yourEditText, InputMethodManager.SHOW_IMPLICIT); whith different flags. 2. getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE); <requestFocus /> 4. editText.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void

Keyboard doesn't show up when enter to activity in Android Pie (API-28)

一笑奈何 提交于 2019-12-08 15:45:28
问题 I want to pop up the device keyboard when I enter to Email Login screen. I declared the windowSoftInputMode to "stateVisible" in the AndroidManifest.xml file: <activity android:name=".activities.EmailLoginActivity" android:launchMode="singleTask" android:screenOrientation="portrait" android:windowSoftInputMode="stateVisible" /> I have followed this documentation. Results: On devices that run Android API up to 27, the keyboard is shown. On devices that run the Android API 28, the keyboard is

“No XML content. Please add a root view or layout to your document”

て烟熏妆下的殇ゞ 提交于 2019-12-08 08:37:30
问题 I am trying to code a softkeyboard for 2.1 and up when I code ( see code below) in the main.xml graphical view is displays nothing and says No XML content. Please add a root view or layout to your document" I have tried to place the code in textview but still no luck I can not get the softkeyboard to show at all, its as if my code is being ignored..I have tried these two codes separately nothing works <com.example.android.softkeyboard.LatinKeyboardView xmlns:android="http://schemas.android

KeyIcon doesn't work

↘锁芯ラ 提交于 2019-12-08 07:35:35
问题 I'm using the following code (this is a part of it) for my softKeyboard. <Row android:rowEdgeFlags="bottom" > <Key android:codes="83" android:keyLabel="CLR" /> <Key android:codes="39" android:keyLabel="0" /> <Key android:codes="42" style="@style/deleteKeyboard" android:keyIcon="@drawable/button_delete" android:isRepeatable="true" android:keyLabel="DEL" /> </Row> For some reason style or keyIcon won't work. Not matter what, I can't set only one button on keyboard to different layout. What am I

How can I fix low resolution of my custom soft Keyboard View?

我们两清 提交于 2019-12-08 05:42:29
问题 I am developing a custom softkeyboard using softkeyboard sample of android SDK for 10 inches tablet PCs. First question: I noticed that the resolution of my keyboard is very low on tablet that is obvious in the following images. Actually in my keyboard area, the resolution is same as Pocket PCs resolution. How can I change its resolution to normal resolution of tablet PCs (10in)? In my softkeyboard getMaxWidth(); returns 545 that is very low for tablet. Second question: how can I change the

Android: What is the KeyEvent.KEYCODE for “?123” key on soft keyboard?

China☆狼群 提交于 2019-12-08 05:22:51
问题 I want to press "?123" key programmatically. But I don't know the KEYCODE for this symbol. And I also unable to find it. Can anybody know the KEYCODE for "?123" symbol on Soft Keyboard. 回答1: It's not an actual key press. It's just a way for the user to change the keyboard layout to be able to press on symbols etc. I think it's not even a guarantee that every keyboard has it. There are many custom keyboards on Android and they can make it any way they want it. You should think for yourself,

How to create Virtual KeyBoard and use it to replace the default keyboard?

淺唱寂寞╮ 提交于 2019-12-08 04:34:25
问题 I want to create a Custom Virtual KeyBoard and use it to replace android's default keyboard. I don't know how I can start it. I am following this SoftKeyboard sample code but I am not getting anything. Please provide me with another source or link that can help me. Thanks in advance. 回答1: There're some useful articles and samples in Android SDK. You can find them here. 回答2: Writing a KeyBoard is not easy... don't expect to see complete tutorials of how to do it, etc. You can learn by seeing