Skip to content

armgit / ente

Public Imported from GitHub
0

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

Focused menu for loading separate models

laurenspriemdd0c5ed770d6
diff --git a/mobile/lib/ui/settings/ml/machine_learning_settings_page.dart b/mobile/lib/ui/settings/ml/machine_learning_settings_page.dart
index ad4f87821a..9a95d7dfcb 100644
--- a/mobile/lib/ui/settings/ml/machine_learning_settings_page.dart
+++ b/mobile/lib/ui/settings/ml/machine_learning_settings_page.dart
@@ -94,7 +94,9 @@ class _MachineLearningSettingsPageState
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
- return const MLUserDeveloperOptions();
+ return MLUserDeveloperOptions(
+ mlIsEnabled: hasEnabled,
+ );
},
),
).ignore();
diff --git a/mobile/lib/ui/settings/ml/ml_user_dev_screen.dart b/mobile/lib/ui/settings/ml/ml_user_dev_screen.dart
index 32fdaaaedc..07a46131e1 100644
--- a/mobile/lib/ui/settings/ml/ml_user_dev_screen.dart
+++ b/mobile/lib/ui/settings/ml/ml_user_dev_screen.dart
@@ -22,7 +22,8 @@ import "package:photos/utils/dialog_util.dart";
final Logger _logger = Logger("MLUserDeveloperOptions");
class MLUserDeveloperOptions extends StatefulWidget {
- const MLUserDeveloperOptions({super.key});
+ final bool mlIsEnabled;
+ const MLUserDeveloperOptions({super.key, this.mlIsEnabled = true});
@override
State<MLUserDeveloperOptions> createState() => _MLUserDeveloperOptionsState();
@@ -56,23 +57,23 @@ class _MLUserDeveloperOptionsState extends State<MLUserDeveloperOptions> {
),
),
const SizedBox(height: 48),
- ButtonWidget(
+ widget.mlIsEnabled ? ButtonWidget(
buttonType: ButtonType.neutral,
labelText: "Purge empty indices",
onTap: () async {
await deleteEmptyIndices(context);
},
- ),
- const SizedBox(height: 24),
- ButtonWidget(
+ ) : const SizedBox(),
+ widget.mlIsEnabled ? const SizedBox(height: 24) : const SizedBox(),
+ widget.mlIsEnabled ? ButtonWidget(
buttonType: ButtonType.neutral,
labelText: "Reset all local ML",
onTap: () async {
await deleteAllLocalML(context);
},
- ),
- const SizedBox(height: 24),
- MenuItemWidget(
+ ) : const SizedBox(),
+ widget.mlIsEnabled ? const SizedBox(height: 24) : const SizedBox(),
+ widget.mlIsEnabled ? MenuItemWidget(
captionedTextWidget: const CaptionedTextWidget(
title: "Remote fetch",
),
@@ -105,8 +106,8 @@ class _MLUserDeveloperOptionsState extends State<MLUserDeveloperOptions> {
alignCaptionedTextToLeft: true,
isBottomBorderRadiusRemoved: true,
isGestureDetectorDisabled: true,
- ),
- const SizedBox(height: 24),
+ ) : const SizedBox(),
+ widget.mlIsEnabled ? const SizedBox(height: 24) : const SizedBox.shrink(),
ButtonWidget(
buttonType: ButtonType.neutral,
labelText: "Load face detection model",