diff --git a/src/main/kotlin/com/looker/droidify/content/Preferences.kt b/src/main/kotlin/com/looker/droidify/content/Preferences.kt index 5ed18456..f9ad26b2 100644 --- a/src/main/kotlin/com/looker/droidify/content/Preferences.kt +++ b/src/main/kotlin/com/looker/droidify/content/Preferences.kt @@ -27,6 +27,7 @@ object Preferences { Key.InstallAfterSync, Key.IncompatibleVersions, Key.ListAnimation, + Key.ShowScreenshots, Key.UpdatedApps, Key.NewApps, Key.ProxyHost, @@ -148,6 +149,9 @@ object Preferences { object ListAnimation : Key("list_animation", Value.BooleanValue(false)) + object ShowScreenshots : + Key("show_screenshots", Value.BooleanValue(true)) + object UpdatedApps : Key("updated_apps", Value.IntValue(100)) object NewApps : Key("new_apps", Value.IntValue(20)) @@ -159,7 +163,8 @@ object Preferences { ) object RootPermission : Key("root_permission", Value.BooleanValue(false)) - object RootSessionInstaller : Key("root_session_installer", Value.BooleanValue(false)) + object RootSessionInstaller : + Key("root_session_installer", Value.BooleanValue(false)) object SortOrder : Key( "sort_order", diff --git a/src/main/kotlin/com/looker/droidify/ui/fragments/AppSheetX.kt b/src/main/kotlin/com/looker/droidify/ui/fragments/AppSheetX.kt index 2756bc40..4884390d 100644 --- a/src/main/kotlin/com/looker/droidify/ui/fragments/AppSheetX.kt +++ b/src/main/kotlin/com/looker/droidify/ui/fragments/AppSheetX.kt @@ -538,15 +538,17 @@ class AppSheetX() : FullscreenBottomSheetDialogFragment(), Callbacks { }) } } - item { - ScreenshotList(screenShots = suggestedProductRepo.first.screenshots.map { - ScreenshotItem( - screenShot = it, - repository = repo, - packageName = product.packageName - ) - }) { - onScreenshotClick(it) + if (Preferences[Preferences.Key.ShowScreenshots]) { + item { + ScreenshotList(screenShots = suggestedProductRepo.first.screenshots.map { + ScreenshotItem( + screenShot = it, + repository = repo, + packageName = product.packageName + ) + }) { + onScreenshotClick(it) + } } } item { diff --git a/src/main/kotlin/com/looker/droidify/ui/fragments/PrefsUserFragment.kt b/src/main/kotlin/com/looker/droidify/ui/fragments/PrefsUserFragment.kt index 5e7fe1b5..8eab75f9 100644 --- a/src/main/kotlin/com/looker/droidify/ui/fragments/PrefsUserFragment.kt +++ b/src/main/kotlin/com/looker/droidify/ui/fragments/PrefsUserFragment.kt @@ -48,6 +48,10 @@ class PrefsUserFragment : PrefsNavFragmentX() { Preferences.Key.ListAnimation, getString(R.string.list_animation), getString(R.string.list_animation_description) ) + addSwitch( + Preferences.Key.ShowScreenshots, getString(R.string.show_screenshots), + getString(R.string.show_screenshots_description) + ) addEditInt(Preferences.Key.UpdatedApps, getString(R.string.prefs_updated_apps), 1..200) addEditInt(Preferences.Key.NewApps, getString(R.string.prefs_new_apps), 1..50) } diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 438388cf..b15db881 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -198,4 +198,6 @@ Turn offUse root session installer The session installer is a bit less performant that the legacy one, but avoids issues with installed apps in Android +13. No Action Possible + Show screenshots + Whether to show screenshots in the app sheet or not.