Android Immersive full-screen

Source: Internet
Author: User

Android 4.4 brings immersive full-screen experience, in immersive full-screen mode, the status bar, virtual keys dynamically hidden, the application can use the full screen space, according to Google, to give users an "immersive" experience.

Android 4.4 provides IMMERSIVE and IMMERSIVE_STICKY tags that can be used with and with these two SYSTEM_UI_FLAG_HIDE_NAVIGATION tags SYSTEM_UI_FLAG_FULLSCREEN to achieve immersive mode.

Note: These tokens are mapped as enumerations in Xamarin.android Android.Views.SystemUiFlags . Normal full screen mode (fullscreen)

Normal full screen mode is implemented by setting the following tag bit:

var uiOpts = SystemUiFlags.LayoutStable        | SystemUiFlags.LayoutHideNavigation        | SystemUiFlags.LayoutFullscreen        | SystemUiFlags.Fullscreen        | SystemUiFlags.HideNavigation;Window.DecorView.SystemUiVisibility = uiOpts;

In normal full-screen mode, the app can occupy the entire screen space, when the user touches any part of the screen, will automatically exit the full-screen mode, this mode is suitable for the video player class application.

Immersion Mode (Immersive)

Immersion mode is implemented by setting the following tag bit:

var uiOpts = uiOpts = SystemUiFlags.LayoutStable        | SystemUiFlags.LayoutHideNavigation        | SystemUiFlags.LayoutFullscreen        | SystemUiFlags.Fullscreen        | SystemUiFlags.HideNavigation        | SystemUiFlags.Immersive;Window.DecorView.SystemUiVisibility = uiOpts;

In immersion mode, the app takes up all the space on the screen and only exits the immersion mode when the user moves down from the top edge of the screen, and the user touches the other part of the screen and does not exit the mode, which is more suitable for readers and magazine applications.

Viscous immersion mode (Sticky Immersive)

The sticky immersion mode is implemented by setting the following marker bit:

uiOpts = SystemUiFlags.LayoutStable        | SystemUiFlags.LayoutHideNavigation        | SystemUiFlags.LayoutFullscreen        | SystemUiFlags.Fullscreen        | SystemUiFlags.HideNavigation        | SystemUiFlags.ImmersiveSticky;Window.DecorView.SystemUiVisibility = uiOpts;

In sticky immersion mode, the app uses all of the screen's space and does not exit when the user slides down from the top edge of the screen, but the system interface (status bar, navigation bar) will appear in a translucent effect on the app view (as shown), leaving the stickiness only when the user taps the control on the system interface Immersion mode. Therefore, this full-screen mode is used with the game, drawing class application.

As mentioned in the Android development documentation, it is best to set ActionBar to Overlay mode when using immersion mode, which can be found here: https://developer.android.com/training/basics/ Actionbar/overlaying.html

Transferred from: http://beginor.github.io/2014/06/27/android-immersive-mode.html

Android Immersive full-screen

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.