soft-keyboard

How to change keyboard layout by swipe left or right space key in custom keyboard

故事扮演 提交于 2019-12-01 14:31:47
I made an android custom keyboard . I want to use swiping on Space key on the keyboard for changing keyboard layout to show next language layout. How can i do that? I used bellow class: public class KeyboardIMS extends InputMethodService implements KeyboardView.OnKeyboardActionListener { ...} You can do this by override touchEvent like this : @Override public boolean onTouchEvent(MotionEvent e) { float x = e.getX(); float y = e.getY(); switch (e.getAction()) { case MotionEvent.ACTION_DOWN: mIsDown = true; break; case MotionEvent.ACTION_MOVE: float dx = x - mPreviousX; float dy = y - mPreviousY

How to change keyboard layout by swipe left or right space key in custom keyboard

不打扰是莪最后的温柔 提交于 2019-12-01 12:19:28
问题 I made an android custom keyboard . I want to use swiping on Space key on the keyboard for changing keyboard layout to show next language layout. How can i do that? I used bellow class: public class KeyboardIMS extends InputMethodService implements KeyboardView.OnKeyboardActionListener { ...} 回答1: You can do this by override touchEvent like this : @Override public boolean onTouchEvent(MotionEvent e) { float x = e.getX(); float y = e.getY(); switch (e.getAction()) { case MotionEvent.ACTION

Soft keyboard does not show when Activity starts

廉价感情. 提交于 2019-11-30 14:07:27
I have added android:windowSoftInputMode="stateAlwaysVisible" to my Activity in AndroidManifest.xml and here's my layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <EditText android:id="@+id/EditText01" android:layout_width="wrap_content" android:layout_height="wrap_content"></EditText> <EditText android:id="@+id/EditText02" android:layout_width="wrap_content" android:layout_height="wrap_content"></EditText> <Button android

Creating softkeyboard with custom emoji

怎甘沉沦 提交于 2019-11-30 10:27:18
I have been tasked to create a new android 3rd party keyboard that supports customized emojis (My own Icons) from assets. I want to implement a softkeyboard with my own emoji icons without using UniCode or my custom UniCode. Questions: If I create a custom emoji, with some string of characters which does not map to the standard set of emojis, and text this message to a friend with the customized app/keyboard, what shows up on their device? The regular ASCII characters string? or the image. I have read two ways to add image to textView. Html.ImageGetter Spannable Image (String consisting of

How to prevent the soft keyboard from ever appearing in my Activity?

两盒软妹~` 提交于 2019-11-29 20:15:19
问题 I'm writing an Android game that runs in fullscreen landscape mode, and has buttons placed at the bottom left and bottom right of the window. The problem is that one of these buttons is (on many phones) right next to the Menu button, so the player might accidentally press Menu instead. If it is pressed briefly, I simply pause the game and show the in-game menu. No problem there. But if the button is held down longer, Android opens up the soft keyboard on the bottom half of the screen. Since

View-specific IME?

我怕爱的太早我们不能终老 提交于 2019-11-29 11:55:38
I have a custom view for which I want the user to be able to enter characters from an app-defined set of characters. To do this, as I understand it, I need to write an input method service. The user not only needs to install it, but then needs to enable the IME in the Settings > Language & keyboard, and then select the custom IME for use in the view. This seems really crazy. I want this IME to be used for just one view in one application. I don't want it to be available system-wide or force the user to make global setting changes. The only alternative I can see is defining my own in-app custom

Move layout up when soft keyboard is shown

梦想的初衷 提交于 2019-11-29 05:08:54
I'm trying to adjust the layout when the soft keyboard appears after an edit text gets focus. Right now if I have many edit text and the keyboard appears, the last edit text are hidden and I can't scroll up. This is how my layout is builded up: Template: <LinearLayout> <LinearLayout> // header 1 </LinearLayout> <LinearLayout> // header 1 </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1" android:orientation="vertical"> // where I inflate view_1 </LinearLayout> <LinearLayout> // footer </LinearLayout> </LinearLayout> View

Show soft keyboard when Activity starts

半城伤御伤魂 提交于 2019-11-28 18:07:21
I have 2 activities, A and B. When A starts, it checks for a condition and if true, it calls startActivityForResult() to start B. B only takes text input so it makes sense for the soft keyboard to automatically pop up when B start. When the activity starts, the EditText already has focus and it ready for input. The problem is that the keyboard never shows up, even with windowSoftInputMode="stateAlwaysVisible" set in the manifest under the <activity> tag for B. I also tried with the value set to stateVisible . Since it doesn't show up automatically, I have to tap the EditText to make it show.

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

How to set different background of keys for Android Custom Keyboard

a 夏天 提交于 2019-11-28 08:44:39
I am Working on Custom Keyboard Application This is code for background color of input.xml in softkeyboard :- @Override public View onCreateInputView() { Log.e("onStartInputView ","On StartInput View Called--"); SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); String Backgroundcolour = preferences.getString("BackgroundColour",""); Log.e("Brithnesss- -","----"+Backgroundcolour); if(Backgroundcolour.equalsIgnoreCase("black")) { this.mInputView = (KeyboardView) getLayoutInflater().inflate( R.layout.input, null); }else { this.mInputView = (KeyboardView)