Skip to content

Commit

Permalink
GitLab Source: Add setting
Browse files Browse the repository at this point in the history
  • Loading branch information
rumboalla committed Oct 24, 2023
1 parent dbae636 commit 1735c1f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/src/main/kotlin/com/apkupdater/prefs/Prefs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
<string name="source_izzy" translatable="false">F-Droid Izzy</string>
<string name="source_aptoide" translatable="false">Aptoide</string>
<string name="source_github" translatable="false">GitHub</string>
<string name="source_apkpure" translatable="false">APKPure (Beta)</string>
<string name="source_gitlab" translatable="false">GitLab</string>
<string name="source_apkpure" translatable="false">APKPure</string>
<string name="about">About</string>
<string name="frequency">Frequency</string>
<string name="theme">Theme</string>
Expand Down

0 comments on commit 1735c1f

Please sign in to comment.