mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 03:06:59 +08:00
refactor device orientation
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -78,12 +78,12 @@ abstract final class ImageUtils {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<bool> checkPermissionDependOnSdkInt() async {
|
||||
static Future<bool> checkPermissionDependOnSdkInt() {
|
||||
if (Platform.isAndroid) {
|
||||
if (await Utils.sdkInt < 29) {
|
||||
if (Utils.sdkInt < 29) {
|
||||
return requestPer();
|
||||
} else {
|
||||
return true;
|
||||
return Future.syncValue(true);
|
||||
}
|
||||
}
|
||||
return requestPer();
|
||||
|
||||
@@ -32,7 +32,6 @@ abstract final class SettingBoxKey {
|
||||
static const String enableVerticalExpand = 'enableVerticalExpand',
|
||||
feedBackEnable = 'feedBackEnable',
|
||||
enableLongShowControl = 'enableLongShowControl',
|
||||
allowRotateScreen = 'allowRotateScreen',
|
||||
horizontalScreen = 'horizontalScreen',
|
||||
CDNService = 'CDNService',
|
||||
disableAudioCDN = 'disableAudioCDN',
|
||||
|
||||
@@ -193,7 +193,9 @@ abstract final class Pref {
|
||||
static FullScreenMode get fullScreenMode =>
|
||||
FullScreenMode.values[_setting.get(
|
||||
SettingBoxKey.fullScreenMode,
|
||||
defaultValue: FullScreenMode.auto.index,
|
||||
defaultValue: horizontalScreen
|
||||
? FullScreenMode.none.index
|
||||
: FullScreenMode.auto.index,
|
||||
)];
|
||||
|
||||
static BtmProgressBehavior get btmProgressBehavior =>
|
||||
@@ -636,9 +638,6 @@ abstract final class Pref {
|
||||
static bool get enableBackgroundPlay =>
|
||||
_setting.get(SettingBoxKey.enableBackgroundPlay, defaultValue: true);
|
||||
|
||||
static bool get allowRotateScreen =>
|
||||
_setting.get(SettingBoxKey.allowRotateScreen, defaultValue: true);
|
||||
|
||||
static bool get disableLikeMsg =>
|
||||
_setting.get(SettingBoxKey.disableLikeMsg, defaultValue: false);
|
||||
|
||||
|
||||
@@ -87,10 +87,7 @@ abstract final class Utils {
|
||||
int.parse('${color.substring(7)}${color.substring(1, 7)}', radix: 16),
|
||||
);
|
||||
|
||||
static int? _sdkInt;
|
||||
static Future<int> get sdkInt async {
|
||||
return _sdkInt ??= (await DeviceInfoPlugin().androidInfo).version.sdkInt;
|
||||
}
|
||||
static late int sdkInt;
|
||||
|
||||
static bool? _isIpad;
|
||||
static Future<bool> get isIpad async {
|
||||
|
||||
Reference in New Issue
Block a user