android-softkeyboard

How to adjust layout when soft keyboard appears

一个人想着一个人 提交于 2019-11-26 03:03:06
问题 I would like to adjust/re-size the layout when the soft-keyboard activated, as below: Before and After: Found couple resources in SO: How to keep all fields and texts visible while the soft keyboard is shown android soft keyboard spoils layout when appears Adjust layout when soft keyboard is on But the questions & answers are rather ambiguous, here\'s the question with clearer picture of what I want. Requirements: It should work on phone with any screen sizes. Noticed that the margin/padding

adjustPan not preventing keyboard from covering EditText

淺唱寂寞╮ 提交于 2019-11-26 02:57:22
问题 I\'m trying to create a pretty basic chat screen with a ListView displaying the text and an EditText at the bottom and a \"Send\" button to the right of the EditText. Everything is functional, but when I click the EditText, the virtual keyboard covers it. The screen pans up a little but not enough to become visible above the keyboard. I\'ve got the \"adjustPan\" tag in my manifest and have also tried the \"adjustResize\" tag to no avail. I\'m guessing it has something to do with the way my

How to hide Soft Keyboard when activity starts

强颜欢笑 提交于 2019-11-26 02:29:10
问题 I have an Edittext with android:windowSoftInputMode=\"stateVisible\" in Manifest. Now the keyboard will be shown when I start the activity. How to hide it? I cannot use android:windowSoftInputMode=\"stateHidden because when keyboard is visible then minimize the app and resume it the keyboard should be visible. I tried with InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0); but it did not

Soft keyboard open and close listener in an activity in Android

对着背影说爱祢 提交于 2019-11-26 01:45:02
问题 I have an Activity where there are 5 EditText s. When the user clicks on the first EditText , the soft keyboard opens to enter some value in it. I want to set some other View \'s visibility to Gone when the soft keyboard opens and also when the user clicks on the first EditText and also when the soft keyboard closes from the same EditText on the back button press. Then I want to set some other View \'s visibility to visible. Is there any listener or callback or any hack for when the soft

How to hide soft keyboard on android after clicking outside EditText?

家住魔仙堡 提交于 2019-11-26 01:26:35
问题 Ok everyone knows that to hide a keyboard you need to implement: InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0); But the big deal here is how to hide the keyboard when the user touches or selects any other place that is not an EditText or the softKeyboard? I tried to use the onTouchEvent() on my parent Activity but that only works if user touches outside any other view and there is no

How to capture the “virtual keyboard show/hide” event in Android?

我是研究僧i 提交于 2019-11-26 01:22:55
问题 I would like to alter the layout based on whether the virtual keyboard is shown or not. I\'ve searched the API and various blogs but can\'t seem to find anything useful. Is it possible? Thanks! 回答1: Note This solution will not work for soft keyboards and onConfigurationChanged will not be called for soft (virtual) keyboards. You've got to handle configuration changes yourself. http://developer.android.com/guide/topics/resources/runtime-changes.html#HandlingTheChange Sample: // from the link

How to set visibility Android Soft Keyboard

邮差的信 提交于 2019-11-26 01:17:43
问题 I have an EditText and a Button in my layout. After writing in the edit field and clicking on the Button , I want to hide the virtual keyboard. I assume that this is a simple piece of code, but where can I find an example of it? 回答1: To help clarify this madness, I'd like to begin by apologizing on behalf of all Android users for Google's downright ridiculous treatment of the soft keyboard. The reason there are so many answers, each different, for the same simple question because this API,

Disabling the fullscreen editing view for soft keyboard input in landscape?

牧云@^-^@ 提交于 2019-11-26 00:46:04
问题 On Android devices that use soft keyboards, I want to prevent the fullscreen keyboard editing view (shown below) from appearing when in landscape mode (i.e. I want to see only the soft keyboard itself and my view behind it). I assume this can be achieved using the setExtractViewShown(false) method on InputMethodService , but I am unable to access the default instance of this and do not want to implement a custom input method. Edited to add: the view to which input is going is not a TextView

Implementations of Emoji (Emoticon) View/Keyboard Layouts

徘徊边缘 提交于 2019-11-26 00:32:18
问题 I am trying to figure out how the emoji (emoticon) selections are implemented on the Facebook app and the Google Hangouts app. I looked into the SoftKeyboard Demo app in the Android API Samples but the display of these emoji views does not look like a SoftKeyboard . It looks and behaves more like a custom Dialog view. Does anyone have an idea of how these are implemented? Facebook App Google Hangouts app Also, is Unicode the best way to send emoticons or is there an alternative? I noticed

Android How to adjust layout in Full Screen Mode when softkeyboard is visible

a 夏天 提交于 2019-11-26 00:04:39
问题 I have researched a lot to adjust the layout when softkeyboard is active and I have successfully implemented it but the problem comes when I use android:theme=\"@android:style/Theme.NoTitleBar.Fullscreen\" this in my activity tag in manifest file. For this I have used android:windowSoftInputMode=\"adjustPan|adjustResize|stateHidden\" with different options but no luck. After that I implemented FullScreen programmatically and tried various layout to work with FullScreen but all in vain. I