android-softkeyboard

how can i get soft keyboard height on android?

心不动则不痛 提交于 2019-12-22 10:49:04
问题 i have been developing an android project using libgdx for these days . A question occurred during the period. when soft keyboard' appear , some views will be covered,so i want to get the height for solving this bug. i know there is a soft input mode can be set to solve this issue when using android api to develop project ,does libgdx provide any way ? 回答1: Yes you can, with the help of Viewtree Observer and global layout listener, just try below mentioned steps Get the root view of your

Keyboard disappears on orientation change

会有一股神秘感。 提交于 2019-12-22 08:28:49
问题 I have a fragment with EditText and add it into the layout using transactions. But if I rotate to landscape the soft keyboard disappears. public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (getSupportFragmentManager().findFragmentById(R.id.fragmentContainer) == null) { getSupportFragmentManager().beginTransaction() .add(R.id.fragmentContainer, new

ImeAction Search is changed to Done after tapping on it

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 08:11:52
问题 I have an Edittext for searching on Listview. I have set imeOption to 'IME_ACTION_SEARCH' so that soft-keyboard will show search key on it. The problem is that when I tap on search key on keyboard if edittext contains no text in it, the search key changes to 'Done' instead of dismissing the keyboard. If the Edittext contains some text in it the search key works well. 回答1: In your XML layout file you can set <EditText android:imeOptions="actionSearch" /> Or in your Java source file you could

Android KeyBoard.Key disable iconPreview of special keys?

我的梦境 提交于 2019-12-22 07:00:29
问题 I customize my own soft keyboard by implementing the KeyboardView.OnKeyboardActionListener interface. When the keys are pressed, it will show a preview popup. My problem is how to disable the preview popup for special keys such as SHIFT and DELETE? I have tried to set the android:iconPreview attribute to null but it didn't work. <Key android:codes="-1" android:keyIcon="@drawable/key_shift" android:keyWidth="15%p" android:isModifier="true" android:isSticky="true" android:keyEdgeFlags="left" />

How do I remove the keyboard after I finish an activity?

走远了吗. 提交于 2019-12-22 04:12:57
问题 I have an activity that users type inside and then click the ok button. When it is finished, the activity closes and goes back to the old activity but the soft keyboard is still on the screen! I've tried android:windowSoftInputMode="stateHidden" and getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); But it does nothing. 回答1: In OnPause of your activity, you should do the following InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT

Remove whole Spannable with backspace

拈花ヽ惹草 提交于 2019-12-22 03:57:23
问题 I have a chat application which offers the possibility to add emoticons to the text. I have a problem with the EditText field. The emoticon images show up but if I press on the normal keyboard the backspace button, the text which I was changing to an emoticons picture shows up and I have to remove several characters until the picture goes away. I am using Spannable to do this. I want the whole smilie go away if the user presses one time backspace. Here the code I am using: // This is in the

Android: AutoCompleteTextView hide soft keyboard

和自甴很熟 提交于 2019-12-22 01:50:31
问题 I have an AutoCompleteTextView which as usual provides suggestions after a user types 3 letters. I want once once I touch the suggestion list to hide the soft keyboard. What I have done below with the table layout hides the keyboard only when clicking anywhere but the suggestion list. XML <TableRow android:id="@+id/tableRow2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" > <AutoCompleteTextView android:id="@+id/auto_insert_meds" android

Add emoji to Android keyboard

拥有回忆 提交于 2019-12-21 22:35:50
问题 I'm making my own custom keyboard and I have a problem with adding emoji to it. As a android:keyIcon I have a drawable of that emoji and I need android:codes for it. I don't know what to output when emoji is pressed. I've looked online for a solution, but I haven't found anything. Does anyone know what code should I use to output an emoji. Thanks in advance. Here is a part of the xml code: <Row> <Key android:codes="1F926" android:keyIcon="@drawable/e415" /> <Key android:codes="U+1F601"

Xamarin Forms 2.0 AppCompat android keyboard mode

我与影子孤独终老i 提交于 2019-12-21 22:20:03
问题 Xamarin I updated to version 4, Forms and 2.0 versions. On Android, I use AppCompat. I had a problem. Previously, the Android keyboard caused resize view. Now this does not happen. The keyboard appears on the top view. And the desired Elements to be hiding. I've tried: [Activity(WindowSoftInputMode = SoftInput.AdjustResize, Label = "Title", Icon = "@drawable/icon", Theme = "@style/MyTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]

Soft keyboard hide EditText in lollipop version

限于喜欢 提交于 2019-12-21 20:58:39
问题 I have a layout which contain RelativeLayout as Root layout,Relative layoout contain ListView at Top and one Edittext align at the bottom of relative layout. In Pre lollipop version devices whenever soft keyboard open Edittext pushed up and I am able to see the Editext. But in lollipop soft keyboard hide the Editext. I have already set android:windowSoftInputMode="adjustPan|adjustResize" in manifest file. Please help me 回答1: try to give fitsSystemWindows in your main layout( for lollipop