mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-05-03 23:34:25 +02:00
feat(settings): move experimental patches option to advanced
This commit is contained in:
parent
39caad18a5
commit
d8392ad3eb
@ -32,9 +32,11 @@ import androidx.compose.ui.res.stringResource
|
|||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.core.content.getSystemService
|
import androidx.core.content.getSystemService
|
||||||
|
import androidx.lifecycle.viewModelScope
|
||||||
import app.revanced.manager.R
|
import app.revanced.manager.R
|
||||||
import app.revanced.manager.ui.component.AppTopBar
|
import app.revanced.manager.ui.component.AppTopBar
|
||||||
import app.revanced.manager.ui.component.GroupHeader
|
import app.revanced.manager.ui.component.GroupHeader
|
||||||
|
import app.revanced.manager.ui.component.settings.BooleanItem
|
||||||
import app.revanced.manager.ui.viewmodel.AdvancedSettingsViewModel
|
import app.revanced.manager.ui.viewmodel.AdvancedSettingsViewModel
|
||||||
import org.koin.androidx.compose.getViewModel
|
import org.koin.androidx.compose.getViewModel
|
||||||
|
|
||||||
@ -85,6 +87,14 @@ fun AdvancedSettingsScreen(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
GroupHeader(stringResource(R.string.patcher))
|
||||||
|
BooleanItem(
|
||||||
|
preference = vm.allowExperimental,
|
||||||
|
coroutineScope = vm.viewModelScope,
|
||||||
|
headline = R.string.experimental_patches,
|
||||||
|
description = R.string.experimental_patches_description
|
||||||
|
)
|
||||||
|
|
||||||
GroupHeader(stringResource(R.string.patch_bundles_section))
|
GroupHeader(stringResource(R.string.patch_bundles_section))
|
||||||
ListItem(
|
ListItem(
|
||||||
headlineContent = { Text(stringResource(R.string.patch_bundles_redownload)) },
|
headlineContent = { Text(stringResource(R.string.patch_bundles_redownload)) },
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package app.revanced.manager.ui.screen.settings
|
package app.revanced.manager.ui.screen.settings
|
||||||
|
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import androidx.annotation.StringRes
|
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.foundation.rememberScrollState
|
import androidx.compose.foundation.rememberScrollState
|
||||||
@ -23,7 +22,6 @@ import app.revanced.manager.ui.component.GroupHeader
|
|||||||
import app.revanced.manager.ui.component.settings.BooleanItem
|
import app.revanced.manager.ui.component.settings.BooleanItem
|
||||||
import app.revanced.manager.ui.theme.Theme
|
import app.revanced.manager.ui.theme.Theme
|
||||||
import app.revanced.manager.ui.viewmodel.SettingsViewModel
|
import app.revanced.manager.ui.viewmodel.SettingsViewModel
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
import org.koin.compose.koinInject
|
import org.koin.compose.koinInject
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@ -82,14 +80,6 @@ fun GeneralSettingsScreen(
|
|||||||
description = R.string.dynamic_color_description
|
description = R.string.dynamic_color_description
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
GroupHeader(stringResource(R.string.patcher))
|
|
||||||
BooleanItem(
|
|
||||||
preference = prefs.allowExperimental,
|
|
||||||
coroutineScope = coroutineScope,
|
|
||||||
headline = R.string.experimental_patches,
|
|
||||||
description = R.string.experimental_patches_description
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,10 +113,12 @@ private fun ThemePicker(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
confirmButton = {
|
confirmButton = {
|
||||||
Button(onClick = {
|
Button(
|
||||||
|
onClick = {
|
||||||
onConfirm(selectedTheme)
|
onConfirm(selectedTheme)
|
||||||
onDismiss()
|
onDismiss()
|
||||||
}) {
|
}
|
||||||
|
) {
|
||||||
Text(stringResource(R.string.apply))
|
Text(stringResource(R.string.apply))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ class AdvancedSettingsViewModel(
|
|||||||
private val patchBundleRepository: PatchBundleRepository
|
private val patchBundleRepository: PatchBundleRepository
|
||||||
) : ViewModel() {
|
) : ViewModel() {
|
||||||
val apiUrl = prefs.api
|
val apiUrl = prefs.api
|
||||||
|
val allowExperimental = prefs.allowExperimental
|
||||||
|
|
||||||
fun setApiUrl(value: String) = viewModelScope.launch(Dispatchers.Default) {
|
fun setApiUrl(value: String) = viewModelScope.launch(Dispatchers.Default) {
|
||||||
if (value == apiUrl.get()) return@launch
|
if (value == apiUrl.get()) return@launch
|
||||||
|
Loading…
x
Reference in New Issue
Block a user