summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaurice Lam <yukl@google.com>2015-06-08 18:43:27 -0700
committerMaurice Lam <yukl@google.com>2015-06-09 10:23:07 -0700
commit35ef4eb340353962f23cab81a33b2ddbdfce1da7 (patch)
tree49090a5ddc0a4a97e26f7ccb1d4a676a8a624214
parent1a9708016810992f8ca3394189939f372c47816c (diff)
downloadandroid_frameworks_opt_setupwizard-35ef4eb340353962f23cab81a33b2ddbdfce1da7.tar.gz
android_frameworks_opt_setupwizard-35ef4eb340353962f23cab81a33b2ddbdfce1da7.tar.bz2
android_frameworks_opt_setupwizard-35ef4eb340353962f23cab81a33b2ddbdfce1da7.zip
[SetupWizardLib] Allow showing keyboard in immersive dialogs
Addd the flag SOFT_INPUT_IS_FORWARD_NAVIGATION when hiding dialog system bars so that if the dialog wants focus to show IME by default, it can do so. Bug: 20639199 Change-Id: I87dc40bbaae71572bbe4b94b92be40342f117613
-rw-r--r--library/main/src/com/android/setupwizardlib/util/SystemBarHelper.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/library/main/src/com/android/setupwizardlib/util/SystemBarHelper.java b/library/main/src/com/android/setupwizardlib/util/SystemBarHelper.java
index 2bc00a1..a0e765d 100644
--- a/library/main/src/com/android/setupwizardlib/util/SystemBarHelper.java
+++ b/library/main/src/com/android/setupwizardlib/util/SystemBarHelper.java
@@ -202,6 +202,10 @@ public class SystemBarHelper {
private static void temporarilyDisableDialogFocus(final Window window) {
window.setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
+ // Add the SOFT_INPUT_IS_FORWARD_NAVIGATION_FLAG. This is normally done by the system when
+ // FLAG_NOT_FOCUSABLE is not set. Setting this flag allows IME to be shown automatically
+ // if the dialog has editable text fields.
+ window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_IS_FORWARD_NAVIGATION);
new Handler().post(new Runnable() {
@Override
public void run() {