mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-02 09:08:17 +08:00
@@ -568,7 +568,6 @@ class PlPlayerController with BlockConfigMixin {
|
||||
if (PlatformUtils.isMobile) {
|
||||
_orientationListener = NativeDeviceOrientationPlatform.instance
|
||||
.onOrientationChanged(
|
||||
useSensor: Platform.isAndroid,
|
||||
checkIsAutoRotate: checkIsAutoRotate,
|
||||
angleDegrees: Platform.isAndroid ? Pref.angleDegrees : null,
|
||||
)
|
||||
|
||||
@@ -3,7 +3,12 @@ import 'dart:io' show Platform;
|
||||
|
||||
import 'package:PiliPlus/utils/device_utils.dart';
|
||||
import 'package:flutter/services.dart'
|
||||
show SystemChrome, MethodChannel, SystemUiOverlay, DeviceOrientation;
|
||||
show
|
||||
SystemChrome,
|
||||
MethodChannel,
|
||||
SystemUiOverlay,
|
||||
DeviceOrientation,
|
||||
SystemUiMode;
|
||||
|
||||
bool _isDesktopFullScreen = false;
|
||||
|
||||
@@ -69,7 +74,7 @@ Future<void>? hideSystemBar() {
|
||||
return null;
|
||||
}
|
||||
_showSystemBar = false;
|
||||
return SystemChrome.setEnabledSystemUIMode(.immersiveSticky);
|
||||
return setEnabledSystemUIMode(.immersiveSticky);
|
||||
}
|
||||
|
||||
//退出全屏显示
|
||||
@@ -78,8 +83,32 @@ Future<void>? showSystemBar() {
|
||||
return null;
|
||||
}
|
||||
_showSystemBar = true;
|
||||
return SystemChrome.setEnabledSystemUIMode(
|
||||
return setEnabledSystemUIMode(
|
||||
Platform.isAndroid && DeviceUtils.sdkInt < 29 ? .manual : .edgeToEdge,
|
||||
overlays: SystemUiOverlay.values,
|
||||
);
|
||||
}
|
||||
|
||||
// TODO: remove
|
||||
// https://github.com/flutter/flutter/issues/186723
|
||||
Future<void> setEnabledSystemUIMode(
|
||||
SystemUiMode mode, {
|
||||
List<SystemUiOverlay>? overlays,
|
||||
}) async {
|
||||
if (mode != SystemUiMode.manual) {
|
||||
await const MethodChannel('PiliPlus').invokeMethod(
|
||||
'SystemChrome.setEnabledSystemUIMode',
|
||||
{'arguments': mode.toString()},
|
||||
);
|
||||
} else {
|
||||
assert(mode == SystemUiMode.manual && overlays != null);
|
||||
await const MethodChannel('PiliPlus').invokeMethod(
|
||||
'SystemChrome.setEnabledSystemUIOverlays',
|
||||
{'arguments': _stringify(overlays!)},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<String> _stringify(List<dynamic> list) => <String>[
|
||||
for (final dynamic item in list) item.toString(),
|
||||
];
|
||||
|
||||
@@ -407,10 +407,9 @@ class _VideoTime extends LeafRenderObjectWidget {
|
||||
|
||||
class _RenderVideoTime extends RenderBox {
|
||||
_RenderVideoTime({
|
||||
required String position,
|
||||
required String duration,
|
||||
}) : _position = position,
|
||||
_duration = duration;
|
||||
required this._position,
|
||||
required this._duration,
|
||||
});
|
||||
|
||||
String _duration;
|
||||
set duration(String value) {
|
||||
|
||||
Reference in New Issue
Block a user