Make padding names neutral (#8531)

This commit is contained in:
Andreas 2022-11-13 18:11:51 +01:00 committed by GitHub
parent 6017229d1b
commit 3407eb84c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 81 additions and 68 deletions

View File

@ -23,7 +23,6 @@ import androidx.compose.material.icons.outlined.History
import androidx.compose.material.icons.outlined.Settings import androidx.compose.material.icons.outlined.Settings
import androidx.compose.material3.AlertDialog import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Button import androidx.compose.material3.Button
import androidx.compose.material3.Divider
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
@ -57,7 +56,7 @@ import eu.kanade.presentation.components.ScrollbarLazyColumn
import eu.kanade.presentation.components.WarningBanner import eu.kanade.presentation.components.WarningBanner
import eu.kanade.presentation.more.settings.widget.TextPreferenceWidget import eu.kanade.presentation.more.settings.widget.TextPreferenceWidget
import eu.kanade.presentation.more.settings.widget.TrailingWidgetBuffer import eu.kanade.presentation.more.settings.widget.TrailingWidgetBuffer
import eu.kanade.presentation.util.horizontalPadding import eu.kanade.presentation.util.padding
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.extension.model.Extension
import eu.kanade.tachiyomi.source.ConfigurableSource import eu.kanade.tachiyomi.source.ConfigurableSource
@ -208,10 +207,10 @@ private fun DetailsHeader(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.padding( .padding(
start = horizontalPadding, start = MaterialTheme.padding.medium,
end = horizontalPadding, end = MaterialTheme.padding.medium,
top = 16.dp, top = MaterialTheme.padding.medium,
bottom = 8.dp, bottom = MaterialTheme.padding.small,
), ),
horizontalAlignment = Alignment.CenterHorizontally, horizontalAlignment = Alignment.CenterHorizontally,
) { ) {
@ -240,8 +239,8 @@ private fun DetailsHeader(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.padding( .padding(
horizontal = horizontalPadding * 2, horizontal = MaterialTheme.padding.extraLarge,
vertical = 8.dp, vertical = MaterialTheme.padding.small,
), ),
horizontalArrangement = Arrangement.SpaceEvenly, horizontalArrangement = Arrangement.SpaceEvenly,
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
@ -278,10 +277,10 @@ private fun DetailsHeader(
Row( Row(
modifier = Modifier.padding( modifier = Modifier.padding(
start = horizontalPadding, start = MaterialTheme.padding.medium,
end = horizontalPadding, end = MaterialTheme.padding.medium,
top = 8.dp, top = MaterialTheme.padding.small,
bottom = 16.dp, bottom = MaterialTheme.padding.medium,
), ),
) { ) {
OutlinedButton( OutlinedButton(

View File

@ -43,10 +43,10 @@ import eu.kanade.presentation.components.LoadingScreen
import eu.kanade.presentation.components.SwipeRefresh import eu.kanade.presentation.components.SwipeRefresh
import eu.kanade.presentation.manga.components.DotSeparatorNoSpaceText import eu.kanade.presentation.manga.components.DotSeparatorNoSpaceText
import eu.kanade.presentation.theme.header import eu.kanade.presentation.theme.header
import eu.kanade.presentation.util.horizontalPadding import eu.kanade.presentation.util.padding
import eu.kanade.presentation.util.plus import eu.kanade.presentation.util.plus
import eu.kanade.presentation.util.secondaryItemAlpha import eu.kanade.presentation.util.secondaryItemAlpha
import eu.kanade.presentation.util.topPaddingValues import eu.kanade.presentation.util.topSmallPaddingValues
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.extension.model.Extension
import eu.kanade.tachiyomi.extension.model.InstallStep import eu.kanade.tachiyomi.extension.model.InstallStep
@ -113,7 +113,7 @@ private fun ExtensionContent(
var trustState by remember { mutableStateOf<Extension.Untrusted?>(null) } var trustState by remember { mutableStateOf<Extension.Untrusted?>(null) }
FastScrollLazyColumn( FastScrollLazyColumn(
contentPadding = contentPadding + topPaddingValues, contentPadding = contentPadding + topSmallPaddingValues,
) { ) {
items( items(
items = state.items, items = state.items,
@ -272,7 +272,7 @@ private fun ExtensionItemContent(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
) { ) {
Column( Column(
modifier = modifier.padding(start = horizontalPadding), modifier = modifier.padding(start = MaterialTheme.padding.medium),
) { ) {
Text( Text(
text = extension.name, text = extension.name,
@ -396,7 +396,7 @@ private fun ExtensionHeader(
action: @Composable RowScope.() -> Unit = {}, action: @Composable RowScope.() -> Unit = {},
) { ) {
Row( Row(
modifier = modifier.padding(horizontal = horizontalPadding), modifier = modifier.padding(horizontal = MaterialTheme.padding.medium),
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
) { ) {
Text( Text(

View File

@ -34,10 +34,10 @@ import eu.kanade.presentation.components.LoadingScreen
import eu.kanade.presentation.components.ScrollbarLazyColumn import eu.kanade.presentation.components.ScrollbarLazyColumn
import eu.kanade.presentation.components.Scroller.STICKY_HEADER_KEY_PREFIX import eu.kanade.presentation.components.Scroller.STICKY_HEADER_KEY_PREFIX
import eu.kanade.presentation.theme.header import eu.kanade.presentation.theme.header
import eu.kanade.presentation.util.horizontalPadding import eu.kanade.presentation.util.padding
import eu.kanade.presentation.util.plus import eu.kanade.presentation.util.plus
import eu.kanade.presentation.util.secondaryItemAlpha import eu.kanade.presentation.util.secondaryItemAlpha
import eu.kanade.presentation.util.topPaddingValues import eu.kanade.presentation.util.topSmallPaddingValues
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.browse.migration.sources.MigrationSourcesPresenter import eu.kanade.tachiyomi.ui.browse.migration.sources.MigrationSourcesPresenter
import eu.kanade.tachiyomi.util.system.copyToClipboard import eu.kanade.tachiyomi.util.system.copyToClipboard
@ -84,13 +84,13 @@ private fun MigrateSourceList(
onToggleSortingDirection: () -> Unit, onToggleSortingDirection: () -> Unit,
) { ) {
ScrollbarLazyColumn( ScrollbarLazyColumn(
contentPadding = contentPadding + topPaddingValues, contentPadding = contentPadding + topSmallPaddingValues,
) { ) {
stickyHeader(key = STICKY_HEADER_KEY_PREFIX) { stickyHeader(key = STICKY_HEADER_KEY_PREFIX) {
Row( Row(
modifier = Modifier modifier = Modifier
.background(MaterialTheme.colorScheme.background) .background(MaterialTheme.colorScheme.background)
.padding(start = horizontalPadding), .padding(start = MaterialTheme.padding.medium),
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
) { ) {
Text( Text(
@ -152,7 +152,7 @@ private fun MigrateSourceItem(
content = { _, sourceLangString -> content = { _, sourceLangString ->
Column( Column(
modifier = Modifier modifier = Modifier
.padding(horizontal = horizontalPadding) .padding(horizontal = MaterialTheme.padding.medium)
.weight(1f), .weight(1f),
) { ) {
Text( Text(

View File

@ -30,9 +30,9 @@ import eu.kanade.presentation.components.EmptyScreen
import eu.kanade.presentation.components.LoadingScreen import eu.kanade.presentation.components.LoadingScreen
import eu.kanade.presentation.components.ScrollbarLazyColumn import eu.kanade.presentation.components.ScrollbarLazyColumn
import eu.kanade.presentation.theme.header import eu.kanade.presentation.theme.header
import eu.kanade.presentation.util.horizontalPadding import eu.kanade.presentation.util.padding
import eu.kanade.presentation.util.plus import eu.kanade.presentation.util.plus
import eu.kanade.presentation.util.topPaddingValues import eu.kanade.presentation.util.topSmallPaddingValues
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.source.LocalSource import eu.kanade.tachiyomi.source.LocalSource
import eu.kanade.tachiyomi.ui.browse.source.SourcesPresenter import eu.kanade.tachiyomi.ui.browse.source.SourcesPresenter
@ -85,7 +85,7 @@ private fun SourceList(
onClickPin: (Source) -> Unit, onClickPin: (Source) -> Unit,
) { ) {
ScrollbarLazyColumn( ScrollbarLazyColumn(
contentPadding = contentPadding + topPaddingValues, contentPadding = contentPadding + topSmallPaddingValues,
) { ) {
items( items(
items = state.items, items = state.items,
@ -146,7 +146,7 @@ private fun SourceHeader(
Text( Text(
text = LocaleHelper.getSourceDisplayName(language, context), text = LocaleHelper.getSourceDisplayName(language, context),
modifier = modifier modifier = modifier
.padding(horizontal = horizontalPadding, vertical = 8.dp), .padding(horizontal = MaterialTheme.padding.medium, vertical = MaterialTheme.padding.small),
style = MaterialTheme.typography.header, style = MaterialTheme.typography.header,
) )
} }

View File

@ -4,11 +4,11 @@ import androidx.compose.foundation.combinedClickable
import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp import eu.kanade.presentation.util.padding
import eu.kanade.presentation.util.horizontalPadding
@Composable @Composable
fun BaseBrowseItem( fun BaseBrowseItem(
@ -25,7 +25,7 @@ fun BaseBrowseItem(
onClick = onClickItem, onClick = onClickItem,
onLongClick = onLongClickItem, onLongClick = onLongClickItem,
) )
.padding(horizontal = horizontalPadding, vertical = 8.dp), .padding(horizontal = MaterialTheme.padding.medium, vertical = MaterialTheme.padding.small),
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
) { ) {
icon() icon()

View File

@ -10,7 +10,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.text.style.TextOverflow
import eu.kanade.domain.source.model.Source import eu.kanade.domain.source.model.Source
import eu.kanade.presentation.util.horizontalPadding import eu.kanade.presentation.util.padding
import eu.kanade.presentation.util.secondaryItemAlpha import eu.kanade.presentation.util.secondaryItemAlpha
import eu.kanade.tachiyomi.util.system.LocaleHelper import eu.kanade.tachiyomi.util.system.LocaleHelper
@ -43,7 +43,7 @@ private val defaultIcon: @Composable RowScope.(Source) -> Unit = { source ->
private val defaultContent: @Composable RowScope.(Source, String?) -> Unit = { source, sourceLangString -> private val defaultContent: @Composable RowScope.(Source, String?) -> Unit = { source, sourceLangString ->
Column( Column(
modifier = Modifier modifier = Modifier
.padding(horizontal = horizontalPadding) .padding(horizontal = MaterialTheme.padding.medium)
.weight(1f), .weight(1f),
) { ) {
Text( Text(

View File

@ -3,6 +3,7 @@ package eu.kanade.presentation.category
import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
@ -12,9 +13,9 @@ import eu.kanade.presentation.category.components.CategoryFloatingActionButton
import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.AppBar
import eu.kanade.presentation.components.EmptyScreen import eu.kanade.presentation.components.EmptyScreen
import eu.kanade.presentation.components.Scaffold import eu.kanade.presentation.components.Scaffold
import eu.kanade.presentation.util.horizontalPadding import eu.kanade.presentation.util.padding
import eu.kanade.presentation.util.plus import eu.kanade.presentation.util.plus
import eu.kanade.presentation.util.topPaddingValues import eu.kanade.presentation.util.topSmallPaddingValues
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.category.CategoryScreenState import eu.kanade.tachiyomi.ui.category.CategoryScreenState
@ -55,7 +56,7 @@ fun CategoryScreen(
CategoryContent( CategoryContent(
categories = state.categories, categories = state.categories,
lazyListState = lazyListState, lazyListState = lazyListState,
paddingValues = paddingValues + topPaddingValues + PaddingValues(horizontal = horizontalPadding), paddingValues = paddingValues + topSmallPaddingValues + PaddingValues(horizontal = MaterialTheme.padding.medium),
onClickRename = onClickRename, onClickRename = onClickRename,
onClickDelete = onClickDelete, onClickDelete = onClickDelete,
onMoveUp = onClickMoveUp, onMoveUp = onClickMoveUp,

View File

@ -14,13 +14,14 @@ import androidx.compose.material.icons.outlined.Label
import androidx.compose.material3.ElevatedCard import androidx.compose.material3.ElevatedCard
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton import androidx.compose.material3.IconButton
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
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import eu.kanade.domain.category.model.Category import eu.kanade.domain.category.model.Category
import eu.kanade.presentation.util.horizontalPadding import eu.kanade.presentation.util.padding
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
@Composable @Composable
@ -41,14 +42,18 @@ fun CategoryListItem(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.clickable { onRename() } .clickable { onRename() }
.padding(start = horizontalPadding, top = horizontalPadding, end = horizontalPadding), .padding(
start = MaterialTheme.padding.medium,
top = MaterialTheme.padding.medium,
end = MaterialTheme.padding.medium,
),
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
) { ) {
Icon(imageVector = Icons.Outlined.Label, contentDescription = "") Icon(imageVector = Icons.Outlined.Label, contentDescription = "")
Text( Text(
text = category.name, text = category.name,
modifier = Modifier modifier = Modifier
.padding(start = horizontalPadding), .padding(start = MaterialTheme.padding.medium),
) )
} }
Row { Row {

View File

@ -10,6 +10,7 @@ import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.AlertDialog import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Checkbox import androidx.compose.material3.Checkbox
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.TriStateCheckbox import androidx.compose.material3.TriStateCheckbox
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
@ -23,7 +24,7 @@ import androidx.compose.ui.res.stringResource
import eu.kanade.core.prefs.CheckboxState import eu.kanade.core.prefs.CheckboxState
import eu.kanade.domain.category.model.Category import eu.kanade.domain.category.model.Category
import eu.kanade.presentation.category.visualName import eu.kanade.presentation.category.visualName
import eu.kanade.presentation.util.horizontalPadding import eu.kanade.presentation.util.padding
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
@Composable @Composable
@ -123,7 +124,7 @@ fun ChangeCategoryDialog(
Text( Text(
text = checkbox.value.visualName, text = checkbox.value.visualName,
modifier = Modifier.padding(horizontal = horizontalPadding), modifier = Modifier.padding(horizontal = MaterialTheme.padding.medium),
) )
} }
} }

View File

@ -8,8 +8,7 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp import eu.kanade.presentation.util.padding
import eu.kanade.presentation.util.horizontalPadding
import eu.kanade.tachiyomi.util.lang.toRelativeString import eu.kanade.tachiyomi.util.lang.toRelativeString
import java.text.DateFormat import java.text.DateFormat
import java.util.Date import java.util.Date
@ -24,7 +23,7 @@ fun RelativeDateHeader(
val context = LocalContext.current val context = LocalContext.current
Text( Text(
modifier = modifier modifier = modifier
.padding(horizontal = horizontalPadding, vertical = 8.dp), .padding(horizontal = MaterialTheme.padding.medium, vertical = MaterialTheme.padding.small),
text = remember { text = remember {
date.toRelativeString( date.toRelativeString(
context, context,

View File

@ -32,8 +32,7 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import eu.kanade.presentation.util.horizontalPadding import eu.kanade.presentation.util.padding
import eu.kanade.presentation.util.verticalPadding
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.util.CrashLogUtil import eu.kanade.tachiyomi.util.CrashLogUtil
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@ -62,8 +61,8 @@ fun CrashScreen(
) )
} }
.padding(WindowInsets.navigationBars.asPaddingValues()) .padding(WindowInsets.navigationBars.asPaddingValues())
.padding(horizontal = horizontalPadding, vertical = verticalPadding), .padding(horizontal = MaterialTheme.padding.medium, vertical = MaterialTheme.padding.small),
verticalArrangement = Arrangement.spacedBy(verticalPadding), verticalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small),
) { ) {
Button( Button(
onClick = { onClick = {
@ -89,7 +88,7 @@ fun CrashScreen(
.verticalScroll(rememberScrollState()) .verticalScroll(rememberScrollState())
.padding(paddingValues) .padding(paddingValues)
.padding(top = 56.dp) .padding(top = 56.dp)
.padding(horizontal = horizontalPadding), .padding(horizontal = MaterialTheme.padding.medium),
horizontalAlignment = Alignment.CenterHorizontally, horizontalAlignment = Alignment.CenterHorizontally,
) { ) {
Icon( Icon(
@ -105,11 +104,11 @@ fun CrashScreen(
Text( Text(
text = stringResource(R.string.crash_screen_description, stringResource(id = R.string.app_name)), text = stringResource(R.string.crash_screen_description, stringResource(id = R.string.app_name)),
modifier = Modifier modifier = Modifier
.padding(vertical = verticalPadding), .padding(vertical = MaterialTheme.padding.small),
) )
Box( Box(
modifier = Modifier modifier = Modifier
.padding(vertical = verticalPadding) .padding(vertical = MaterialTheme.padding.small)
.clip(MaterialTheme.shapes.small) .clip(MaterialTheme.shapes.small)
.fillMaxWidth() .fillMaxWidth()
.background(MaterialTheme.colorScheme.surfaceVariant), .background(MaterialTheme.colorScheme.surfaceVariant),
@ -117,7 +116,7 @@ fun CrashScreen(
Text( Text(
text = exception.toString(), text = exception.toString(),
modifier = Modifier modifier = Modifier
.padding(all = verticalPadding), .padding(all = MaterialTheme.padding.small),
color = MaterialTheme.colorScheme.onSurfaceVariant, color = MaterialTheme.colorScheme.onSurfaceVariant,
) )
} }

View File

@ -22,7 +22,7 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import eu.kanade.domain.history.model.HistoryWithRelations import eu.kanade.domain.history.model.HistoryWithRelations
import eu.kanade.presentation.components.MangaCover import eu.kanade.presentation.components.MangaCover
import eu.kanade.presentation.util.horizontalPadding import eu.kanade.presentation.util.padding
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.util.lang.toTimestampString import eu.kanade.tachiyomi.util.lang.toTimestampString
import java.text.DecimalFormat import java.text.DecimalFormat
@ -42,7 +42,7 @@ fun HistoryItem(
modifier = modifier modifier = modifier
.clickable(onClick = onClickResume) .clickable(onClick = onClickResume)
.height(HISTORY_ITEM_HEIGHT) .height(HISTORY_ITEM_HEIGHT)
.padding(horizontal = horizontalPadding, vertical = 8.dp), .padding(horizontal = MaterialTheme.padding.medium, vertical = MaterialTheme.padding.small),
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
) { ) {
MangaCover.Book( MangaCover.Book(
@ -53,7 +53,7 @@ fun HistoryItem(
Column( Column(
modifier = Modifier modifier = Modifier
.weight(1f) .weight(1f)
.padding(start = horizontalPadding, end = 8.dp), .padding(start = MaterialTheme.padding.medium, end = MaterialTheme.padding.small),
) { ) {
val textStyle = MaterialTheme.typography.bodyMedium val textStyle = MaterialTheme.typography.bodyMedium
Text( Text(

View File

@ -16,7 +16,7 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import eu.kanade.domain.manga.model.Manga import eu.kanade.domain.manga.model.Manga
import eu.kanade.presentation.components.MangaCover import eu.kanade.presentation.components.MangaCover
import eu.kanade.presentation.util.horizontalPadding import eu.kanade.presentation.util.padding
@Composable @Composable
fun BaseMangaListItem( fun BaseMangaListItem(
@ -32,7 +32,7 @@ fun BaseMangaListItem(
modifier = modifier modifier = modifier
.clickable(onClick = onClickItem) .clickable(onClick = onClickItem)
.height(56.dp) .height(56.dp)
.padding(horizontal = horizontalPadding), .padding(horizontal = MaterialTheme.padding.medium),
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
) { ) {
cover() cover()
@ -44,7 +44,7 @@ fun BaseMangaListItem(
private val defaultCover: @Composable RowScope.(Manga, () -> Unit) -> Unit = { manga, onClick -> private val defaultCover: @Composable RowScope.(Manga, () -> Unit) -> Unit = { manga, onClick ->
MangaCover.Square( MangaCover.Square(
modifier = Modifier modifier = Modifier
.padding(vertical = 8.dp) .padding(vertical = MaterialTheme.padding.small)
.fillMaxHeight(), .fillMaxHeight(),
data = manga, data = manga,
onClick = onClick, onClick = onClick,
@ -56,7 +56,7 @@ private val defaultContent: @Composable RowScope.(Manga) -> Unit = {
Text( Text(
text = it.title, text = it.title,
modifier = Modifier modifier = Modifier
.padding(start = horizontalPadding), .padding(start = MaterialTheme.padding.medium),
overflow = TextOverflow.Ellipsis, overflow = TextOverflow.Ellipsis,
maxLines = 1, maxLines = 1,
style = MaterialTheme.typography.bodyMedium, style = MaterialTheme.typography.bodyMedium,

View File

@ -40,7 +40,7 @@ import eu.kanade.presentation.components.ChapterDownloadIndicator
import eu.kanade.presentation.components.MangaCover import eu.kanade.presentation.components.MangaCover
import eu.kanade.presentation.components.RelativeDateHeader import eu.kanade.presentation.components.RelativeDateHeader
import eu.kanade.presentation.util.ReadItemAlpha import eu.kanade.presentation.util.ReadItemAlpha
import eu.kanade.presentation.util.horizontalPadding import eu.kanade.presentation.util.padding
import eu.kanade.presentation.util.selectedBackground import eu.kanade.presentation.util.selectedBackground
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.download.model.Download import eu.kanade.tachiyomi.data.download.model.Download
@ -65,7 +65,7 @@ fun LazyListScope.updatesLastUpdatedItem(
Box( Box(
modifier = Modifier modifier = Modifier
.animateItemPlacement() .animateItemPlacement()
.padding(horizontal = horizontalPadding, vertical = 8.dp), .padding(horizontal = MaterialTheme.padding.medium, vertical = MaterialTheme.padding.small),
) { ) {
Text( Text(
text = if (time.isNullOrEmpty()) { text = if (time.isNullOrEmpty()) {
@ -169,7 +169,7 @@ fun UpdatesUiItem(
}, },
) )
.height(56.dp) .height(56.dp)
.padding(horizontal = horizontalPadding), .padding(horizontal = MaterialTheme.padding.medium),
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
) { ) {
MangaCover.Square( MangaCover.Square(
@ -181,7 +181,7 @@ fun UpdatesUiItem(
) )
Column( Column(
modifier = Modifier modifier = Modifier
.padding(horizontal = horizontalPadding) .padding(horizontal = MaterialTheme.padding.medium)
.weight(1f), .weight(1f),
) { ) {
val bookmark = remember(update.bookmark) { update.bookmark } val bookmark = remember(update.bookmark) { update.bookmark }

View File

@ -1,15 +1,24 @@
package eu.kanade.presentation.util package eu.kanade.presentation.util
import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.material3.MaterialTheme
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
private val horizontal = 16.dp val topSmallPaddingValues = PaddingValues(top = MaterialTheme.padding.small)
private val vertical = 8.dp
val horizontalPadding = horizontal
val verticalPadding = vertical
val topPaddingValues = PaddingValues(top = vertical)
const val ReadItemAlpha = .38f const val ReadItemAlpha = .38f
const val SecondaryItemAlpha = .78f const val SecondaryItemAlpha = .78f
class Padding {
val extraLarge = 32.dp
val large = 24.dp
val medium = 16.dp
val small = 8.dp
}
val MaterialTheme.padding: Padding
get() = Padding()