android-softkeyboard

Android custom keyboard popup keyboard on long press

瘦欲@ 提交于 2019-11-28 18:22:59
I have custom Android keyboard: public class CustomKeyboard extends Keyboard{...} public class CustomKeyboardView extends KeyboardView{...} public class CustomKeyboardIME extends InputMethodService implements KeyboardView.OnKeyboardActionListener{...} On some keys, I have popupKeyboard and popupCharacters : <Key android:codes="144" android:keyLabel="0" android:popupKeyboard="@xml/key_popup" android:popupCharacters=")" android:keyEdgeFlags="right"/> xml/key_popup.xml: <Keyboard xmlns:android="http://schemas.android.com/apk/res/android" android:keyWidth="10%p" android:horizontalGap="0px" android

Hide soft keyboard after dialog dismiss

自古美人都是妖i 提交于 2019-11-28 17:47:59
I want to hide soft keyboard after AlertDialog dismiss, but it's still visible. Here is my code: alert = new AlertDialog.Builder(MyActivity.this); imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); alert.setOnDismissListener(new DialogInterface.OnDismissListener() { @Override public void onDismiss(DialogInterface dialog) { imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0); } }); Rajeshwar In Manifest xml android:windowSoftInputMode="stateAlwaysHidden" It will automatically hide soft keyboard on Dismiss of Dialog I met the same problem. Solved it by doing

Keyboard hides BottomSheetDialogFragment

做~自己de王妃 提交于 2019-11-28 17:37:56
There are more fields below the keyboard. This happened when i updated the support library. I know it's Kotlin but it looks almost the same as java. How do I fix this issue? This is what it looks like: My code: class ProjectsEditBottomSheetFragment(val privateID: String, val publicID: String) : BottomSheetDialogFragment() { private val mBottomSheetBehaviorCallback = object : BottomSheetBehavior.BottomSheetCallback() { override fun onStateChanged(bottomSheet: View, newState: Int) { if (newState == BottomSheetBehavior.STATE_HIDDEN) { dismiss() } } override fun onSlide(bottomSheet: View,

hide keyboard when user taps anywhere else on the screen in android

故事扮演 提交于 2019-11-28 17:03:16
I need to hide the softkeypad in android when user click on anywhere other than a Edittext. There are many help for iphone but not for android. I tried this code but its not working :( final RelativeLayout base = (RelativeLayout) findViewById(R.id.RelativeLayout1); findViewById(R.id.base).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(base.getWindowToken(), 0); } }); Thanks in advance ! Lalit Poptani You can use the onTouchEvent() to hide

android: Softkeyboard perform action when Done key is pressed

[亡魂溺海] 提交于 2019-11-28 16:37:28
I have an EditText. I want that after typing some text, when user presses the Done key of the softkeyboard, it should directly perform some search operation which I have also implemented in a button click event. Try this editText.setOnEditorActionListener(new OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if(actionId==EditorInfo.IME_ACTION_DONE){ //do something } return false; } }); Silambarasan Poonguti Try this It works both for DONE and RETURN . EditText editText= (EditText) findViewById(R.id.editText); editText

Disable soft keyboard on NumberPicker

无人久伴 提交于 2019-11-28 15:23:55
I'm trying to deactivate the soft keyboard when using a NumberPicker to enter numerical values (for aesthetic reasons). This is my layout-xml-code: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <LinearLayout android:id="@+id/linearLayout2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_marginBottom="30dp" android:layout_marginTop="30dp" >

Activity isn't resizing when keyboard is shown

六月ゝ 毕业季﹏ 提交于 2019-11-28 13:53:07
I have a simple activity that displays a big multiline EditText and some other controls below it. I want the activity to resize so the buttons are not hidden by the keyboard when the user is typing in the EditText . I have tried all sorts of sketchy and non-sketchy solutions I have found online - nothing works. Here's what I've tried so far: Putting android:windowSoftInputMode="adjustResize" in the manifest. Putting android:fitsSystemWindows="true" in the layout root. Using RelativeLayout vs. LinearLayout as root. Removed all themes from the activity Created a custom theme and put <item name=

Android: Dialog box show soft keyboard automatically when focus is on an EditText not working

馋奶兔 提交于 2019-11-28 13:50:10
Android: show soft keyboard automatically when focus is on an EditText I've read this post that automatically shows the virtual keyboard when a dialog box is shown. however, it's not working for me. any ideas why? eventhough the edit text is automatically on focus when the dialogbox appear, the event doesn't trigger. I've also read the onpostresume answer but I don't know how to apply it. any help is appreciated. final Dialog dialog = new Dialog(ThesisI.this); dialog.setContentView(R.layout.budget_dialog); final EditText et = (EditText) dialog.findViewById(R.id.textComments); final Button

How to add preference of Custom Input method to Android Settings app?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 12:41:45
Recently I've started to develop Android Soft Keyboard and got some problem with preferences. How to add a preferences to Android setting app? I've searched almost all the source code of AnySoftKeyboard, but haven't found anything what would add them to Settings app. I'm placing a link to show what I meant: http://code.google.com/p/softkeyboard/wiki/Settings (first picture from begin) Thank you P.S. Sorry for my bad english.. I've found it myself: in XML of input method you need to put android:settingsActivity tag with link to your PreferenceActivity class: Example Here is an example: set

Android - Show BottomSheetDialogFragment above Keyboard

懵懂的女人 提交于 2019-11-28 12:05:33
I'm trying to show a BottomSheetDialogFragment with a few EditText fields for the user to enter information. I want to show it directly above the keyboard, but it keeps covering up the contents. This is what happens when I bring up the BottomSheetDialogFragment , you can see it's selecting Card Number EditText , but covering the other content. Ideally, this is what I'm looking for, you can see both EditTexts , and the padding of the View. I've tried a lot of solutions revolving around windowSoftInputMode , but nothing seems to work. I've set it to adjustResize for the parent Activity and the