diff --git a/app/src/main/java/app/revanced/manager/ui/screen/settings/AdvancedSettingsScreen.kt b/app/src/main/java/app/revanced/manager/ui/screen/settings/AdvancedSettingsScreen.kt index e390332a2c..4af8e908d3 100644 --- a/app/src/main/java/app/revanced/manager/ui/screen/settings/AdvancedSettingsScreen.kt +++ b/app/src/main/java/app/revanced/manager/ui/screen/settings/AdvancedSettingsScreen.kt @@ -32,9 +32,11 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import androidx.core.content.getSystemService +import androidx.lifecycle.viewModelScope import app.revanced.manager.R import app.revanced.manager.ui.component.AppTopBar import app.revanced.manager.ui.component.GroupHeader +import app.revanced.manager.ui.component.settings.BooleanItem import app.revanced.manager.ui.viewmodel.AdvancedSettingsViewModel 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)) ListItem( headlineContent = { Text(stringResource(R.string.patch_bundles_redownload)) }, diff --git a/app/src/main/java/app/revanced/manager/ui/screen/settings/GeneralSettingsScreen.kt b/app/src/main/java/app/revanced/manager/ui/screen/settings/GeneralSettingsScreen.kt index 6838f927a1..ed25e7b231 100644 --- a/app/src/main/java/app/revanced/manager/ui/screen/settings/GeneralSettingsScreen.kt +++ b/app/src/main/java/app/revanced/manager/ui/screen/settings/GeneralSettingsScreen.kt @@ -1,7 +1,6 @@ package app.revanced.manager.ui.screen.settings import android.os.Build -import androidx.annotation.StringRes import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.* 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.theme.Theme import app.revanced.manager.ui.viewmodel.SettingsViewModel -import kotlinx.coroutines.launch import org.koin.compose.koinInject @OptIn(ExperimentalMaterial3Api::class) @@ -82,14 +80,6 @@ fun GeneralSettingsScreen( 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 = { - Button(onClick = { - onConfirm(selectedTheme) - onDismiss() - }) { + Button( + onClick = { + onConfirm(selectedTheme) + onDismiss() + } + ) { Text(stringResource(R.string.apply)) } } diff --git a/app/src/main/java/app/revanced/manager/ui/viewmodel/AdvancedSettingsViewModel.kt b/app/src/main/java/app/revanced/manager/ui/viewmodel/AdvancedSettingsViewModel.kt index 6b084005c1..6d7d79b83d 100644 --- a/app/src/main/java/app/revanced/manager/ui/viewmodel/AdvancedSettingsViewModel.kt +++ b/app/src/main/java/app/revanced/manager/ui/viewmodel/AdvancedSettingsViewModel.kt @@ -17,6 +17,7 @@ class AdvancedSettingsViewModel( private val patchBundleRepository: PatchBundleRepository ) : ViewModel() { val apiUrl = prefs.api + val allowExperimental = prefs.allowExperimental fun setApiUrl(value: String) = viewModelScope.launch(Dispatchers.Default) { if (value == apiUrl.get()) return@launch