mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-06-15 20:09:19 +00:00
Add Preferences for root installation
Added Some more strings
This commit is contained in:
@ -17,7 +17,7 @@ object Preferences {
|
||||
|
||||
private val keys = sequenceOf(
|
||||
Key.AutoSync, Key.IncompatibleVersions, Key.ProxyHost, Key.ProxyPort, Key.ProxyType,
|
||||
Key.SortOrder, Key.Theme, Key.UpdateNotify, Key.UpdateUnstable
|
||||
Key.RootPermission, Key.SortOrder, Key.Theme, Key.UpdateNotify, Key.UpdateUnstable
|
||||
).map { Pair(it.name, it) }.toMap()
|
||||
|
||||
fun init(context: Context) {
|
||||
@ -124,6 +124,8 @@ object Preferences {
|
||||
Value.EnumerationValue(Preferences.ProxyType.Direct)
|
||||
)
|
||||
|
||||
object RootPermission : Key<Boolean>("root_permission", Value.BooleanValue(false))
|
||||
|
||||
object SortOrder : Key<Preferences.SortOrder>(
|
||||
"sort_order",
|
||||
Value.EnumerationValue(Preferences.SortOrder.Update)
|
||||
|
@ -83,6 +83,10 @@ class SettingsFragment : ScreenFragment() {
|
||||
Preferences.Key.UpdateUnstable, getString(R.string.unstable_updates),
|
||||
getString(R.string.unstable_updates_summary)
|
||||
)
|
||||
addSwitch(
|
||||
Preferences.Key.IncompatibleVersions, getString(R.string.incompatible_versions),
|
||||
getString(R.string.incompatible_versions_summary)
|
||||
)
|
||||
}
|
||||
preferences.addCategory(getString(R.string.proxy)) {
|
||||
addEnumeration(Preferences.Key.ProxyType, getString(R.string.proxy_type)) {
|
||||
@ -95,7 +99,7 @@ class SettingsFragment : ScreenFragment() {
|
||||
addEditString(Preferences.Key.ProxyHost, getString(R.string.proxy_host))
|
||||
addEditInt(Preferences.Key.ProxyPort, getString(R.string.proxy_port), 1..65535)
|
||||
}
|
||||
preferences.addCategory(getString(R.string.other)) {
|
||||
preferences.addCategory(getString(R.string.themes)) {
|
||||
addEnumeration(Preferences.Key.Theme, getString(R.string.theme)) {
|
||||
when (it) {
|
||||
is Preferences.Theme.System -> getString(R.string.system)
|
||||
@ -104,13 +108,14 @@ class SettingsFragment : ScreenFragment() {
|
||||
is Preferences.Theme.Amoled -> getString(R.string.amoled)
|
||||
}
|
||||
}
|
||||
}
|
||||
preferences.addCategory(getString(R.string.install_types)) {
|
||||
addSwitch(
|
||||
Preferences.Key.IncompatibleVersions, getString(R.string.incompatible_versions),
|
||||
getString(R.string.incompatible_versions_summary)
|
||||
Preferences.Key.RootPermission, getString(R.string.root_permission),
|
||||
getString(R.string.root_permission_description)
|
||||
)
|
||||
}
|
||||
|
||||
preferences.addCategory("Credits") {
|
||||
preferences.addCategory(getString(R.string.credits)) {
|
||||
addText(
|
||||
title = "Based on an App by kitsunyan",
|
||||
summary = "FoxyDroid"
|
||||
|
Reference in New Issue
Block a user