diff options
author | cretin45 <cretin45@gmail.com> | 2015-04-09 10:44:41 -0700 |
---|---|---|
committer | Ed Carrigan <cretin45@gmail.com> | 2015-04-09 20:35:42 +0000 |
commit | 714be1a4909abd4464f0eb56875c26caa3ed1d9f (patch) | |
tree | 27013e15e06974c84b053c7fb2d5c917b2fe09ff /src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java | |
parent | 317a15e0eb426c2a7a9b46f25fb8fd2934dba690 (diff) | |
download | packages_apps_SetupWizard-714be1a4909abd4464f0eb56875c26caa3ed1d9f.zip packages_apps_SetupWizard-714be1a4909abd4464f0eb56875c26caa3ed1d9f.tar.gz packages_apps_SetupWizard-714be1a4909abd4464f0eb56875c26caa3ed1d9f.tar.bz2 |
SetupWizard: Aggressively hide nav bar on soft key devices
Change-Id: Ic23fd7e605a323411fe2f581235ff3ed45bfcaed
(cherry picked from commit 1d7988a4c78aa8a4c768e8ddb8e0ced2c8f8c530)
Diffstat (limited to 'src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java')
-rw-r--r-- | src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java b/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java index 65a9806..f37b3f8 100644 --- a/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java +++ b/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java @@ -56,6 +56,12 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks, private static final String TAG = SetupWizardActivity.class.getSimpleName(); + private static final int UI_FLAGS = View.SYSTEM_UI_FLAG_LAYOUT_STABLE + | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN + | View.SYSTEM_UI_FLAG_IMMERSIVE + | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; + private View mRootView; private View mButtonBar; private Button mNextButton; @@ -77,12 +83,25 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks, public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + final View decorView = getWindow().getDecorView(); + decorView.setSystemUiVisibility(UI_FLAGS); + decorView.setOnSystemUiVisibilityChangeListener( + new View.OnSystemUiVisibilityChangeListener() { + + @Override + public void onSystemUiVisibilityChange(int visibility) { + if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) { + decorView.setSystemUiVisibility(UI_FLAGS); + } + } + }); if (sLaunchTime == 0) { SetupStats.addEvent(SetupStats.Categories.APP_LAUNCH, TAG); sLaunchTime = System.nanoTime(); } setContentView(R.layout.setup_main); mRootView = findViewById(R.id.root); + mRootView.setSystemUiVisibility(UI_FLAGS); mReveal = (ImageView)mRootView.findViewById(R.id.reveal); mButtonBar = findViewById(R.id.button_bar); mFinishingProgressBar = (ProgressBar)findViewById(R.id.finishing_bar); @@ -134,10 +153,8 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks, @Override protected void onResume() { - getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE - | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN - | View.SYSTEM_UI_FLAG_IMMERSIVE - | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); + final View decorView = getWindow().getDecorView(); + decorView.setSystemUiVisibility(UI_FLAGS); super.onResume(); if (mSetupData.isFinished()) { mHandler.postDelayed(new Runnable() { |