Add: Option to not show screenshots

This commit is contained in:
machiav3lli 2022-06-06 02:11:26 +02:00
parent 2275b978b8
commit 487a0a206f
4 changed files with 23 additions and 10 deletions

View File

@ -27,6 +27,7 @@ object Preferences {
Key.InstallAfterSync, Key.InstallAfterSync,
Key.IncompatibleVersions, Key.IncompatibleVersions,
Key.ListAnimation, Key.ListAnimation,
Key.ShowScreenshots,
Key.UpdatedApps, Key.UpdatedApps,
Key.NewApps, Key.NewApps,
Key.ProxyHost, Key.ProxyHost,
@ -148,6 +149,9 @@ object Preferences {
object ListAnimation : object ListAnimation :
Key<Boolean>("list_animation", Value.BooleanValue(false)) Key<Boolean>("list_animation", Value.BooleanValue(false))
object ShowScreenshots :
Key<Boolean>("show_screenshots", Value.BooleanValue(true))
object UpdatedApps : Key<Int>("updated_apps", Value.IntValue(100)) object UpdatedApps : Key<Int>("updated_apps", Value.IntValue(100))
object NewApps : Key<Int>("new_apps", Value.IntValue(20)) object NewApps : Key<Int>("new_apps", Value.IntValue(20))
@ -159,7 +163,8 @@ object Preferences {
) )
object RootPermission : Key<Boolean>("root_permission", Value.BooleanValue(false)) object RootPermission : Key<Boolean>("root_permission", Value.BooleanValue(false))
object RootSessionInstaller : Key<Boolean>("root_session_installer", Value.BooleanValue(false)) object RootSessionInstaller :
Key<Boolean>("root_session_installer", Value.BooleanValue(false))
object SortOrder : Key<Preferences.SortOrder>( object SortOrder : Key<Preferences.SortOrder>(
"sort_order", "sort_order",

View File

@ -538,15 +538,17 @@ class AppSheetX() : FullscreenBottomSheetDialogFragment(), Callbacks {
}) })
} }
} }
item { if (Preferences[Preferences.Key.ShowScreenshots]) {
ScreenshotList(screenShots = suggestedProductRepo.first.screenshots.map { item {
ScreenshotItem( ScreenshotList(screenShots = suggestedProductRepo.first.screenshots.map {
screenShot = it, ScreenshotItem(
repository = repo, screenShot = it,
packageName = product.packageName repository = repo,
) packageName = product.packageName
}) { )
onScreenshotClick(it) }) {
onScreenshotClick(it)
}
} }
} }
item { item {

View File

@ -48,6 +48,10 @@ class PrefsUserFragment : PrefsNavFragmentX() {
Preferences.Key.ListAnimation, getString(R.string.list_animation), Preferences.Key.ListAnimation, getString(R.string.list_animation),
getString(R.string.list_animation_description) 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.UpdatedApps, getString(R.string.prefs_updated_apps), 1..200)
addEditInt(Preferences.Key.NewApps, getString(R.string.prefs_new_apps), 1..50) addEditInt(Preferences.Key.NewApps, getString(R.string.prefs_new_apps), 1..50)
} }

View File

@ -198,4 +198,6 @@
<string name="dialog_approve">Turn off</string><string name="root_session_installer">Use root session installer</string> <string name="dialog_approve">Turn off</string><string name="root_session_installer">Use root session installer</string>
<string name="root_session_installer_description">The session installer is a bit less performant that the legacy one, but avoids issues with installed apps in Android +13.</string> <string name="root_session_installer_description">The session installer is a bit less performant that the legacy one, but avoids issues with installed apps in Android +13.</string>
<string name="no_action_possible">No Action Possible</string> <string name="no_action_possible">No Action Possible</string>
<string name="show_screenshots">Show screenshots</string>
<string name="show_screenshots_description">Whether to show screenshots in the app sheet or not.</string>
</resources> </resources>