==============================
Plugin for Cordova (or PhoneGap) 3.0+ to enable true full screen on Android devices using lean and immersive modes.
Released under BSD license; see LICENSE for details.
Supported Android versions: 4.4 (KitKat) to 15+
⚠ Note for Android 15+: The navigation bar cannot be fully hidden due to system limitations. The plugin automatically adjusts your app's UI to avoid overlap.
This plugin enables developers to offer users a true full screen experience in their Cordova and PhoneGap apps for Android.
- Lean Mode (Android 4.4+): Hides system UI temporarily until the user interacts. Ideal for video or cut-scene content.
- Immersive Mode (Android 4.4+): Keeps your app in true full screen. Users can swipe from the top to temporarily reveal system UI.
Cordova
cordova plugin add cordova-plugin-fullscreen-plus
From version 2.1.0, the plugin ID has changed to cordova-plugin-fullscreen-plus in line with the official Cordova plugin naming coventions following the switch to NPM. We therefore recommend that any previous version be uninstalled before upgrading to this release.
Since the release of android@5.0.0, setting <preference name="Fullscreen" value="true" /> in config.xml will use immersive mode, where available, even without this plugin.
Using the plugin in your app couldn't be easier:
function successFunction()
{
console.info("It worked!");
}
function errorFunction(error)
{
console.error(error);
}
function trace(value)
{
console.log(value);
}
// Is this plugin supported?
AndroidFullScreen.isSupported(successFunction, errorFunction);
// Is immersive mode supported?
AndroidFullScreen.isImmersiveModeSupported(successFunction, errorFunction);
// The width of the screen in immersive mode
AndroidFullScreen.immersiveWidth(trace, errorFunction);
// The height of the screen in immersive mode
AndroidFullScreen.immersiveHeight(trace, errorFunction);
// Hide system UI until user interacts
AndroidFullScreen.leanMode(successFunction, errorFunction);
// Show system UI
AndroidFullScreen.showSystemUI(successFunction, errorFunction);
// Extend your app underneath the status bar (Android 4.4+ only)
AndroidFullScreen.showUnderStatusBar(successFunction, errorFunction);
// Extend your app underneath the system UI (Android 4.4+ only)
AndroidFullScreen.showUnderSystemUI(successFunction, errorFunction);
// Hide system UI and keep it hidden (Android 4.4+ only)
AndroidFullScreen.immersiveMode(successFunction, errorFunction);
// Custom full screen mode
// See https://developer.android.com/reference/android/view/View.html#setSystemUiVisibility(int)
AndroidFullScreen.setSystemUiVisibility(AndroidFullScreen.SYSTEM_UI_FLAG_FULLSCREEN | AndroidFullScreen.SYSTEM_UI_FLAG_LOW_PROFILE, successFunction, errorFunction);All methods will call the successFunction callback if the action was successful and the errorFunction if it wasn't (or isn't supported); if you're using the plugin in an app for a platform other than Android, all methods will fail.
The immersiveWidth and immersiveHeight properties return the screen width and height available in immersive mode (or with the system UI hidden), where supported.
You can use the immersiveWidth and immersiveHeight methods to find out the dimensions of the screen with the system UI hidden, regardless of the current screen state.
این پلاگین برای Cordova یا PhoneGap 3.0+ طراحی شده تا حالت فول اسکرین واقعی روی دستگاه های اندروید با استفاده از Lean و Immersive Mode فعال شود.
نسخه های پشتیبانی شده اندروید: 4.4 (KitKat) تا 15+
⚠ توجه برای اندروید ۱۵+: نوار ناوبری (Navigation Bar) نمی تواند به طور کامل مخفی شود. پلاگین به صورت خودکار UI اپ شما را برای جلوگیری از هم پوشانی با سیستم UI تنظیم می کند.
این پلاگین امکان ارائه تجربه فول اسکرین واقعی را برای کاربران اپ های Cordova و PhoneGap فراهم می کند.
Lean Mode (اندروید ۴.۴+): مخفی کردن موقت نوار وضعیت و ناوبری تا زمانی که کاربر تعامل کند. مناسب برای ویدیو یا محتواهای تمام صفحه.
Immersive Mode (اندروید ۴.۴+): نگه داشتن اپ در حالت فول اسکرین واقعی. کاربران می توانند با سوایپ از بالا نوار سیستم را به طور موقت مشاهده کنند.