Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][auth] Show app content option added

Aman Raj Singh Mouryae3e58eb9c2ec
diff --git a/auth/lib/ui/settings/lock_screen/lock_screen_auto_lock.dart b/auth/lib/ui/settings/lock_screen/lock_screen_auto_lock.dart
index c0c1941eb5..0f0bc8b708 100644
--- a/auth/lib/ui/settings/lock_screen/lock_screen_auto_lock.dart
+++ b/auth/lib/ui/settings/lock_screen/lock_screen_auto_lock.dart
@@ -69,7 +69,8 @@ class AutoLockItems extends StatefulWidget {
class _AutoLockItemsState extends State<AutoLockItems> {
final autoLockDurations = LockScreenSettings.instance.autoLockDurations;
List<Widget> items = [];
- late Duration currentAutoLockTime;
+ Duration currentAutoLockTime = const Duration(seconds: 5);
+
@override
void initState() {
for (Duration autoLockDuration in autoLockDurations) {
@@ -135,7 +136,7 @@ class _AutoLockItemsState extends State<AutoLockItems> {
} else if (duration.inSeconds != 0) {
return "${duration.inSeconds}s";
} else {
- return "Disabled";
+ return "Immediately";
}
}
}
diff --git a/auth/lib/ui/settings/lock_screen/lock_screen_options.dart b/auth/lib/ui/settings/lock_screen/lock_screen_options.dart
index ba33b5e5e1..3c24734d6b 100644
--- a/auth/lib/ui/settings/lock_screen/lock_screen_options.dart
+++ b/auth/lib/ui/settings/lock_screen/lock_screen_options.dart
@@ -32,6 +32,7 @@ class _LockScreenOptionsState extends State<LockScreenOptions> {
bool isPinEnabled = false;
bool isPasswordEnabled = false;
late int autoLockTimeInMilliseconds;
+
@override
void initState() {
super.initState();
@@ -149,7 +150,7 @@ class _LockScreenOptionsState extends State<LockScreenOptions> {
} else if (duration.inSeconds != 0) {
return "in ${duration.inSeconds} second${duration.inSeconds > 1 ? 's' : ''}";
} else {
- return "Disabled";
+ return "Immediately";
}
}
@@ -291,7 +292,44 @@ class _LockScreenOptionsState extends State<LockScreenOptions> {
right: 12,
),
child: Text(
- "Require ${_lockscreenSetting.getAppLockType()} if away for some time .",
+ "Time after which the app locks after being put in the background",
+ style: textTheme.miniFaint,
+ textAlign: TextAlign.left,
+ ),
+ ),
+ const SizedBox(height: 24),
+ MenuItemWidget(
+ captionedTextWidget: CaptionedTextWidget(
+ title: "App content in Task switcher",
+ textStyle: textTheme.small.copyWith(
+ color: colorTheme.textMuted,
+ ),
+ ),
+ isBottomBorderRadiusRemoved: true,
+ alignCaptionedTextToLeft: true,
+ menuItemColor: colorTheme.fillFaint,
+ ),
+ MenuItemWidget(
+ captionedTextWidget:
+ const CaptionedTextWidget(
+ title: "Show Content",
+ ),
+ alignCaptionedTextToLeft: true,
+ isTopBorderRadiusRemoved: true,
+ menuItemColor: colorTheme.fillFaint,
+ trailingWidget: ToggleSwitchWidget(
+ value: () => appLock,
+ onChanged: () => _onToggleSwitch(),
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.only(
+ top: 14,
+ left: 14,
+ right: 12,
+ ),
+ child: Text(
+ "If disabled app content will be displayed in the task switcher",
style: textTheme.miniFaint,
textAlign: TextAlign.left,
),
diff --git a/auth/lib/utils/lock_screen_settings.dart b/auth/lib/utils/lock_screen_settings.dart
index 01c42fd29f..c3fa3daa5e 100644
--- a/auth/lib/utils/lock_screen_settings.dart
+++ b/auth/lib/utils/lock_screen_settings.dart
@@ -20,16 +20,16 @@ class LockScreenSettings {
static const appLockType = "ls_app_lock_type";
final List<Duration> autoLockDurations = const [
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),
];
late SharedPreferences _preferences;
late FlutterSecureStorage _secureStorage;
+
Future<void> init() async {
_secureStorage = const FlutterSecureStorage();
_preferences = await SharedPreferences.getInstance();
@@ -61,7 +61,7 @@ class LockScreenSettings {
}
int getAutoLockTime() {
- return _preferences.getInt(autoLockTime) ?? 0;
+ return _preferences.getInt(autoLockTime) ?? 5000;
}
Future<void> setLastInvalidAttemptTime(int time) async {