Ionic 2 Android Full Screen: Android full screen plugin enables developers to create a true fullscreen experience for users. It supports all Android 4.0+ versions, This provides functionality to expand in fullscreen mode and hides navigation bar and status until the user interacts it. Here in this documentation, we are going to explain how you can use this feature in the Ionic framework.
Ionic 2 Android Full Screen | Native Full Screen Example
You can install the Cordova-plugin-fullscreen plugin simply as below-
Install Ionic 2 Android Fullscreen Plugin
Run the below command to install this plugin –
Install Ionic 2 Android Full Screen Plugin Syntax:
$ ionic plugin add cordova-plugin-fullscreen $ npm install --save @ionic-native/android-full-screen |
Supported Platforms
- Android
Example
Let us create a simple example of cordova full screen plugin in Ionic-
Ionic 2 Android Full Screen Example:
import { AndroidFullScreen } from '@ionic-native/android-full-screen'; constructor(private androidFullScreen: AndroidFullScreen) { } ... this.androidFullScreen.isImmersiveModeSupported() .then(() => this.androidFullScreen.immersiveMode()) .catch((error: any) => console.log(error)); |
Instance Members
Following Instance Members are available –
- isSupported()– This is used to check whether this plugin is supported or not.
- isImmersiveModeSupported()– This is used to check whether ImmersiveMode is Supported or not.
- immersiveWidth()– Returns the width in immersive mode.
- immersiveHeight()– Returns the height in immersive mode.
- leanMode()– Hide system UI until user interacts.
- showSystemUI()– This is used to show the system UI.
- showUnderStatusBar()– Extend your app underneath the status bar. This is supported only on Android 4.4+.
- showUnderSystemUI()– Extend your app underneath the system UI. This is supported only on Android 4.4+.
- immersiveMode()– Hide system UI and keep it hidden. This is supported only on Android 4.4+.