Address compose and xmlutil deprecations (#3507)
This commit is contained in:
@@ -169,8 +169,6 @@ internal class PermissionStep : OnboardingStep {
|
|||||||
) {
|
) {
|
||||||
ListItem(
|
ListItem(
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
headlineContent = { Text(text = title) },
|
|
||||||
supportingContent = { Text(text = subtitle) },
|
|
||||||
trailingContent = {
|
trailingContent = {
|
||||||
OutlinedButton(
|
OutlinedButton(
|
||||||
enabled = !granted,
|
enabled = !granted,
|
||||||
@@ -187,7 +185,9 @@ internal class PermissionStep : OnboardingStep {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
supportingContent = { Text(text = subtitle) },
|
||||||
colors = ListItemDefaults.colors(containerColor = Color.Transparent),
|
colors = ListItemDefaults.colors(containerColor = Color.Transparent),
|
||||||
|
content = { Text(text = title) },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,15 +201,15 @@ internal class PermissionStep : OnboardingStep {
|
|||||||
) {
|
) {
|
||||||
ListItem(
|
ListItem(
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
headlineContent = { Text(text = title) },
|
|
||||||
supportingContent = { Text(text = subtitle) },
|
|
||||||
trailingContent = {
|
trailingContent = {
|
||||||
Switch(
|
Switch(
|
||||||
checked = granted,
|
checked = granted,
|
||||||
onCheckedChange = onToggleChange,
|
onCheckedChange = onToggleChange,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
supportingContent = { Text(text = subtitle) },
|
||||||
colors = ListItemDefaults.colors(containerColor = Color.Transparent),
|
colors = ListItemDefaults.colors(containerColor = Color.Transparent),
|
||||||
|
content = { Text(text = title) },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-6
@@ -10,6 +10,7 @@ import androidx.compose.material.icons.Icons
|
|||||||
import androidx.compose.material.icons.filled.Check
|
import androidx.compose.material.icons.filled.Check
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.ListItem
|
import androidx.compose.material3.ListItem
|
||||||
|
import androidx.compose.material3.ListItemDefaults
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
@@ -71,12 +72,6 @@ class AppLanguageScreen : Screen() {
|
|||||||
modifier = Modifier.clickable {
|
modifier = Modifier.clickable {
|
||||||
currentLanguage = it.langTag
|
currentLanguage = it.langTag
|
||||||
},
|
},
|
||||||
headlineContent = { Text(it.displayName) },
|
|
||||||
supportingContent = {
|
|
||||||
it.localizedDisplayName?.let {
|
|
||||||
Text(it)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
trailingContent = {
|
trailingContent = {
|
||||||
if (currentLanguage == it.langTag) {
|
if (currentLanguage == it.langTag) {
|
||||||
Icon(
|
Icon(
|
||||||
@@ -86,6 +81,12 @@ class AppLanguageScreen : Screen() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
supportingContent = {
|
||||||
|
it.localizedDisplayName?.let {
|
||||||
|
Text(it)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
content = { Text(it.displayName) },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,9 @@ import kotlinx.serialization.json.Json
|
|||||||
import kotlinx.serialization.protobuf.ProtoBuf
|
import kotlinx.serialization.protobuf.ProtoBuf
|
||||||
import nl.adaptivity.xmlutil.XmlDeclMode
|
import nl.adaptivity.xmlutil.XmlDeclMode
|
||||||
import nl.adaptivity.xmlutil.core.XmlVersion
|
import nl.adaptivity.xmlutil.core.XmlVersion
|
||||||
|
import nl.adaptivity.xmlutil.serialization.DefaultXmlSerializationPolicy
|
||||||
import nl.adaptivity.xmlutil.serialization.XML
|
import nl.adaptivity.xmlutil.serialization.XML
|
||||||
|
import nl.adaptivity.xmlutil.serialization.XmlConfig
|
||||||
import tachiyomi.core.common.storage.AndroidStorageFolderProvider
|
import tachiyomi.core.common.storage.AndroidStorageFolderProvider
|
||||||
import tachiyomi.data.Chapters
|
import tachiyomi.data.Chapters
|
||||||
import tachiyomi.data.Database
|
import tachiyomi.data.Database
|
||||||
@@ -92,15 +94,15 @@ class AppModule(val app: Application) : InjektModule {
|
|||||||
explicitNulls = false
|
explicitNulls = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
addSingletonFactory {
|
addSingletonFactory<XML> {
|
||||||
XML {
|
XML.v1 {
|
||||||
defaultPolicy {
|
policy {
|
||||||
ignoreUnknownChildren()
|
ignoreUnknownChildren()
|
||||||
}
|
|
||||||
autoPolymorphic = true
|
autoPolymorphic = true
|
||||||
|
}
|
||||||
xmlDeclMode = XmlDeclMode.Charset
|
xmlDeclMode = XmlDeclMode.Charset
|
||||||
indent = 2
|
|
||||||
xmlVersion = XmlVersion.XML10
|
xmlVersion = XmlVersion.XML10
|
||||||
|
setIndent(2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
addSingletonFactory<ProtoBuf> {
|
addSingletonFactory<ProtoBuf> {
|
||||||
|
|||||||
@@ -268,7 +268,22 @@ class MigrationConfigScreen(private val mangaIds: Collection<Long>) : Screen() {
|
|||||||
onClick: () -> Unit,
|
onClick: () -> Unit,
|
||||||
) {
|
) {
|
||||||
ListItem(
|
ListItem(
|
||||||
headlineContent = {
|
modifier = Modifier.clickable(onClick = onClick),
|
||||||
|
trailingContent = if (dragEnabled) {
|
||||||
|
{
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Outlined.DragHandle,
|
||||||
|
contentDescription = null,
|
||||||
|
modifier = with(scope) {
|
||||||
|
Modifier.draggableHandle()
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
},
|
||||||
|
colors = ListItemDefaults.colors(containerColor = Color.Transparent),
|
||||||
|
) {
|
||||||
Row(
|
Row(
|
||||||
horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small),
|
horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
@@ -288,25 +303,7 @@ class MigrationConfigScreen(private val mangaIds: Collection<Long>) : Screen() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
trailingContent = if (dragEnabled) {
|
|
||||||
{
|
|
||||||
Icon(
|
|
||||||
imageVector = Icons.Outlined.DragHandle,
|
|
||||||
contentDescription = null,
|
|
||||||
modifier = with(scope) {
|
|
||||||
Modifier.draggableHandle()
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
null
|
|
||||||
},
|
|
||||||
colors = ListItemDefaults.colors(
|
|
||||||
containerColor = Color.Transparent,
|
|
||||||
),
|
|
||||||
modifier = Modifier.clickable(onClick = onClick),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ScreenModel(
|
private class ScreenModel(
|
||||||
|
|||||||
@@ -201,16 +201,16 @@ private fun MigrationSheetSwitchItem(
|
|||||||
onClick: () -> Unit,
|
onClick: () -> Unit,
|
||||||
) {
|
) {
|
||||||
ListItem(
|
ListItem(
|
||||||
headlineContent = { Text(text = title) },
|
modifier = Modifier.clickable(onClick = onClick),
|
||||||
supportingContent = subtitle?.let { { Text(text = subtitle) } },
|
|
||||||
trailingContent = {
|
trailingContent = {
|
||||||
Switch(
|
Switch(
|
||||||
checked = checked,
|
checked = checked,
|
||||||
onCheckedChange = null,
|
onCheckedChange = null,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
supportingContent = subtitle?.let { { Text(text = subtitle) } },
|
||||||
colors = ListItemDefaults.colors(containerColor = Color.Transparent),
|
colors = ListItemDefaults.colors(containerColor = Color.Transparent),
|
||||||
modifier = Modifier.clickable(onClick = onClick),
|
content = { Text(text = title) },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -231,13 +231,12 @@ private fun MigrationSheetWarningItem(
|
|||||||
tint = MaterialTheme.colorScheme.active,
|
tint = MaterialTheme.colorScheme.active,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
headlineContent = {
|
colors = ListItemDefaults.colors(containerColor = Color.Transparent),
|
||||||
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = text,
|
text = text,
|
||||||
color = MaterialTheme.colorScheme.error,
|
color = MaterialTheme.colorScheme.error,
|
||||||
modifier = Modifier,
|
modifier = Modifier,
|
||||||
)
|
)
|
||||||
},
|
}
|
||||||
colors = ListItemDefaults.colors(containerColor = Color.Transparent),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user