Last active
August 29, 2015 14:04
-
-
Save kingargyle/c23624f26b4c9b384f79 to your computer and use it in GitHub Desktop.
Resize Dialog for Soft Keyboard input with Text Views
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Make sure that the Dialog size adjusts when the softlkeyboard is displayed. | |
*/ | |
alertDialog.getWindow().setSoftInputMode( | |
WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); | |
/** | |
* Over ride onCheckIsTextEditor to always make sure the Webview | |
* brings up the softkeyboard when in an input field. There | |
* are situations like in a Dialog where the Softkeyboard will | |
* not display. | |
*/ | |
WebView newWebView = new WebView(webView.getContext()) { | |
@Override | |
public boolean onCheckIsTextEditor() { | |
return true; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment