android-softkeyboard

How do i add words to the suggestions on top of the soft keyboard

為{幸葍}努か 提交于 2019-12-03 03:38:53
Is there any way to add words to the suggestions in the soft keyboard? For a specific Edittext field i would like to add a list of names to the suggestions that pops up on top of the soft keyboard in android 2.0. Does anyone know if this is possible? Macarse Here is the source code of the soft keyboard. If you go through the code, you will see that it uses a Suggest class which inside has different dictionaries. If you want to add words for a specific EditText you would need to add and remove or change freq of a certain word from those dictionaries. Some issues: I couldn't find a way to get

Set Keyboard Mode in android custom keyboard

不想你离开。 提交于 2019-12-03 02:44:26
I have created a Custom Keyboard using the Android Keyboard Class. I want to have Rows for two modes. One is the normal mode. And one is when the user presses the "Sym" button. For each Keyboard.Row for the "Sym" button in the XML i have specified android:keyboardMode="@+id/sym". Now when i run it only the rows that do not specify the android:keyboardMode display. This is as expected and what the documentation says. My questions is how do i set the Mode in my code so that the rows with android:keyboardMode="@+id/sym" get rendered? <Row> <Key android:codes="113" android:keyLabel="q" /> <Key

Detect delete button in soft keyboard

邮差的信 提交于 2019-12-03 02:43:31
I have two EditText (each only only accepts one character) and I want to handle both fields like I had only one. I'm using a TextWatcher to set the focus in the second one when the user writes a character in the first one, but I don't know how to do the opposite. If the user press the delete button in the second EditText (being this EditText empty) I want to move the focus to the first EditText and delete the character there. The problem is that TextWatcher doesn't work when the user tries to delete an empty field (because in fact nothing is changing). And onKeyDown event only works with hard

Soft keyboard covers an EditText in a PopupWindow

时光怂恿深爱的人放手 提交于 2019-12-03 01:47:02
I've thrown together a simple test project that displays a PopupWindow containing an EditText (on Android 2.2). When I tap the EditText, the soft keyboard is shown, as I would expect. However, the soft keyboard covers the EditText, and I cannot get the screen to pan to keep the EditText in view in the way I would have thought it should. My code: TestAdjustPanActivity.java: package com.example; import android.app.Activity; import android.graphics.drawable.BitmapDrawable; import android.os.Bundle; import android.view.Gravity; import android.widget.PopupWindow; public class TestAdjustPanActivity

Hide Soft keyboard on return key press

时光怂恿深爱的人放手 提交于 2019-12-03 01:05:53
I've searched half a dozen other answers on SO, but haven't found one that works. All I'm trying to do is dismiss the soft keyboard when the user presses the enter button. (The equivalent of the insanely easy iOS 'resignKeyboard' call.) In the following code, the onEditorAction method does not get called. I've set up an EditText view in my XML file and the code in my fragment is as follows: @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { fragView = inflater.inflate(R.layout.fragment_encrypt2, container, false); textField = (EditText

How to hide Android Soft Keyboard? [duplicate]

天涯浪子 提交于 2019-12-02 23:52:02
问题 This question already has answers here : How to set visibility Android Soft Keyboard (97 answers) Closed 5 years ago . I have two EditText Views and a Button in Linearlayout. After Completion of writing in the edittext, I want to hide the Android Virtual keyboard, How can I do that? 回答1: You may use the InputMethodManager class like this: InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow( yourEditText.getWindowToken()

Android HTML5 - soft keyboard overlaps input field

。_饼干妹妹 提交于 2019-12-02 23:14:16
I'm a bit tired looking for a solution for overlapping input field by soft keyboard on Android. My problem is very similiar to this one: Soft Keyboard Overlapping with EditText Field although in this case it occurs in HTML5, not native application. More precisely: when the input field is fully covered by keyboard, a whole page is scrolled and this field become visible - that's OK. But if this input was on the edge of visible area (after keyboard appears), my soft keyboard overlaps it and page won't scroll at all. The page will be scrolled just after typing a first sign. My customer doesn't

Hide Soft Keyboard on Done Keypress in Android?

[亡魂溺海] 提交于 2019-12-02 22:04:51
I'm struggling with the done button on the soft keyboard. I can't get the soft keyboard Done key press to hide the keyboard. From another button, it works perfectly with imm.hideSoftInputFromWindow(editText.getApplicationWindowToken(), 0); but the onKeyListener does not function the way I want. When I hit the editText, the soft keyboard shows up and its content is cleared from characters. Thanks for listening! The main.xml: <EditText android:id="@+id/answer" android:layout_gravity="center_horizontal" android:textSize="36px" android:inputType="phone" android:minWidth="60dp" android:maxWidth=

setImeOptions: why the “Done” button does not show on the soft keyboard?

怎甘沉沦 提交于 2019-12-02 21:57:40
I try to set the "Done" button on the softkeyboard by using input.setImeOptions(EditorInfo.IME_ACTION_DONE); but the "Done" button simply does not show on the softkeyboard. Any suggestion please? public void modif(int position) { AlertDialog.Builder alert = new AlertDialog.Builder(MainActivity.this); alert.setTitle("Modifica"); EditText input = new EditText(MainActivity.this); input.setImeOptions(EditorInfo.IME_ACTION_DONE); alert.setView(input); final Editable value = input.getText(); alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() { public void onClick(DialogInterface

ImageView resizes when keyboard open

天大地大妈咪最大 提交于 2019-12-02 21:48:07
问题 This is my code <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="match_parent" > <ImageView android:id="@+id/bgImage" android:layout_width="fill_parent" android:layout_height="match_parent" android:layout_alignParentTop="true" android:contentDescription="@string/todo" android:scaleType="fitXY" android:src="@drawable/default_wallpaper" /> <LinearLayout android:id="@+id