List of usage examples for android.view View SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
int SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
To view the source code for android.view View SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN.
Click Source Link
From source file:enterprayz.megatools.Tools.java
public static void setStatusBarColor(Activity activity, int resColor) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { setTranslucentStatus(activity, true); Window window = activity.getWindow(); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); activity.getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); window.setStatusBarColor(ContextCompat.getColor(activity, resColor)); }// w w w.j a v a2 s . co m }
From source file:com.freshdigitable.udonroad.MediaViewActivity.java
private void hideSystemUI() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar | View.SYSTEM_UI_FLAG_IMMERSIVE); } else {// w w w . jav a2 s. c o m getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar ); } }
From source file:com.wowza.gocoder.sdk.sampleapp.GoCoderSDKActivityBase.java
/** * Enable Android's sticky immersive full-screen mode * See http://developer.android.com/training/system-ui/immersive.html#sticky *//*from w w w.j a v a 2 s.c o m*/ @Override public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); if (sFullScreenActivity && hasFocus) { View rootView = getWindow().getDecorView().findViewById(android.R.id.content); if (rootView != null) rootView.setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); } }
From source file:com.oceansky.yellow.app.MainActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (!WelcomeActivity.hasDoneWelcomeWizard(this)) { Intent intent = new Intent(this, WelcomeActivity.class); startActivity(intent);/*from w w w . j a va 2 s .c o m*/ finish(); } else { // Load UI setContentView(R.layout.activity_main); // Ensure we have READ_EXTERNAL_STORAGE for Music database in LocalProvider // Ensure we have WRITE_EXTERNAL_STORAGE for Album arts storage if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, new String[] { Manifest.permission.WRITE_EXTERNAL_STORAGE }, PERM_REQUEST_APP_CORE_PERMISSIONS); } mToolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(mToolbar); mNavigationDrawerFragment = (NavigationDrawerFragment) getSupportFragmentManager() .findFragmentById(R.id.navigation_drawer); if (mTitle == null) { onSectionAttached(mCurrentFragmentIndex); } // Set up the drawer. mNavigationDrawerFragment.setUp(R.id.navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout)); // Setup the playing bar click listener mPlayingBarLayout = (PlayingBarView) findViewById(R.id.playingBarLayout); mPlayingBarLayout.setWrapped(true, false); // Setup Cast button mCastModule = new CastModule(getApplicationContext()); // Look for un-configured plugins in a second mHandler.postDelayed(new Runnable() { @Override public void run() { lookForUnconfiguredProviders(); } }, 1000); } getWindow().getDecorView() .setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); }
From source file:com.raspi.chatapp.ui.image.SingleImageFragment.java
private void showOverlay(boolean active) { final View imageInfo = getActivity().findViewById(R.id.image_info); Animation anim;// w ww .ja va 2 s . com if (active) { View decorView = getActivity().getWindow().getDecorView(); int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE; decorView.setSystemUiVisibility(uiOptions); anim = AnimationUtils.loadAnimation(getContext(), R.anim.bottom_in); anim.setDuration(300); imageInfo.setVisibility(View.VISIBLE); imageInfo.startAnimation(anim); } else { View decorView = getActivity().getWindow().getDecorView(); int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE; decorView.setSystemUiVisibility(uiOptions); anim = AnimationUtils.loadAnimation(getContext(), R.anim.bottom_out); anim.setDuration(300); anim.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { imageInfo.setVisibility(View.GONE); } @Override public void onAnimationRepeat(Animation animation) { } }); imageInfo.startAnimation(anim); } overlayActive = active; }
From source file:com.experiments.whereapp.application.home.activities.HomeActivity.java
@TargetApi(Build.VERSION_CODES.KITKAT) @Override/* ww w . ja v a2 s . c o m*/ public void makeStatusBarTransparent() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) return; Window window = getWindow(); window.getDecorView() .setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { window.setStatusBarColor(Color.TRANSPARENT); } else { window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); } }
From source file:com.example.android.immersive.ImmersiveDrawerActivity.java
private void hideSystemUI() { mDecorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LOW_PROFILE | View.SYSTEM_UI_FLAG_IMMERSIVE); }
From source file:gl.iglou.scenegraph.MatModeInterface.java
@Override public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); if (hasFocus) { decorView.setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); }/*from ww w . j ava 2s . com*/ }
From source file:org.uoyabause.android.YabauseHandler.java
/** Called when the activity is first created. */ @Override/*from w w w . j a va 2 s . c o m*/ public void onCreate(Bundle savedInstanceState) { SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(Yabause.this); boolean lock_landscape = sharedPref.getBoolean("pref_landscape", false); if (lock_landscape == true) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); } else { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); } super.onCreate(savedInstanceState); System.gc(); YabauseApplication application = (YabauseApplication) getApplication(); mTracker = application.getDefaultTracker(); setContentView(R.layout.main); getWindow().setSustainedPerformanceMode(true); getWindow().addFlags( WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON | WindowManager.LayoutParams.FLAG_FULLSCREEN); mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawerLayout.setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); mNavigationView = (NavigationView) findViewById(R.id.nav_view); mNavigationView.setNavigationItemSelectedListener(this); if (sharedPref.getBoolean("pref_analog_pad", false) == true) { mNavigationView.setCheckedItem(R.id.pad_mode); } DrawerLayout.DrawerListener drawerListener = new DrawerLayout.DrawerListener() { @Override public void onDrawerSlide(View view, float v) { } @Override public void onDrawerOpened(View view) { if (menu_showing == false) { menu_showing = true; YabauseRunnable.pause(); audio.mute(audio.SYSTEM); String name = YabauseRunnable.getGameTitle(); TextView tx = (TextView) findViewById(R.id.menu_title); if (tx != null) { tx.setText(name); } if (adView != null) { LinearLayout lp = (LinearLayout) findViewById(R.id.navilayer); if (lp != null) { final int mCount = lp.getChildCount(); boolean find = false; for (int i = 0; i < mCount; ++i) { final View mChild = lp.getChildAt(i); if (mChild == adView) { find = true; } } if (find == false) { lp.addView(adView); } AdRequest adRequest = new AdRequest.Builder() .addTestDevice("303A789B146C169D4BDB5652D928FF8E").build(); adView.loadAd(adRequest); } } } } @Override public void onDrawerClosed(View view) { if (waiting_reault == false && menu_showing == true) { menu_showing = false; YabauseRunnable.resume(); audio.unmute(audio.SYSTEM); } } @Override public void onDrawerStateChanged(int i) { } }; this.mDrawerLayout.setDrawerListener(drawerListener); audio = new YabauseAudio(this); Intent intent = getIntent(); String game = intent.getStringExtra("org.uoyabause.android.FileName"); if (game != null && game.length() > 0) { YabauseStorage storage = YabauseStorage.getStorage(); gamepath = storage.getGamePath(game); } else gamepath = ""; String exgame = intent.getStringExtra("org.uoyabause.android.FileNameEx"); if (exgame != null) { gamepath = exgame; } PreferenceManager.setDefaultValues(this, R.xml.preferences, false); readPreferences(); padm = PadManager.getPadManager(); padm.loadSettings(); waiting_reault = false; handler = new YabauseHandler(this); yabauseThread = new YabauseRunnable(this); UiModeManager uiModeManager = (UiModeManager) getSystemService(Context.UI_MODE_SERVICE); if (uiModeManager.getCurrentModeType() != Configuration.UI_MODE_TYPE_TELEVISION) { SharedPreferences prefs = getSharedPreferences("private", Context.MODE_PRIVATE); Boolean hasDonated = prefs.getBoolean("donated", false); if (hasDonated) { adView = null; } else { adView = new AdView(this); adView.setAdUnitId(getString(R.string.banner_ad_unit_id2)); adView.setAdSize(AdSize.BANNER); AdRequest adRequest = new AdRequest.Builder().build(); adView.loadAd(adRequest); adView.setAdListener(new AdListener() { @Override public void onAdOpened() { // Save app state before going to the ad overlay. } }); } } else { adView = null; } }
From source file:com.google.android.apps.muzei.MainFragment.java
@Override public void onViewCreated(@NonNull final View view, @Nullable final Bundle savedInstanceState) { // Set up the action bar final View actionBarContainer = view.findViewById(R.id.action_bar_container); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { actionBarContainer.setBackground(ScrimUtil.makeCubicGradientScrimDrawable(0x44000000, 8, Gravity.TOP)); }//w w w . j ava 2s . c o m final Toolbar toolbar = view.findViewById(R.id.toolbar); AppCompatActivity activity = (AppCompatActivity) getActivity(); if (activity != null) { activity.setSupportActionBar(toolbar); activity.getSupportActionBar().setDisplayShowTitleEnabled(false); } // Set up the container for the child fragments final View container = view.findViewById(R.id.container); if (savedInstanceState == null) { FirebaseAnalytics.getInstance(getActivity()).setCurrentScreen(getActivity(), "ArtDetail", ArtDetailFragment.class.getSimpleName()); getChildFragmentManager().beginTransaction().replace(R.id.container, new ArtDetailFragment()).commit(); } // Set up the bottom nav final BottomNavigationView bottomNavigationView = view.findViewById(R.id.bottom_nav); bottomNavigationView .setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() { @Override public boolean onNavigationItemSelected(@NonNull final MenuItem item) { if (getChildFragmentManager().isStateSaved()) { // Can't navigate after the state is saved return false; } switch (item.getItemId()) { case R.id.main_art_details: FirebaseAnalytics.getInstance(getContext()).setCurrentScreen(getActivity(), "ArtDetail", ArtDetailFragment.class.getSimpleName()); getChildFragmentManager().beginTransaction() .replace(R.id.container, new ArtDetailFragment()) .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE).commit(); return true; case R.id.main_choose_source: FirebaseAnalytics.getInstance(getContext()).setCurrentScreen(getActivity(), "ChooseSource", ChooseSourceFragment.class.getSimpleName()); getChildFragmentManager().popBackStack("main", FragmentManager.POP_BACK_STACK_INCLUSIVE); getChildFragmentManager().beginTransaction() .replace(R.id.container, new ChooseSourceFragment()).addToBackStack("main") .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE).commit(); return true; case R.id.main_effects: FirebaseAnalytics.getInstance(getContext()).setCurrentScreen(getActivity(), "Effects", EffectsFragment.class.getSimpleName()); getChildFragmentManager().popBackStack("main", FragmentManager.POP_BACK_STACK_INCLUSIVE); getChildFragmentManager().beginTransaction() .replace(R.id.container, new EffectsFragment()).addToBackStack("main") .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE).commit(); return true; default: return false; } } }); bottomNavigationView.setOnNavigationItemReselectedListener( new BottomNavigationView.OnNavigationItemReselectedListener() { @Override public void onNavigationItemReselected(@NonNull final MenuItem item) { if (item.getItemId() == R.id.main_art_details) { getActivity().getWindow().getDecorView() .setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); } } }); // Send the correct window insets to each view ViewCompat.setOnApplyWindowInsetsListener(view, new OnApplyWindowInsetsListener() { @Override public WindowInsetsCompat onApplyWindowInsets(final View v, final WindowInsetsCompat insets) { // Ensure the action bar container gets the appropriate insets ViewCompat.dispatchApplyWindowInsets(actionBarContainer, insets.replaceSystemWindowInsets(insets.getSystemWindowInsetLeft(), insets.getSystemWindowInsetTop(), insets.getSystemWindowInsetRight(), 0)); ViewCompat.dispatchApplyWindowInsets(container, insets.replaceSystemWindowInsets( insets.getSystemWindowInsetLeft(), 0, insets.getSystemWindowInsetRight(), 0)); ViewCompat.dispatchApplyWindowInsets(bottomNavigationView, insets.replaceSystemWindowInsets(insets.getSystemWindowInsetLeft(), 0, insets.getSystemWindowInsetRight(), insets.getSystemWindowInsetBottom())); return insets; } }); // Listen for visibility changes to know when to hide our views view.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() { @Override public void onSystemUiVisibilityChange(int vis) { final boolean visible = (vis & View.SYSTEM_UI_FLAG_LOW_PROFILE) == 0; actionBarContainer.setVisibility(View.VISIBLE); actionBarContainer.animate().alpha(visible ? 1f : 0f).setDuration(200) .withEndAction(new Runnable() { @Override public void run() { if (!visible) { actionBarContainer.setVisibility(View.GONE); } } }); bottomNavigationView.setVisibility(View.VISIBLE); bottomNavigationView.animate().alpha(visible ? 1f : 0f).setDuration(200) .withEndAction(new Runnable() { @Override public void run() { if (!visible) { bottomNavigationView.setVisibility(View.GONE); } } }); } }); }