From 09421230f2b6fce087b7dfa821b016e07adbf0c6 Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Sat, 9 Sep 2023 07:29:35 -0400 Subject: [PATCH] Make less obvious target highlighting optional --- assets/translations/br.json | 1 + assets/translations/bs.json | 1 + assets/translations/de.json | 1 + assets/translations/en.json | 1 + assets/translations/es.json | 1 + assets/translations/fa.json | 1 + assets/translations/fr.json | 1 + assets/translations/hu.json | 1 + assets/translations/it.json | 1 + assets/translations/ja.json | 1 + assets/translations/pl.json | 1 + assets/translations/ru.json | 1 + assets/translations/zh.json | 1 + lib/pages/apps.dart | 6 +++++- lib/pages/settings.dart | 15 +++++++++++++++ lib/providers/settings_provider.dart | 9 +++++++++ 16 files changed, 42 insertions(+), 1 deletion(-) diff --git a/assets/translations/br.json b/assets/translations/br.json index 9073850..6a70a80 100644 --- a/assets/translations/br.json +++ b/assets/translations/br.json @@ -253,6 +253,7 @@ "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", "versionExtractionRegEx": "Version Extraction RegEx", "matchGroupToUse": "Match Group to Use", + "highlightTouchTargets": "Highlight less obvious touch targets", "removeAppQuestion": { "one": "Remover App?", "other": "Remover Apps?" diff --git a/assets/translations/bs.json b/assets/translations/bs.json index 7b7d657..254f11c 100644 --- a/assets/translations/bs.json +++ b/assets/translations/bs.json @@ -250,6 +250,7 @@ "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", "versionExtractionRegEx": "Version Extraction RegEx", "matchGroupToUse": "Match Group to Use", + "highlightTouchTargets": "Highlight less obvious touch targets", "removeAppQuestion": { "one": "Želite li ukloniti aplikaciju?", "other": "Želite li ukloniti aplikacije?" diff --git a/assets/translations/de.json b/assets/translations/de.json index 300844d..81c2ea7 100644 --- a/assets/translations/de.json +++ b/assets/translations/de.json @@ -250,6 +250,7 @@ "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", "versionExtractionRegEx": "Version Extraction RegEx", "matchGroupToUse": "Match Group to Use", + "highlightTouchTargets": "Highlight less obvious touch targets", "removeAppQuestion": { "one": "App entfernen?", "other": "Apps entfernen?" diff --git a/assets/translations/en.json b/assets/translations/en.json index abf4080..f286c68 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -253,6 +253,7 @@ "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", "versionExtractionRegEx": "Version Extraction RegEx", "matchGroupToUse": "Match Group to Use", + "highlightTouchTargets": "Highlight less obvious touch targets", "removeAppQuestion": { "one": "Remove App?", "other": "Remove Apps?" diff --git a/assets/translations/es.json b/assets/translations/es.json index 75ea294..8893461 100644 --- a/assets/translations/es.json +++ b/assets/translations/es.json @@ -250,6 +250,7 @@ "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", "versionExtractionRegEx": "Version Extraction RegEx", "matchGroupToUse": "Match Group to Use", + "highlightTouchTargets": "Highlight less obvious touch targets", "removeAppQuestion": { "one": "¿Eliminar Aplicación?", "other": "¿Eliminar Aplicaciones?" diff --git a/assets/translations/fa.json b/assets/translations/fa.json index 5afe7df..adf44c2 100644 --- a/assets/translations/fa.json +++ b/assets/translations/fa.json @@ -250,6 +250,7 @@ "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", "versionExtractionRegEx": "Version Extraction RegEx", "matchGroupToUse": "Match Group to Use", + "highlightTouchTargets": "Highlight less obvious touch targets", "removeAppQuestion": { "one": "برنامه حذف شود؟", "other": "برنامه ها حذف شوند؟" diff --git a/assets/translations/fr.json b/assets/translations/fr.json index fbd15c1..cfae07f 100644 --- a/assets/translations/fr.json +++ b/assets/translations/fr.json @@ -250,6 +250,7 @@ "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", "versionExtractionRegEx": "Version Extraction RegEx", "matchGroupToUse": "Match Group to Use", + "highlightTouchTargets": "Highlight less obvious touch targets", "removeAppQuestion": { "one": "Supprimer l'application ?", "other": "Supprimer les applications ?" diff --git a/assets/translations/hu.json b/assets/translations/hu.json index 0c5d98f..1913544 100644 --- a/assets/translations/hu.json +++ b/assets/translations/hu.json @@ -249,6 +249,7 @@ "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", "versionExtractionRegEx": "Version Extraction RegEx", "matchGroupToUse": "Match Group to Use", + "highlightTouchTargets": "Highlight less obvious touch targets", "removeAppQuestion": { "one": "Eltávolítja az alkalmazást?", "other": "Eltávolítja az alkalmazást?" diff --git a/assets/translations/it.json b/assets/translations/it.json index d63547d..b211e4e 100644 --- a/assets/translations/it.json +++ b/assets/translations/it.json @@ -250,6 +250,7 @@ "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", "versionExtractionRegEx": "Version Extraction RegEx", "matchGroupToUse": "Match Group to Use", + "highlightTouchTargets": "Highlight less obvious touch targets", "removeAppQuestion": { "one": "Rimuovere l'app?", "other": "Rimuovere le app?" diff --git a/assets/translations/ja.json b/assets/translations/ja.json index 81d0e18..1181f88 100644 --- a/assets/translations/ja.json +++ b/assets/translations/ja.json @@ -251,6 +251,7 @@ "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", "versionExtractionRegEx": "Version Extraction RegEx", "matchGroupToUse": "Match Group to Use", + "highlightTouchTargets": "Highlight less obvious touch targets", "removeAppQuestion": { "one": "アプリを削除しますか?", "other": "アプリを削除しますか?" diff --git a/assets/translations/pl.json b/assets/translations/pl.json index bda97f1..1b43982 100644 --- a/assets/translations/pl.json +++ b/assets/translations/pl.json @@ -256,6 +256,7 @@ "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", "versionExtractionRegEx": "Version Extraction RegEx", "matchGroupToUse": "Match Group to Use", + "highlightTouchTargets": "Highlight less obvious touch targets", "removeAppQuestion": { "one": "Usunąć aplikację?", "few": "Usunąć aplikacje?", diff --git a/assets/translations/ru.json b/assets/translations/ru.json index 98c167e..49bc22d 100644 --- a/assets/translations/ru.json +++ b/assets/translations/ru.json @@ -250,6 +250,7 @@ "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", "versionExtractionRegEx": "Version Extraction RegEx", "matchGroupToUse": "Match Group to Use", + "highlightTouchTargets": "Highlight less obvious touch targets", "removeAppQuestion": { "one": "Удалить приложение?", "other": "Удалить приложения?" diff --git a/assets/translations/zh.json b/assets/translations/zh.json index a3024e5..ac43598 100644 --- a/assets/translations/zh.json +++ b/assets/translations/zh.json @@ -251,6 +251,7 @@ "autoSelectHighestVersionCode": "Auto-select highest versionCode APK", "versionExtractionRegEx": "Version Extraction RegEx", "matchGroupToUse": "Match Group to Use", + "highlightTouchTargets": "Highlight less obvious touch targets", "removeAppQuestion": { "one": "是否删除应用?", "other": "是否删除应用?" diff --git a/lib/pages/apps.dart b/lib/pages/apps.dart index ebbc272..4228be8 100644 --- a/lib/pages/apps.dart +++ b/lib/pages/apps.dart @@ -452,7 +452,11 @@ class AppsPageState extends State { child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), - color: Theme.of(context).primaryColor.withAlpha(20)), + color: Theme.of(context).primaryColor.withAlpha( + (settingsProvider.highlightTouchTargets && + showChangesFn != null) + ? 20 + : 0)), padding: const EdgeInsets.fromLTRB(12, 0, 12, 0), child: Column( mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/pages/settings.dart b/lib/pages/settings.dart index ec19efb..ec3d1d9 100644 --- a/lib/pages/settings.dart +++ b/lib/pages/settings.dart @@ -484,6 +484,21 @@ class _SettingsPageState extends State { }) ], ), + height16, + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Flexible( + child: Text(tr('highlightTouchTargets'))), + Switch( + value: + settingsProvider.highlightTouchTargets, + onChanged: (value) { + settingsProvider.highlightTouchTargets = + value; + }) + ], + ), height32, Text( tr('categories'), diff --git a/lib/providers/settings_provider.dart b/lib/providers/settings_provider.dart index 0ccae4a..a95e2b3 100644 --- a/lib/providers/settings_provider.dart +++ b/lib/providers/settings_provider.dart @@ -348,4 +348,13 @@ class SettingsProvider with ChangeNotifier { prefs?.setBool('showDebugOpts', val); notifyListeners(); } + + bool get highlightTouchTargets { + return prefs?.getBool('highlightTouchTargets') ?? false; + } + + set highlightTouchTargets(bool val) { + prefs?.setBool('highlightTouchTargets', val); + notifyListeners(); + } }