diff options
author | Maurice Lam <yukl@google.com> | 2015-06-08 18:43:27 -0700 |
---|---|---|
committer | Maurice Lam <yukl@google.com> | 2015-06-09 10:23:07 -0700 |
commit | 35ef4eb340353962f23cab81a33b2ddbdfce1da7 (patch) | |
tree | 49090a5ddc0a4a97e26f7ccb1d4a676a8a624214 | |
parent | 1a9708016810992f8ca3394189939f372c47816c (diff) | |
download | setupwizard-35ef4eb340353962f23cab81a33b2ddbdfce1da7.tar.gz |
[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.java | 4 |
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() { |