Minor cleanup
(cherry picked from commit 9a75232ca40e8f6f3dd6a6f73cc0c2f3912e3ced) # Conflicts: # app/src/main/java/eu/kanade/presentation/browse/SourcesScreen.kt # app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourcesFilterController.kt
This commit is contained in:
parent
9c80b20574
commit
cf980adb8e
@ -9,8 +9,8 @@ class ToggleLanguage(
|
||||
) {
|
||||
|
||||
fun await(language: String) {
|
||||
val isEnabled = language in preferences.enabledLanguages().get()
|
||||
if (isEnabled) {
|
||||
val enabled = language in preferences.enabledLanguages().get()
|
||||
if (enabled) {
|
||||
preferences.enabledLanguages() -= language
|
||||
} else {
|
||||
preferences.enabledLanguages() += language
|
||||
|
@ -37,6 +37,7 @@ import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
|
||||
@ -47,6 +48,7 @@ import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
import eu.kanade.presentation.browse.components.ExtensionIcon
|
||||
import eu.kanade.presentation.components.DIVIDER_ALPHA
|
||||
import eu.kanade.presentation.components.Divider
|
||||
import eu.kanade.presentation.components.EmptyScreen
|
||||
import eu.kanade.presentation.components.PreferenceRow
|
||||
@ -76,7 +78,7 @@ fun ExtensionDetailsScreen(
|
||||
|
||||
val sources by presenter.sourcesState.collectAsState()
|
||||
|
||||
val (showNsfwWarning, setShowNsfwWarning) = remember { mutableStateOf(false) }
|
||||
var showNsfwWarning by remember { mutableStateOf(false) }
|
||||
|
||||
LazyColumn(
|
||||
modifier = Modifier.nestedScroll(nestedScrollInterop),
|
||||
@ -105,7 +107,7 @@ fun ExtensionDetailsScreen(
|
||||
onClickUninstall = onClickUninstall,
|
||||
onClickAppInfo = onClickAppInfo,
|
||||
onClickAgeRating = {
|
||||
setShowNsfwWarning(true)
|
||||
showNsfwWarning = true
|
||||
},
|
||||
)
|
||||
}
|
||||
@ -125,7 +127,7 @@ fun ExtensionDetailsScreen(
|
||||
if (showNsfwWarning) {
|
||||
NsfwWarningDialog(
|
||||
onClickConfirm = {
|
||||
setShowNsfwWarning(false)
|
||||
showNsfwWarning = false
|
||||
},
|
||||
)
|
||||
}
|
||||
@ -220,7 +222,7 @@ private fun DetailsHeader(
|
||||
fontWeight = FontWeight.Medium,
|
||||
),
|
||||
secondaryText = stringResource(R.string.ext_info_age_rating),
|
||||
onCLick = onClickAgeRating,
|
||||
onClick = onClickAgeRating,
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -262,12 +264,12 @@ private fun InfoText(
|
||||
primaryText: String,
|
||||
primaryTextStyle: TextStyle = MaterialTheme.typography.bodyLarge,
|
||||
secondaryText: String,
|
||||
onCLick: (() -> Unit)? = null,
|
||||
onClick: (() -> Unit)? = null,
|
||||
) {
|
||||
val interactionSource = remember { MutableInteractionSource() }
|
||||
|
||||
val modifier = if (onCLick != null) {
|
||||
Modifier.clickable(interactionSource, indication = null) { onCLick() }
|
||||
val modifier = if (onClick != null) {
|
||||
Modifier.clickable(interactionSource, indication = null) { onClick() }
|
||||
} else Modifier
|
||||
|
||||
Column(
|
||||
@ -281,9 +283,9 @@ private fun InfoText(
|
||||
)
|
||||
|
||||
Text(
|
||||
text = secondaryText + if (onCLick != null) " ⓘ" else "",
|
||||
text = secondaryText + if (onClick != null) " ⓘ" else "",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.5F),
|
||||
color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.5f),
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -294,7 +296,7 @@ private fun InfoDivider() {
|
||||
modifier = Modifier
|
||||
.height(20.dp)
|
||||
.width(1.dp),
|
||||
color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.5F),
|
||||
color = MaterialTheme.colorScheme.onSurface.copy(alpha = DIVIDER_ALPHA),
|
||||
)
|
||||
}
|
||||
|
||||
@ -341,11 +343,11 @@ fun NsfwWarningDialog(
|
||||
) {
|
||||
AlertDialog(
|
||||
text = {
|
||||
Text(text = stringResource(id = R.string.ext_nsfw_warning))
|
||||
Text(text = stringResource(R.string.ext_nsfw_warning))
|
||||
},
|
||||
confirmButton = {
|
||||
TextButton(onClick = onClickConfirm) {
|
||||
Text(text = stringResource(id = R.string.ext_nsfw_warning_dismiss))
|
||||
Text(text = stringResource(android.R.string.ok))
|
||||
}
|
||||
},
|
||||
onDismissRequest = onClickConfirm,
|
||||
|
@ -1,7 +1,5 @@
|
||||
package eu.kanade.presentation.browse
|
||||
|
||||
import androidx.compose.animation.core.LinearOutSlowInEasing
|
||||
import androidx.compose.animation.core.tween
|
||||
import androidx.compose.foundation.layout.WindowInsets
|
||||
import androidx.compose.foundation.layout.asPaddingValues
|
||||
import androidx.compose.foundation.layout.navigationBars
|
||||
@ -64,9 +62,9 @@ fun SourceFilterContent(
|
||||
items = items,
|
||||
) { model ->
|
||||
ExtensionFilterItem(
|
||||
modifier = Modifier.animateItemPlacement(tween(1000, easing = LinearOutSlowInEasing)),
|
||||
modifier = Modifier.animateItemPlacement(),
|
||||
lang = model.lang,
|
||||
isEnabled = model.isEnabled,
|
||||
enabled = model.enabled,
|
||||
onClickItem = onClickLang,
|
||||
)
|
||||
}
|
||||
@ -77,14 +75,14 @@ fun SourceFilterContent(
|
||||
fun ExtensionFilterItem(
|
||||
modifier: Modifier,
|
||||
lang: String,
|
||||
isEnabled: Boolean,
|
||||
enabled: Boolean,
|
||||
onClickItem: (String) -> Unit,
|
||||
) {
|
||||
PreferenceRow(
|
||||
modifier = modifier,
|
||||
title = LocaleHelper.getSourceDisplayName(lang, LocalContext.current),
|
||||
action = {
|
||||
Switch(checked = isEnabled, onCheckedChange = null)
|
||||
Switch(checked = enabled, onCheckedChange = null)
|
||||
},
|
||||
onClick = { onClickItem(lang) },
|
||||
)
|
||||
|
@ -29,6 +29,7 @@ import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
|
||||
@ -113,7 +114,8 @@ fun ExtensionContent(
|
||||
onClickUpdateAll: () -> Unit,
|
||||
onLaunched: () -> Unit,
|
||||
) {
|
||||
val (trustState, setTrustState) = remember { mutableStateOf<Extension.Untrusted?>(null) }
|
||||
var trustState by remember { mutableStateOf<Extension.Untrusted?>(null) }
|
||||
|
||||
LazyColumn(
|
||||
contentPadding = WindowInsets.navigationBars.asPaddingValues() + topPaddingValues,
|
||||
) {
|
||||
@ -140,7 +142,7 @@ fun ExtensionContent(
|
||||
{
|
||||
Button(onClick = { onClickUpdateAll() }) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.ext_update_all),
|
||||
text = stringResource(R.string.ext_update_all),
|
||||
style = LocalTextStyle.current.copy(
|
||||
color = MaterialTheme.colorScheme.onPrimary,
|
||||
),
|
||||
@ -176,7 +178,7 @@ fun ExtensionContent(
|
||||
onOpenExtension(it)
|
||||
}
|
||||
}
|
||||
is Extension.Untrusted -> setTrustState(it)
|
||||
is Extension.Untrusted -> { trustState = it }
|
||||
}
|
||||
},
|
||||
onLongClickItem = onLongClickItem,
|
||||
@ -191,7 +193,7 @@ fun ExtensionContent(
|
||||
onOpenExtension(it)
|
||||
}
|
||||
}
|
||||
is Extension.Untrusted -> setTrustState(it)
|
||||
is Extension.Untrusted -> { trustState = it }
|
||||
}
|
||||
},
|
||||
)
|
||||
@ -205,15 +207,15 @@ fun ExtensionContent(
|
||||
if (trustState != null) {
|
||||
ExtensionTrustDialog(
|
||||
onClickConfirm = {
|
||||
onTrustExtension(trustState)
|
||||
setTrustState(null)
|
||||
onTrustExtension(trustState!!)
|
||||
trustState = null
|
||||
},
|
||||
onClickDismiss = {
|
||||
onUninstallExtension(trustState)
|
||||
setTrustState(null)
|
||||
onUninstallExtension(trustState!!)
|
||||
trustState = null
|
||||
},
|
||||
onDismissRequest = {
|
||||
setTrustState(null)
|
||||
trustState = null
|
||||
},
|
||||
)
|
||||
}
|
||||
@ -438,19 +440,19 @@ fun ExtensionTrustDialog(
|
||||
) {
|
||||
AlertDialog(
|
||||
title = {
|
||||
Text(text = stringResource(id = R.string.untrusted_extension))
|
||||
Text(text = stringResource(R.string.untrusted_extension))
|
||||
},
|
||||
text = {
|
||||
Text(text = stringResource(id = R.string.untrusted_extension_message))
|
||||
Text(text = stringResource(R.string.untrusted_extension_message))
|
||||
},
|
||||
confirmButton = {
|
||||
TextButton(onClick = onClickConfirm) {
|
||||
Text(text = stringResource(id = R.string.ext_trust))
|
||||
Text(text = stringResource(R.string.ext_trust))
|
||||
}
|
||||
},
|
||||
dismissButton = {
|
||||
TextButton(onClick = onClickDismiss) {
|
||||
Text(text = stringResource(id = R.string.ext_uninstall))
|
||||
Text(text = stringResource(R.string.ext_uninstall))
|
||||
}
|
||||
},
|
||||
onDismissRequest = onDismissRequest,
|
||||
|
@ -73,7 +73,7 @@ fun MigrateSourceList(
|
||||
) {
|
||||
item(key = "title") {
|
||||
Text(
|
||||
text = stringResource(id = R.string.migration_selection_prompt),
|
||||
text = stringResource(R.string.migration_selection_prompt),
|
||||
modifier = Modifier
|
||||
.animateItemPlacement()
|
||||
.padding(horizontal = horizontalPadding, vertical = 8.dp),
|
||||
|
@ -100,7 +100,7 @@ fun SourcesFilterContent(
|
||||
SourcesFilterHeader(
|
||||
modifier = Modifier.animateItemPlacement(),
|
||||
language = model.language,
|
||||
isEnabled = model.isEnabled,
|
||||
enabled = model.enabled,
|
||||
onClickItem = onClickLang,
|
||||
)
|
||||
}
|
||||
@ -108,9 +108,9 @@ fun SourcesFilterContent(
|
||||
is FilterUiModel.ToggleHeader -> {
|
||||
SourcesFilterToggle(
|
||||
modifier = Modifier.animateItemPlacement(),
|
||||
isEnabled = model.isEnabled,
|
||||
isEnabled = model.enabled,
|
||||
onClickItem = {
|
||||
onClickSources(!model.isEnabled, model.sources)
|
||||
onClickSources(!model.enabled, model.sources)
|
||||
},
|
||||
)
|
||||
}
|
||||
@ -118,7 +118,7 @@ fun SourcesFilterContent(
|
||||
is FilterUiModel.Item -> SourcesFilterItem(
|
||||
modifier = Modifier.animateItemPlacement(),
|
||||
source = model.source,
|
||||
isEnabled = model.isEnabled,
|
||||
enabled = model.enabled,
|
||||
onClickItem = onClickSource,
|
||||
)
|
||||
}
|
||||
@ -130,14 +130,14 @@ fun SourcesFilterContent(
|
||||
fun SourcesFilterHeader(
|
||||
modifier: Modifier,
|
||||
language: String,
|
||||
isEnabled: Boolean,
|
||||
enabled: Boolean,
|
||||
onClickItem: (String) -> Unit,
|
||||
) {
|
||||
PreferenceRow(
|
||||
modifier = modifier,
|
||||
title = LocaleHelper.getSourceDisplayName(language, LocalContext.current),
|
||||
action = {
|
||||
Switch(checked = isEnabled, onCheckedChange = null)
|
||||
Switch(checked = enabled, onCheckedChange = null)
|
||||
},
|
||||
onClick = { onClickItem(language) },
|
||||
)
|
||||
@ -167,7 +167,7 @@ fun SourcesFilterToggle(
|
||||
fun SourcesFilterItem(
|
||||
modifier: Modifier,
|
||||
source: Source,
|
||||
isEnabled: Boolean,
|
||||
enabled: Boolean,
|
||||
onClickItem: (Source) -> Unit,
|
||||
) {
|
||||
BaseSourceItem(
|
||||
@ -176,7 +176,7 @@ fun SourcesFilterItem(
|
||||
showLanguageInContent = false,
|
||||
onClickItem = { onClickItem(source) },
|
||||
action = {
|
||||
Checkbox(checked = isEnabled, onCheckedChange = null)
|
||||
Checkbox(checked = enabled, onCheckedChange = null)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateListOf
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
|
||||
import androidx.compose.ui.input.nestedscroll.nestedScroll
|
||||
@ -99,9 +100,9 @@ fun SourceList(
|
||||
return
|
||||
}
|
||||
|
||||
val (sourceState, setSourceState) = remember { mutableStateOf<Source?>(null) }
|
||||
var sourceState by remember { mutableStateOf<Source?>(null) }
|
||||
// SY -->
|
||||
val (sourceCategoriesState, setSourceCategoriesState) = remember { mutableStateOf<Source?>(null) }
|
||||
var sourceCategoriesState by remember { mutableStateOf<Source?>(null) }
|
||||
// SY <--
|
||||
LazyColumn(
|
||||
modifier = Modifier.nestedScroll(nestedScrollConnection),
|
||||
@ -136,9 +137,7 @@ fun SourceList(
|
||||
showLatest = showLatest,
|
||||
showPin = showPin,
|
||||
onClickItem = onClickItem,
|
||||
onLongClickItem = {
|
||||
setSourceState(it)
|
||||
},
|
||||
onLongClickItem = { sourceState = it },
|
||||
onClickLatest = onClickLatest,
|
||||
onClickPin = onClickPin,
|
||||
)
|
||||
@ -148,38 +147,37 @@ fun SourceList(
|
||||
|
||||
if (sourceState != null) {
|
||||
SourceOptionsDialog(
|
||||
source = sourceState,
|
||||
source = sourceState!!,
|
||||
onClickPin = {
|
||||
onClickPin(sourceState)
|
||||
setSourceState(null)
|
||||
onClickPin(sourceState!!)
|
||||
sourceState = null
|
||||
},
|
||||
onClickDisable = {
|
||||
onClickDisable(sourceState)
|
||||
setSourceState(null)
|
||||
onClickDisable(sourceState!!)
|
||||
sourceState = null
|
||||
},
|
||||
onClickSetCategories = {
|
||||
setSourceCategoriesState(sourceState)
|
||||
setSourceState(null)
|
||||
sourceCategoriesState = sourceState
|
||||
sourceState = null
|
||||
},
|
||||
onClickToggleDataSaver = {
|
||||
onClickToggleDataSaver(sourceState)
|
||||
setSourceState(null)
|
||||
onClickToggleDataSaver(sourceState!!)
|
||||
sourceState = null
|
||||
},
|
||||
onDismiss = { setSourceState(null) },
|
||||
)
|
||||
}
|
||||
if (sourceCategoriesState != null) {
|
||||
SourceCategoriesDialog(
|
||||
source = sourceCategoriesState,
|
||||
categories = categories,
|
||||
oldCategories = sourceCategoriesState.categories,
|
||||
onClickCategories = {
|
||||
onClickSetCategories(sourceCategoriesState, it)
|
||||
setSourceCategoriesState(null)
|
||||
},
|
||||
onDismiss = { setSourceCategoriesState(null) },
|
||||
onDismiss = { sourceState = null },
|
||||
)
|
||||
}
|
||||
// SY -->
|
||||
SourceCategoriesDialog(
|
||||
source = sourceCategoriesState,
|
||||
categories = categories,
|
||||
onClickCategories = { source, newCategories ->
|
||||
onClickSetCategories(source, newCategories)
|
||||
sourceCategoriesState = null
|
||||
},
|
||||
onDismiss = { sourceCategoriesState = null },
|
||||
)
|
||||
// SY <--
|
||||
}
|
||||
|
||||
@Composable
|
||||
@ -221,7 +219,7 @@ fun SourceItem(
|
||||
if (source.supportsLatest /* SY --> */ && showLatest /* SY <-- */) {
|
||||
TextButton(onClick = { onClickLatest(source) }) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.latest),
|
||||
text = stringResource(R.string.latest),
|
||||
style = LocalTextStyle.current.copy(
|
||||
color = MaterialTheme.colorScheme.primary,
|
||||
),
|
||||
@ -281,7 +279,7 @@ fun SourceOptionsDialog(
|
||||
)
|
||||
if (source.id != LocalSource.ID) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.action_disable),
|
||||
text = stringResource(R.string.action_disable),
|
||||
modifier = Modifier
|
||||
.clickable(onClick = onClickDisable)
|
||||
.fillMaxWidth()
|
||||
@ -323,14 +321,14 @@ sealed class SourceUiModel {
|
||||
// SY -->
|
||||
@Composable
|
||||
fun SourceCategoriesDialog(
|
||||
source: Source,
|
||||
source: Source?,
|
||||
categories: List<String>,
|
||||
oldCategories: Set<String>,
|
||||
onClickCategories: (List<String>) -> Unit,
|
||||
onClickCategories: (Source, List<String>) -> Unit,
|
||||
onDismiss: () -> Unit,
|
||||
) {
|
||||
val newCategories = remember {
|
||||
mutableStateListOf<String>().also { it.addAll(oldCategories) }
|
||||
source ?: return
|
||||
val newCategories = remember(source) {
|
||||
mutableStateListOf<String>().also { it += source.categories }
|
||||
}
|
||||
AlertDialog(
|
||||
title = {
|
||||
@ -357,7 +355,7 @@ fun SourceCategoriesDialog(
|
||||
},
|
||||
onDismissRequest = onDismiss,
|
||||
confirmButton = {
|
||||
TextButton(onClick = { onClickCategories(newCategories.toList()) }) {
|
||||
TextButton(onClick = { onClickCategories(source, newCategories.toList()) }) {
|
||||
Text(text = stringResource(android.R.string.ok))
|
||||
}
|
||||
},
|
||||
|
@ -22,13 +22,15 @@ import androidx.compose.ui.unit.dp
|
||||
import eu.kanade.core.prefs.PreferenceMutableState
|
||||
import eu.kanade.presentation.util.horizontalPadding
|
||||
|
||||
const val DIVIDER_ALPHA = 0.2f
|
||||
|
||||
@Composable
|
||||
fun Divider(
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
androidx.compose.material3.Divider(
|
||||
modifier = modifier,
|
||||
color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.2f),
|
||||
color = MaterialTheme.colorScheme.onSurface.copy(alpha = DIVIDER_ALPHA),
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,7 @@ import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
|
||||
@ -103,7 +104,7 @@ fun HistoryContent(
|
||||
val relativeTime: Int = remember { preferences.relativeTime().get() }
|
||||
val dateFormat: DateFormat = remember { preferences.dateFormat() }
|
||||
|
||||
val (removeState, setRemoveState) = remember { mutableStateOf<HistoryWithRelations?>(null) }
|
||||
var removeState by remember { mutableStateOf<HistoryWithRelations?>(null) }
|
||||
|
||||
val scrollState = rememberLazyListState()
|
||||
LazyColumn(
|
||||
@ -130,7 +131,7 @@ fun HistoryContent(
|
||||
history = value,
|
||||
onClickCover = { onClickCover(value) },
|
||||
onClickResume = { onClickResume(value) },
|
||||
onClickDelete = { setRemoveState(value) },
|
||||
onClickDelete = { removeState = value },
|
||||
)
|
||||
}
|
||||
null -> {}
|
||||
@ -141,10 +142,10 @@ fun HistoryContent(
|
||||
if (removeState != null) {
|
||||
RemoveHistoryDialog(
|
||||
onPositive = { all ->
|
||||
onClickDelete(removeState, all)
|
||||
setRemoveState(null)
|
||||
onClickDelete(removeState!!, all)
|
||||
removeState = null
|
||||
},
|
||||
onNegative = { setRemoveState(null) },
|
||||
onNegative = { removeState = null },
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -224,7 +225,7 @@ fun HistoryItem(
|
||||
IconButton(onClick = onClickDelete) {
|
||||
Icon(
|
||||
imageVector = Icons.Outlined.Delete,
|
||||
contentDescription = stringResource(id = R.string.action_delete),
|
||||
contentDescription = stringResource(R.string.action_delete),
|
||||
tint = MaterialTheme.colorScheme.onSurface,
|
||||
)
|
||||
}
|
||||
@ -236,15 +237,15 @@ fun RemoveHistoryDialog(
|
||||
onPositive: (Boolean) -> Unit,
|
||||
onNegative: () -> Unit,
|
||||
) {
|
||||
val (removeEverything, removeEverythingState) = remember { mutableStateOf(false) }
|
||||
var removeEverything by remember { mutableStateOf(false) }
|
||||
|
||||
AlertDialog(
|
||||
title = {
|
||||
Text(text = stringResource(id = R.string.action_remove))
|
||||
Text(text = stringResource(R.string.action_remove))
|
||||
},
|
||||
text = {
|
||||
Column {
|
||||
Text(text = stringResource(id = R.string.dialog_with_checkbox_remove_description))
|
||||
Text(text = stringResource(R.string.dialog_with_checkbox_remove_description))
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.padding(top = 16.dp)
|
||||
@ -252,7 +253,7 @@ fun RemoveHistoryDialog(
|
||||
interactionSource = remember { MutableInteractionSource() },
|
||||
indication = null,
|
||||
value = removeEverything,
|
||||
onValueChange = removeEverythingState,
|
||||
onValueChange = { removeEverything = it },
|
||||
),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
@ -262,7 +263,7 @@ fun RemoveHistoryDialog(
|
||||
)
|
||||
Text(
|
||||
modifier = Modifier.padding(start = 4.dp),
|
||||
text = stringResource(id = R.string.dialog_with_checkbox_reset),
|
||||
text = stringResource(R.string.dialog_with_checkbox_reset),
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -270,12 +271,12 @@ fun RemoveHistoryDialog(
|
||||
onDismissRequest = onNegative,
|
||||
confirmButton = {
|
||||
TextButton(onClick = { onPositive(removeEverything) }) {
|
||||
Text(text = stringResource(id = R.string.action_remove))
|
||||
Text(text = stringResource(R.string.action_remove))
|
||||
}
|
||||
},
|
||||
dismissButton = {
|
||||
TextButton(onClick = onNegative) {
|
||||
Text(text = stringResource(id = R.string.action_cancel))
|
||||
Text(text = stringResource(R.string.action_cancel))
|
||||
}
|
||||
},
|
||||
)
|
||||
|
@ -24,4 +24,4 @@ class ExtensionFilterController : ComposeController<ExtensionFilterPresenter>()
|
||||
}
|
||||
}
|
||||
|
||||
data class FilterUiModel(val lang: String, val isEnabled: Boolean)
|
||||
data class FilterUiModel(val lang: String, val enabled: Boolean)
|
||||
|
@ -34,11 +34,11 @@ class SourceFilterController : ComposeController<SourcesFilterPresenter>() {
|
||||
}
|
||||
|
||||
sealed class FilterUiModel {
|
||||
data class Header(val language: String, val isEnabled: Boolean) : FilterUiModel()
|
||||
data class Header(val language: String, val enabled: Boolean) : FilterUiModel()
|
||||
|
||||
// SY -->
|
||||
data class ToggleHeader(val sources: List<Source>, val isEnabled: Boolean) : FilterUiModel()
|
||||
data class ToggleHeader(val sources: List<Source>, val enabled: Boolean) : FilterUiModel()
|
||||
|
||||
// SY <--
|
||||
data class Item(val source: Source, val isEnabled: Boolean) : FilterUiModel()
|
||||
data class Item(val source: Source, val enabled: Boolean) : FilterUiModel()
|
||||
}
|
||||
|
@ -273,8 +273,7 @@
|
||||
<string name="ext_info_language">Language</string>
|
||||
<string name="ext_info_age_rating">Age rating</string>
|
||||
<string name="ext_nsfw_short">18+</string>
|
||||
<string name="ext_nsfw_warning">May contain NSFW (18+) content</string>
|
||||
<string name="ext_nsfw_warning_dismiss">Got it</string>
|
||||
<string name="ext_nsfw_warning">Sources from this extension may contain NSFW (18+) content</string>
|
||||
<string name="ext_install_service_notif">Installing extension…</string>
|
||||
<string name="ext_installer_pref">Installer</string>
|
||||
<string name="ext_installer_legacy">Legacy</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user