Minor cleanup

This commit is contained in:
arkon
2022-04-24 14:39:51 -04:00
parent 29a0989f28
commit 0ec9496d26
9 changed files with 31 additions and 43 deletions

View File

@@ -24,8 +24,6 @@ fun AppBarTitle(
title: String?,
subtitle: String? = null,
) {
val subtitleTextStyle = MaterialTheme.typography.bodyMedium
Column {
title?.let {
Text(
@@ -37,7 +35,7 @@ fun AppBarTitle(
subtitle?.let {
Text(
text = it,
style = subtitleTextStyle,
style = MaterialTheme.typography.bodyMedium,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
@@ -54,7 +52,7 @@ fun AppBarActions(
actions.filterIsInstance<AppBar.Action>().map {
IconButton(
onClick = it.onClick,
enabled = it.isEnabled,
enabled = it.enabled,
) {
Icon(
imageVector = it.icon,
@@ -71,7 +69,7 @@ fun AppBarActions(
DropdownMenu(
expanded = showMenu,
onDismissRequest = { showMenu = false }
onDismissRequest = { showMenu = false },
) {
overflowActions.map {
DropdownMenuItem(
@@ -93,7 +91,7 @@ object AppBar {
val title: String,
val icon: ImageVector,
val onClick: () -> Unit,
val isEnabled: Boolean = true,
val enabled: Boolean = true,
) : AppBarAction
data class OverflowAction(

View File

@@ -1,8 +1,8 @@
package eu.kanade.presentation.components
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
@@ -28,12 +28,12 @@ fun LinkIcon(
painter: Painter,
onClick: () -> Unit,
) {
Icon(
modifier = modifier
.clickable(onClick = onClick)
.padding(16.dp),
painter = painter,
tint = MaterialTheme.colorScheme.primary,
contentDescription = label,
)
IconButton(onClick = onClick) {
Icon(
modifier = modifier.padding(16.dp),
painter = painter,
tint = MaterialTheme.colorScheme.primary,
contentDescription = label,
)
}
}

View File

@@ -39,9 +39,7 @@ fun PreferenceRow(
) {
val height = if (subtitle != null) 72.dp else 56.dp
val titleTextStyle = MaterialTheme.typography.bodyLarge.copy(
color = MaterialTheme.colorScheme.onSurface,
)
val titleTextStyle = MaterialTheme.typography.bodyLarge
val subtitleTextStyle = MaterialTheme.typography.bodyMedium.copy(
color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.75f),
)