From 1735c1fa31187cf707da438b2a5f6222f852deaa Mon Sep 17 00:00:00 2001 From: rumboalla Date: Tue, 24 Oct 2023 18:02:00 +0200 Subject: [PATCH] GitLab Source: Add setting --- app/src/main/kotlin/com/apkupdater/prefs/Prefs.kt | 1 + .../main/kotlin/com/apkupdater/ui/screen/SettingsScreen.kt | 6 ++++++ .../kotlin/com/apkupdater/viewmodel/SettingsViewModel.kt | 2 ++ app/src/main/res/values/strings.xml | 3 ++- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/apkupdater/prefs/Prefs.kt b/app/src/main/kotlin/com/apkupdater/prefs/Prefs.kt index 14e6afbd..7f9f5495 100644 --- a/app/src/main/kotlin/com/apkupdater/prefs/Prefs.kt +++ b/app/src/main/kotlin/com/apkupdater/prefs/Prefs.kt @@ -23,6 +23,7 @@ class Prefs( val useSafeStores = boolean("useSafeStores", defValue = true, backed = true) val useApkMirror = boolean("useApkMirror", defValue = !isAndroidTv, backed = true) val useGitHub = boolean("useGitHub", defValue = true, backed = true) + val useGitLab = boolean("useGitLab", defValue = true, backed = true) val useFdroid = boolean("useFdroid", defValue = true, backed = true) val useIzzy = boolean("useIzzy", defValue = true, backed = true) val useAptoide = boolean("useAptoide", defValue = true, backed = true) diff --git a/app/src/main/kotlin/com/apkupdater/ui/screen/SettingsScreen.kt b/app/src/main/kotlin/com/apkupdater/ui/screen/SettingsScreen.kt index 2095449b..abf88351 100644 --- a/app/src/main/kotlin/com/apkupdater/ui/screen/SettingsScreen.kt +++ b/app/src/main/kotlin/com/apkupdater/ui/screen/SettingsScreen.kt @@ -199,6 +199,12 @@ fun Settings(viewModel: SettingsViewModel) = LazyColumn { stringResource(R.string.source_github), R.drawable.ic_github ) + SwitchSetting( + { viewModel.getUseGitLab() }, + { viewModel.setUseGitLab(it) }, + stringResource(R.string.source_gitlab), + R.drawable.ic_gitlab + ) SwitchSetting( { viewModel.getUseApkMirror() }, { viewModel.setUseApkMirror(it) }, diff --git a/app/src/main/kotlin/com/apkupdater/viewmodel/SettingsViewModel.kt b/app/src/main/kotlin/com/apkupdater/viewmodel/SettingsViewModel.kt index b2739a24..c8fc6e57 100644 --- a/app/src/main/kotlin/com/apkupdater/viewmodel/SettingsViewModel.kt +++ b/app/src/main/kotlin/com/apkupdater/viewmodel/SettingsViewModel.kt @@ -52,6 +52,8 @@ class SettingsViewModel( fun setUseIzzy(b: Boolean) = prefs.useIzzy.put(b) fun getUseGitHub() = prefs.useGitHub.get() fun setUseGitHub(b: Boolean) = prefs.useGitHub.put(b) + fun getUseGitLab() = prefs.useGitLab.get() + fun setUseGitLab(b: Boolean) = prefs.useGitLab.put(b) fun getUseAptoide() = prefs.useAptoide.get() fun setUseAptoide(b: Boolean) = prefs.useAptoide.put(b) fun getUseApkPure() = prefs.useApkPure.get() diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c1e94682..d2004ef7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -44,7 +44,8 @@ F-Droid Izzy Aptoide GitHub - APKPure (Beta) + GitLab + APKPure About Frequency Theme