Skip to content

armgit / ente

Public Imported from GitHub
0

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

[lock_screen] Make hide content setting independent of app lock

Prateek Sunal6e41d4e50a61
diff --git a/mobile/packages/lock_screen/lib/ui/lock_screen_options.dart b/mobile/packages/lock_screen/lib/ui/lock_screen_options.dart
index 176172af95..d45984e7b6 100644
--- a/mobile/packages/lock_screen/lib/ui/lock_screen_options.dart
+++ b/mobile/packages/lock_screen/lib/ui/lock_screen_options.dart
@@ -131,12 +131,6 @@ class _LockScreenOptionsState extends State<LockScreenOptions> {
await _lockScreenSettings.setAppLockEnabled(false);
}
await _lockScreenSettings.removePinAndPassword();
- if (PlatformUtil.isMobile()) {
- await _lockScreenSettings.setHideAppContent(!appLock);
- setState(() {
- hideAppContent = _lockScreenSettings.getShouldHideAppContent();
- });
- }
await _initializeSettings();
setState(() {
appLock = !appLock;
@@ -336,52 +330,46 @@ class _LockScreenOptionsState extends State<LockScreenOptions> {
),
)
: const SizedBox.shrink(),
- PlatformUtil.isMobile()
- ? Column(
- crossAxisAlignment:
- CrossAxisAlignment.start,
- children: [
- const SizedBox(height: 24),
- MenuItemWidget(
- captionedTextWidget:
- CaptionedTextWidget(
- title: context
- .strings.hideContent,
- ),
- alignCaptionedTextToLeft: true,
- singleBorderRadius: 8,
- menuItemColor:
- colorTheme.fillFaint,
- trailingWidget:
- ToggleSwitchWidget(
- value: () => hideAppContent,
- onChanged: () =>
- _onHideContent(),
- ),
- ),
- Padding(
- padding: const EdgeInsets.only(
- top: 14,
- left: 14,
- right: 12,
- ),
- child: Text(
- Platform.isAndroid
- ? context.strings
- .hideContentDescriptionAndroid
- : context.strings
- .hideContentDescriptioniOS,
- style: textTheme.miniFaint,
- textAlign: TextAlign.left,
- ),
- ),
- ],
- )
- : const SizedBox.shrink(),
],
)
: const SizedBox.shrink(),
),
+ PlatformUtil.isMobile()
+ ? Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ SizedBox(height: appLock ? 24 : 8),
+ MenuItemWidget(
+ captionedTextWidget: CaptionedTextWidget(
+ title: context.strings.hideContent,
+ ),
+ alignCaptionedTextToLeft: true,
+ singleBorderRadius: 8,
+ menuItemColor: colorTheme.fillFaint,
+ trailingWidget: ToggleSwitchWidget(
+ value: () => hideAppContent,
+ onChanged: () => _onHideContent(),
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.only(
+ top: 14,
+ left: 14,
+ right: 12,
+ ),
+ child: Text(
+ Platform.isAndroid
+ ? context.strings
+ .hideContentDescriptionAndroid
+ : context.strings
+ .hideContentDescriptioniOS,
+ style: textTheme.miniFaint,
+ textAlign: TextAlign.left,
+ ),
+ ),
+ ],
+ )
+ : const SizedBox.shrink(),
],
),
),