mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-04 17:17:48 +08:00
@@ -30,6 +30,7 @@ import 'package:PiliPlus/plugin/pl_player/models/bottom_progress_behavior.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/models/fullscreen_mode.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/models/hwdec_type.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/models/play_repeat.dart';
|
||||
import 'package:PiliPlus/utils/device_utils.dart';
|
||||
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
||||
import 'package:PiliPlus/utils/global_data.dart';
|
||||
import 'package:PiliPlus/utils/login_utils.dart';
|
||||
@@ -192,7 +193,9 @@ abstract final class Pref {
|
||||
static FullScreenMode get fullScreenMode {
|
||||
int? index = _setting.get(SettingBoxKey.fullScreenMode);
|
||||
if (index == null) {
|
||||
final FullScreenMode mode = horizontalScreen && isTablet ? .none : .auto;
|
||||
final FullScreenMode mode = horizontalScreen && DeviceUtils.isTablet
|
||||
? .none
|
||||
: .auto;
|
||||
_setting.put(SettingBoxKey.fullScreenMode, mode.index);
|
||||
return mode;
|
||||
}
|
||||
@@ -594,15 +597,14 @@ abstract final class Pref {
|
||||
static bool get optTabletNav =>
|
||||
_setting.get(SettingBoxKey.optTabletNav, defaultValue: true);
|
||||
|
||||
static bool get horizontalScreen =>
|
||||
_setting.get(SettingBoxKey.horizontalScreen) ?? isTablet;
|
||||
|
||||
static bool get isTablet {
|
||||
final view = WidgetsBinding.instance.platformDispatcher.views.first;
|
||||
final size = view.physicalSize / view.devicePixelRatio;
|
||||
final isTablet = size.shortestSide >= 600;
|
||||
_setting.put(SettingBoxKey.horizontalScreen, isTablet);
|
||||
return isTablet;
|
||||
static bool get horizontalScreen {
|
||||
bool? horizontalScreen = _setting.get(SettingBoxKey.horizontalScreen);
|
||||
if (horizontalScreen == null) {
|
||||
final isTablet = DeviceUtils.isTablet;
|
||||
_setting.put(SettingBoxKey.horizontalScreen, isTablet);
|
||||
return isTablet;
|
||||
}
|
||||
return horizontalScreen;
|
||||
}
|
||||
|
||||
static String get banWordForDyn =>
|
||||
|
||||
Reference in New Issue
Block a user