Download the PHP package smronju/nativephp-appearance without Composer
On this page you can find all versions of the php package smronju/nativephp-appearance. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download smronju/nativephp-appearance
More information about smronju/nativephp-appearance
Files in smronju/nativephp-appearance
Package nativephp-appearance
Short Description Force the app into light or dark mode independent of the system setting, or release it back to following the system automatically.
License MIT
Homepage https://github.com/smronju/nativephp-appearance
Informations about the package nativephp-appearance
NativePHP Appearance
Forces a NativePHP Mobile app into light or dark mode independent of the OS setting, or releases it back to following the system automatically.
bg-theme-*/text-theme-* classes already resolve their dark companion
natively based on the OS color scheme — there is no PHP-facing API to override
that, only to read it (Native\Mobile\Facades\System::appearance()). This
plugin adds the missing write side.
Requirements
nativephp/mobile^3.0 or ^4.0- iOS 15.0+ — fully supported via
UIWindow.overrideUserInterfaceStyle. - Android — requires API 31+ (
UiModeManager.setApplicationNightMode, the only per-app override Android exposes outside ofAppCompatActivity). Below API 31,setMode()silently no-ops rather than partially applying.
Installation
Then rebuild: php artisan native:run.
Usage
Fire-and-forget: there's no event to listen for, and no result to branch on — either the override applies (iOS always; Android on API 31+) or the call is a safe no-op (Android below API 31).
License
MIT