[mob][photos] Auto lock time changed
This commit is contained in:
@@ -68,7 +68,6 @@ const kFGHomeWidgetSyncFrequency = Duration(minutes: 15);
|
||||
const kBGTaskTimeout = Duration(seconds: 25);
|
||||
const kBGPushTimeout = Duration(seconds: 28);
|
||||
const kFGTaskDeathTimeoutInMicroseconds = 5000000;
|
||||
const kBackgroundLockLatency = Duration(seconds: 3);
|
||||
|
||||
void main() async {
|
||||
debugRepaintRainbowEnabled = false;
|
||||
@@ -100,7 +99,6 @@ Future<void> _runInForeground(AdaptiveThemeMode? savedThemeMode) async {
|
||||
locale: locale,
|
||||
lightTheme: lightThemeData,
|
||||
darkTheme: darkThemeData,
|
||||
backgroundLockLatency: kBackgroundLockLatency,
|
||||
savedThemeMode: _themeMode(savedThemeMode),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -136,7 +136,7 @@ class _AutoLockItemsState extends State<AutoLockItems> {
|
||||
} else if (duration.inSeconds != 0) {
|
||||
return "${duration.inSeconds}s";
|
||||
} else {
|
||||
return "Disabled";
|
||||
return "Immediately";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,17 +118,7 @@ class _LockScreenOptionsState extends State<LockScreenOptions> {
|
||||
} else if (duration.inSeconds != 0) {
|
||||
return "in ${duration.inSeconds} second${duration.inSeconds > 1 ? 's' : ''}";
|
||||
} else {
|
||||
return "Disabled";
|
||||
}
|
||||
}
|
||||
|
||||
String _getAppLockType() {
|
||||
if (isPinEnabled) {
|
||||
return "Pin";
|
||||
} else if (isPasswordEnabled) {
|
||||
return "Password";
|
||||
} else {
|
||||
return "Device lock";
|
||||
return "Immediately";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,7 +259,7 @@ class _LockScreenOptionsState extends State<LockScreenOptions> {
|
||||
right: 12,
|
||||
),
|
||||
child: Text(
|
||||
"Require ${_getAppLockType()} if away for some time .",
|
||||
"Time after which the app will be locked after closing",
|
||||
style: textTheme.miniFaint,
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
|
||||
@@ -22,7 +22,7 @@ import "package:photos/utils/lock_screen_settings.dart";
|
||||
/// `AppLock.of(context).disable();` or the convenience method `AppLock.of(context).setEnabled(enabled);`
|
||||
/// using a bool argument.
|
||||
///
|
||||
/// [backgroundLockLatency] determines how much time is allowed to pass when
|
||||
/// [_backgroundLockLatencyTimer] determines how much time is allowed to pass when
|
||||
/// the app is in the background state before the [lockScreen] widget should be
|
||||
/// shown upon returning. It defaults to instantly.
|
||||
///
|
||||
@@ -32,7 +32,6 @@ class AppLock extends StatefulWidget {
|
||||
final Widget Function(Object?) builder;
|
||||
final Widget lockScreen;
|
||||
final bool enabled;
|
||||
final Duration backgroundLockLatency;
|
||||
final ThemeData? darkTheme;
|
||||
final ThemeData? lightTheme;
|
||||
final ThemeMode savedThemeMode;
|
||||
@@ -45,7 +44,6 @@ class AppLock extends StatefulWidget {
|
||||
required this.savedThemeMode,
|
||||
this.enabled = true,
|
||||
this.locale = const Locale("en", "US"),
|
||||
this.backgroundLockLatency = const Duration(seconds: 0),
|
||||
this.darkTheme,
|
||||
this.lightTheme,
|
||||
}) : super(key: key);
|
||||
|
||||
@@ -22,12 +22,11 @@ class LockScreenSettings {
|
||||
late SharedPreferences _preferences;
|
||||
static const List<Duration> autoLockDurations = [
|
||||
Duration(seconds: 0),
|
||||
Duration(seconds: 30),
|
||||
Duration(seconds: 5),
|
||||
Duration(seconds: 15),
|
||||
Duration(minutes: 1),
|
||||
Duration(minutes: 5),
|
||||
Duration(minutes: 15),
|
||||
Duration(minutes: 30),
|
||||
Duration(hours: 1),
|
||||
];
|
||||
void init(SharedPreferences prefs) async {
|
||||
_secureStorage = const FlutterSecureStorage();
|
||||
|
||||
Reference in New Issue
Block a user