Skip to content

KevinBatdorf/nativephp-fullscreen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fullscreen Plugin for NativePHP Mobile

Enter and exit fullscreen (immersive) mode.

Installation

composer require kevinbatdorf/nativephp-fullscreen

Usage

use KevinBatdorf\Fullscreen\Facades\Fullscreen;

// Enter fullscreen (hide status bar + navigation bar)
Fullscreen::enter();

// Exit fullscreen (show system bars)
Fullscreen::exit();

// Check if fullscreen mode is active
$active = Fullscreen::isActive();

JavaScript

import { Fullscreen } from '@kevinbatdorf/nativephp-fullscreen';

await Fullscreen.enter();
await Fullscreen.exit();
const active = await Fullscreen.isActive();

Platform Behavior

  • Android: Uses WindowInsetsControllerCompat with BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE. System bars reappear briefly on edge swipe, then auto-hide. Fullscreen persists across page navigations natively.
  • iOS: Swizzles the root UIViewController to hide the status bar and home indicator. Negates safe area insets so content extends into the notch/dynamic island. Injects CSS to zero out NativePHP's safe area variables (--inset-*, --sat/sar/sab/sal) and removes body.nativephp-safe-area padding. A WKUserScript at document start reads a sessionStorage flag to apply fullscreen CSS before the page renders, preventing flash-of-insets on navigation. A KVO observer on WKWebView.isLoading re-injects CSS after each page load. Orientation changes are handled automatically.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors