android-softkeyboard

How to automatically show soft keyboard on start?

元气小坏坏 提交于 2019-12-04 17:54:13
I have an activity that only has a EditText. I want the soft keyboard to show up automatically. How can I do this? You can use this onResume: InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(((EditText) findViewById(R.id.your_view)),InputMethodManager.SHOW_FORCED); I suggest that you check if there is a Hardware keyboard before you force the keyboard to appear. To hide: ((InputMethodManager) YourActivity.this.getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(findViewById(R.id.YOUR_VIEW).getWindowToken(), 0);

Add emoji to Android keyboard

余生颓废 提交于 2019-12-04 17:06:57
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" android:keyIcon="@drawable/e415" /> <Key android:codes="57430" android:keyIcon="@drawable/e0415" /> </Row>

Android custom keyboard with 2 lablels (main and small at the top right)

試著忘記壹切 提交于 2019-12-04 16:46:32
I am implementing my own custom keyboard. I use this tutorial for implementing keyboard <?xml version="1.0" encoding="utf-8"?> <Row> <Key android:keyLabel="q" android:keyEdgeFlags="left"/> <Key android:keyLabel="w"/> <Key android:keyLabel="e"/> <Key android:keyLabel="r"/> <Key android:keyLabel="t"/> <Key android:keyLabel="y"/> <Key android:keyLabel="u"/> <Key android:keyLabel="i"/> <Key android:keyLabel="o"/> <Key android:keyLabel="p" android:keyEdgeFlags="right"/> </Row> I want have 2 label on key button.The same as on image below (red): How can I change the keyboard xml to have this? When we

How to push up the whole view when a keyboard comes up, what layout changes needed? [duplicate]

你说的曾经没有我的故事 提交于 2019-12-04 16:05:22
This question already has answers here : Move layout up when soft keyboard is shown (7 answers) Closed 3 years ago . I am having trouble pushing up the entire recycler view when the keyboard is diplayed, it cuts off the message that is previous. I am create a chat view that looks like this xml: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/commentsParentLayout" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:id="@+id/noCommentsResults" android:layout_width="match

Android: Detect softkeyboard RTL Vs LTR (language direction)

▼魔方 西西 提交于 2019-12-04 15:48:59
Following this it seems that the way to detect language direction is to use some Java libs on the already typed text . I have an AutoCompleteTextView so I want when the soft keyboard pops-up to know the selected language (before the user typing text). So when the user switches on the keyboard language I can know if the selected language is RTL or LTR (and therefore change layout accordingly). For example most of the users with native RTL language have keyboard with their language and English. Thanks, Tim To detect the language of the keyboard at the moment the EditText gains focus, you can use

Is there a way to get an Android soft keyboard that has only numbers (no decimals, spaces) with Java code?

社会主义新天地 提交于 2019-12-04 14:23:41
I have an iPhone app that uses different keyboard layouts. Some are custom and some are built in: Numbers only: Decimals: Custom X button for ISBN numbers: I'd like to do the same thing on Android, but even the normal InputType.TYPE_CLASS_NUMBER still includes a decimals, space, comma, etc. How can I customize the keyboards in Android?? It's not possible using the built-in keyboard. You'll have to develop a custom soft keyboard, or write an inline view that works like a keyboard replacement. Gautam I think this question has already been answered on StackOverflow. Look at this: Only show number

Soft keyboard hide EditText in lollipop version

痴心易碎 提交于 2019-12-04 13:04:09
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 try to give fitsSystemWindows in your main layout( for lollipop versions) android:fitsSystemWindows="true" also in the manifest give android:windowSoftInputMode="adjustResize"

Hide to show and hide keyboard in DialogFragment

孤街浪徒 提交于 2019-12-04 12:26:18
问题 In my dialog fragment, I am able to show the keyboard using getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT STATE_VISIBLE); but I am not able to hide it on dismiss . I've tried getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); and getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); neither of which work. I've also tried showing and hiding the keyboard using

Is there any way to permanently hide soft keyboard but keep enabling focus for an EditText?

回眸只為那壹抹淺笑 提交于 2019-12-04 11:09:10
In my android app, I have 3 EditTexts in my one activity. I created my own number pad in the activity. Whenever i tap any EditText, soft keyboard comes up. I want to block that permanently for this activity but if user tap an EditText then it should be in focus. Like a cursor blinking. Any idea how can i do that? Thanks in advance. Hiding Keyboard Manually Here InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); YourEditText.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { // TODO

Disable Software Keyboard in Android until EditText is chosen

烂漫一生 提交于 2019-12-04 09:49:00
问题 how can I prevent the software keyboard to disappear until a specific EditText is choosen? I have several EditTexts in my Layout when it is opened the first is automatically selected and the software keyboard is shown. I know i can disable this by setting android:focusable="false". But then it is impossible to click on the item and get the item displayed. What I want: The activity is started and the user sees all EditTexts, then he clicks on one and the software keyboard opens and stuff can