diff --git a/lib/app/changelog.dart b/lib/app/changelog.dart index b48ab2f..9157147 100644 --- a/lib/app/changelog.dart +++ b/lib/app/changelog.dart @@ -1,4 +1,13 @@ const lunarisChangelog = [ + LunarisChange( + version: '2.3.5', + title: 'Fullscreen Video Auto-Rotation & Orientation Controls', + bullets: [ + 'Smart Fullscreen Auto-Rotation: entering fullscreen mode on horizontal/landscape videos automatically snaps the device into landscape orientation for maximum viewing area, while vertical/portrait videos stay in portrait mode.', + 'Manual Orientation Toggle: added a quick-access rotation button (Icons.screen_lock_portrait / landscape) directly in the fullscreen top bar next to the close button, allowing 1-tap switching between landscape and portrait.', + 'Clean Orientation Recovery: exiting fullscreen seamlessly restores system navigation bars (Edge-to-Edge) and restores unrestricted device sensor orientations.', + ], + ), LunarisChange( version: '2.3.4', title: 'OverlayPortal Architecture & Search UI Unblocking', diff --git a/lib/features/post/presentation/widgets/post_media_viewer.dart b/lib/features/post/presentation/widgets/post_media_viewer.dart index a1a2ac2..a194dd7 100644 --- a/lib/features/post/presentation/widgets/post_media_viewer.dart +++ b/lib/features/post/presentation/widgets/post_media_viewer.dart @@ -701,6 +701,7 @@ class _FullscreenVideoPageState extends State<_FullscreenVideoPage> { late bool _muted; late bool _loopVideo; late bool _halfVolume; + late bool _isLandscape; Timer? _hideTimer; @override @@ -710,15 +711,32 @@ class _FullscreenVideoPageState extends State<_FullscreenVideoPage> { _muted = widget.muted; _loopVideo = widget.loopVideo; _halfVolume = widget.halfVolume; + _isLandscape = widget.aspectRatio > 1.05; SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky); - SystemChrome.setPreferredOrientations([ - DeviceOrientation.landscapeLeft, - DeviceOrientation.landscapeRight, - DeviceOrientation.portraitUp, - ]); + _applyOrientation(); _scheduleControlsHide(); } + void _applyOrientation() { + if (_isLandscape) { + SystemChrome.setPreferredOrientations([ + DeviceOrientation.landscapeLeft, + DeviceOrientation.landscapeRight, + ]); + } else { + SystemChrome.setPreferredOrientations([ + DeviceOrientation.portraitUp, + DeviceOrientation.portraitDown, + ]); + } + } + + void _toggleOrientation() { + setState(() => _isLandscape = !_isLandscape); + _applyOrientation(); + _showControls(); + } + @override void dispose() { _hideTimer?.cancel(); @@ -814,13 +832,28 @@ class _FullscreenVideoPageState extends State<_FullscreenVideoPage> { top: 12, right: 12, child: SafeArea( - child: IconButton.filledTonal( - tooltip: 'Close fullscreen', - onPressed: () => Navigator.of( - context, - rootNavigator: true, - ).pop(_snapshot()), - icon: const Icon(Icons.close_rounded), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + IconButton.filledTonal( + tooltip: _isLandscape + ? 'Портретная ориентация' + : 'Альбомная ориентация', + onPressed: _toggleOrientation, + icon: Icon(_isLandscape + ? Icons.screen_lock_portrait_rounded + : Icons.screen_lock_landscape_rounded), + ), + const SizedBox(width: 8), + IconButton.filledTonal( + tooltip: 'Close fullscreen', + onPressed: () => Navigator.of( + context, + rootNavigator: true, + ).pop(_snapshot()), + icon: const Icon(Icons.close_rounded), + ), + ], ), ), ), diff --git a/pubspec.yaml b/pubspec.yaml index 4302b95..7aad424 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: gel_rule_app description: Local backend/core layer for a Flutter booru browser app. publish_to: "none" -version: 2.3.4+44 +version: 2.3.5+45 environment: sdk: ">=3.3.0 <4.0.0"