Address compose and xmlutil deprecations (#3507)
This commit is contained in:
@@ -268,27 +268,7 @@ class MigrationConfigScreen(private val mangaIds: Collection<Long>) : Screen() {
|
||||
onClick: () -> Unit,
|
||||
) {
|
||||
ListItem(
|
||||
headlineContent = {
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
SourceIcon(source = source.source)
|
||||
Text(
|
||||
text = source.name,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
modifier = Modifier.weight(1f),
|
||||
)
|
||||
if (showLanguage) {
|
||||
Pill(
|
||||
text = LocaleHelper.getShortDisplayName(source.shortLanguage, uppercase = true),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
modifier = Modifier.clickable(onClick = onClick),
|
||||
trailingContent = if (dragEnabled) {
|
||||
{
|
||||
Icon(
|
||||
@@ -302,11 +282,28 @@ class MigrationConfigScreen(private val mangaIds: Collection<Long>) : Screen() {
|
||||
} else {
|
||||
null
|
||||
},
|
||||
colors = ListItemDefaults.colors(
|
||||
containerColor = Color.Transparent,
|
||||
),
|
||||
modifier = Modifier.clickable(onClick = onClick),
|
||||
)
|
||||
colors = ListItemDefaults.colors(containerColor = Color.Transparent),
|
||||
) {
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
SourceIcon(source = source.source)
|
||||
Text(
|
||||
text = source.name,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
modifier = Modifier.weight(1f),
|
||||
)
|
||||
if (showLanguage) {
|
||||
Pill(
|
||||
text = LocaleHelper.getShortDisplayName(source.shortLanguage, uppercase = true),
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class ScreenModel(
|
||||
|
||||
@@ -201,16 +201,16 @@ private fun MigrationSheetSwitchItem(
|
||||
onClick: () -> Unit,
|
||||
) {
|
||||
ListItem(
|
||||
headlineContent = { Text(text = title) },
|
||||
supportingContent = subtitle?.let { { Text(text = subtitle) } },
|
||||
modifier = Modifier.clickable(onClick = onClick),
|
||||
trailingContent = {
|
||||
Switch(
|
||||
checked = checked,
|
||||
onCheckedChange = null,
|
||||
)
|
||||
},
|
||||
supportingContent = subtitle?.let { { Text(text = subtitle) } },
|
||||
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,
|
||||
)
|
||||
},
|
||||
headlineContent = {
|
||||
Text(
|
||||
text = text,
|
||||
color = MaterialTheme.colorScheme.error,
|
||||
modifier = Modifier,
|
||||
)
|
||||
},
|
||||
colors = ListItemDefaults.colors(containerColor = Color.Transparent),
|
||||
)
|
||||
) {
|
||||
Text(
|
||||
text = text,
|
||||
color = MaterialTheme.colorScheme.error,
|
||||
modifier = Modifier,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user