diff options
author | Maurice Lam <yukl@google.com> | 2015-01-22 11:33:28 -0800 |
---|---|---|
committer | Maurice Lam <yukl@google.com> | 2015-04-09 16:27:13 -0700 |
commit | 3f7c09bd5ab386290b5391154f26d7c11b0a64ea (patch) | |
tree | 04ee9e5b82d69aa40fd627f248b51a59b3f91647 /src/com/android/settings/SetupWizardUtils.java | |
parent | 342d08537fe316f0d046a3a3097c294e4b30e912 (diff) | |
download | packages_apps_Settings-3f7c09bd5ab386290b5391154f26d7c11b0a64ea.zip packages_apps_Settings-3f7c09bd5ab386290b5391154f26d7c11b0a64ea.tar.gz packages_apps_Settings-3f7c09bd5ab386290b5391154f26d7c11b0a64ea.tar.bz2 |
[WifiSetup] Make dialogs immersive
Added a dialog specific applyImmersiveFlags method that adds
immersive flags without the LAYOUT_ flags. The LAYOUT_ flags causes
the dialog to not resize when IME is visible, and the dialog doesn't
need to be drawn under the navigation / status bars anyway.
Bug: 17759269
Change-Id: I0186e85d9f398af73c511b1a5ec6e83febe97f83
Diffstat (limited to 'src/com/android/settings/SetupWizardUtils.java')
-rw-r--r-- | src/com/android/settings/SetupWizardUtils.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/com/android/settings/SetupWizardUtils.java b/src/com/android/settings/SetupWizardUtils.java index e83482a..6762bfe 100644 --- a/src/com/android/settings/SetupWizardUtils.java +++ b/src/com/android/settings/SetupWizardUtils.java @@ -21,17 +21,23 @@ import com.android.setupwizard.navigationbar.SetupWizardNavBar; import android.app.Activity; +import android.app.Dialog; import android.content.Intent; import android.graphics.Color; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.LayerDrawable; +import android.view.View; import android.view.Window; +import android.view.WindowManager; import android.widget.TextView; public class SetupWizardUtils { private static final String TAG = "SetupWizardUtils"; + public static final int DIALOG_IMMERSIVE_FLAGS = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; + // Extra containing the resource name of the theme to be used public static final String EXTRA_THEME = "theme"; public static final String THEME_HOLO = "holo"; @@ -95,6 +101,16 @@ public class SetupWizardUtils { } } + public static void applyImmersiveFlags(final Dialog dialog) { + applyImmersiveFlags(dialog.getWindow(), DIALOG_IMMERSIVE_FLAGS); + } + + private static void applyImmersiveFlags(final Window window, final int vis) { + WindowManager.LayoutParams attrs = window.getAttributes(); + attrs.systemUiVisibility |= vis; + window.setAttributes(attrs); + } + public static TextView getHeader(Activity activity) { return (TextView) activity.findViewById(R.id.title); } |