android-softkeyboard

Android: Tie a SoftKeyboard (InputMethodService) to an EditText

半城伤御伤魂 提交于 2019-12-03 21:13:58
I'm trying to convince an EditText -view to only use the SoftKeyboard that I wrote. It's bugging me for a few days already and I can't believe that this isn't possible to do. I might not see the obvious... So far I managed to write my own SoftKeyboard based on the sample that comes with the Android SDK. I'm able to manually select it as the input method (long click, input method, *pick*). The SoftKeyboard then works fine and does everything I want. I also cleaned up the context menu to disallow changing the input method (obviously I currently needed it to be in the menu otherwise I wouldn't be

Soft keyboard's POPUP layout

微笑、不失礼 提交于 2019-12-03 20:46:13
问题 I'm developing a soft keyboard and doing well, but I don't know how to customize the popup layout for a long keypress. My KeyboardView: <?xml version="1.0" encoding="UTF-8"?> <android.inputmethodservice.KeyboardView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/keyboard" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:keyPreviewLayout="@layout/preview" android:keyBackground="@drawable/key

Positioning EditText Above Keyboard

倖福魔咒の 提交于 2019-12-03 20:39:12
问题 I have got an EditText looking like this (with "bottom gravity"): When I press the EditText , the keyboard shows up and I can't see anymore what I'm typing (because the EditText is now behind the keyboard, on the bottom). How could I move the EditText automatically just above the keyboard, when it has been pressed? At the end, it would be good if it would look like this: My Code: // LINEAR LAYOUT LinearLayout layout = new LinearLayout(getApplicationContext()); layout.setOrientation

Android: Remove Enter Key from softkeyboard

天大地大妈咪最大 提交于 2019-12-03 16:32:36
问题 In my login form when user clicks on an EditText and presses the enter key, this inserts a new line, therefore increasing the EditText's size. Next moment, it returns to its previous place and prints a dot in the password field (which is the next field). I want to remove this enter key from the softkeyboard. Is it possible? 回答1: I am afraid you can't do this. But one thing is you can handle the softkeyboard keyevents like this, edittext.setOnKeyListener(new OnKeyListener() { public boolean

Why the soft keyboard shows or not when an activity starts?

懵懂的女人 提交于 2019-12-03 14:00:34
When comparing our design between developers, we found a strange behavior. After some analysis we went to this observation. When the activity starts, on some cases the keyboard appears but sometimes not. In fact, without a ScrollView , the soft keyboard does not appear by default on an EditText . <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".TestActivity" > <EditText android:id="@+id/editText1" android:layout_width="0dp" android

How to display the Soft Keyboard from a Service?

陌路散爱 提交于 2019-12-03 12:23:51
Short question: Is it possible (and how) to display the soft-keyboard from a Service? Long question: I wrote a service which creates a "top bar", displayed on top of all activities, containing an EditText. I want to display the soft-keyboard when that EditText is clicked, but this is not happening. Of course I've tried this from the Service's onFocusChange() and onClick(): InputMethodManager imm = (InputMethodManager)this.getSystemService(Service.INPUT_METHOD_SERVICE); imm.showSoftInput(editText, InputMethodManager.SHOW_FORCED); The workaround I came up with is to request the current activity

Disabling the keyboard's send button when nothing has been typed yet [Android]

天涯浪子 提交于 2019-12-03 11:48:52
I'm creating a search option in an android application. After pressing "Search" on the screen-keyboard an event triggers which sends the query to the server. What I want to do is disable the "Search" button on the screen-keyboard when no text has been typed in it's corresponding EditText yet. I added this to the EditText : android:imeOptions="actionSearch" So that's why the keyboard has got a "Search" button in stead of the default "enter"/"done". (Just in case you where wondering). We cannot disable the action button on the android keyboard. You will have to settle with checking for empty

Soft keyboard covers an EditText in a PopupWindow

别来无恙 提交于 2019-12-03 11:27:24
问题 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

Android HTML5 - soft keyboard overlaps input field

时光毁灭记忆、已成空白 提交于 2019-12-03 09:04:02
问题 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

Hide Soft Keyboard on Done Keypress in Android?

此生再无相见时 提交于 2019-12-03 08:22:13
问题 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