DEV Community

Meyti
Meyti

Posted on

Enable fullscreen view on nativescript-vue

import * as app from 'tns-core-modules/application'
import { device } from 'tns-core-modules/platform'

export function hideSystemUi () {
  if (!app.android || parseInt(device.sdkVersion) < 21) { return }
  const androidViewPkg = android.view // eslint-disable-line no-undef
  const window = app.android.startActivity.getWindow()
  window.addFlags(androidViewPkg.WindowManager.LayoutParams.FLAG_FULLSCREEN)
  window.clearFlags(androidViewPkg.WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN)
}

export function showSystemUi () {
  if (!app.android || parseInt(device.sdkVersion) < 21) { return }
  const androidViewPkg = android.view // eslint-disable-line no-undef
  const window = app.android.startActivity.getWindow()
  window.addFlags(androidViewPkg.WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN)
  window.clearFlags(androidViewPkg.WindowManager.LayoutParams.FLAG_FULLSCREEN)
}

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up