Minor cleanup/address lint warnings

This commit is contained in:
arkon 2023-12-30 10:30:32 -05:00
parent ccec5c3efe
commit 6bb77bcf1a
30 changed files with 91 additions and 63 deletions

View File

@ -295,7 +295,7 @@ private fun DetailsHeader(
top = MaterialTheme.padding.small, top = MaterialTheme.padding.small,
bottom = MaterialTheme.padding.medium, bottom = MaterialTheme.padding.medium,
), ),
horizontalArrangement = Arrangement.spacedBy(16.dp), horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.medium),
) { ) {
OutlinedButton( OutlinedButton(
modifier = Modifier.weight(1f), modifier = Modifier.weight(1f),

View File

@ -319,7 +319,7 @@ private fun ExtensionItemContent(
// Won't look good but it's not like we can ellipsize overflowing content // Won't look good but it's not like we can ellipsize overflowing content
FlowRow( FlowRow(
modifier = Modifier.secondaryItemAlpha(), modifier = Modifier.secondaryItemAlpha(),
horizontalArrangement = Arrangement.spacedBy(4.dp), horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.extraSmall),
) { ) {
ProvideTextStyle(value = MaterialTheme.typography.bodySmall) { ProvideTextStyle(value = MaterialTheme.typography.bodySmall) {
if (extension is Extension.Installed && extension.lang.isNotEmpty()) { if (extension is Extension.Installed && extension.lang.isNotEmpty()) {
@ -379,7 +379,7 @@ private fun ExtensionItemActions(
Row( Row(
modifier = modifier, modifier = modifier,
horizontalArrangement = Arrangement.spacedBy(8.dp), horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small),
) { ) {
when { when {
!isIdle -> { !isIdle -> {

View File

@ -37,7 +37,7 @@ fun GlobalSearchCardRow(
LazyRow( LazyRow(
contentPadding = PaddingValues(MaterialTheme.padding.small), contentPadding = PaddingValues(MaterialTheme.padding.small),
horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.tiny), horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.extraSmall),
) { ) {
items(titles) { items(titles) {
val title by getManga(it) val title by getManga(it)

View File

@ -39,7 +39,7 @@ fun GlobalSearchResultItem(
modifier = Modifier modifier = Modifier
.padding( .padding(
start = MaterialTheme.padding.medium, start = MaterialTheme.padding.medium,
end = MaterialTheme.padding.tiny, end = MaterialTheme.padding.extraSmall,
) )
.fillMaxWidth() .fillMaxWidth()
.clickable(onClick = onClick), .clickable(onClick = onClick),

View File

@ -3,6 +3,7 @@ package eu.kanade.presentation.history.components
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.material3.AlertDialog import androidx.compose.material3.AlertDialog
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.TextButton import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
@ -11,10 +12,10 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.tooling.preview.PreviewLightDark import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.dp
import eu.kanade.presentation.theme.TachiyomiTheme import eu.kanade.presentation.theme.TachiyomiTheme
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.LabeledCheckbox import tachiyomi.presentation.core.components.LabeledCheckbox
import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.i18n.stringResource import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
@ -30,7 +31,7 @@ fun HistoryDeleteDialog(
}, },
text = { text = {
Column( Column(
verticalArrangement = Arrangement.spacedBy(8.dp), verticalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small),
) { ) {
Text(text = stringResource(MR.strings.dialog_with_checkbox_remove_description)) Text(text = stringResource(MR.strings.dialog_with_checkbox_remove_description))

View File

@ -4,12 +4,13 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.FlowRow import androidx.compose.foundation.layout.FlowRow
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.Spacer
import androidx.compose.material3.AlertDialog import androidx.compose.material3.AlertDialog
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.TextButton import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.i18n.stringResource import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
@ -28,7 +29,7 @@ fun DuplicateMangaDialog(
}, },
confirmButton = { confirmButton = {
FlowRow( FlowRow(
horizontalArrangement = Arrangement.spacedBy(4.dp), horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.extraSmall),
) { ) {
TextButton( TextButton(
onClick = { onClick = {

View File

@ -19,8 +19,8 @@ import tachiyomi.presentation.core.components.material.padding
@Composable @Composable
fun BaseMangaListItem( fun BaseMangaListItem(
modifier: Modifier = Modifier,
manga: Manga, manga: Manga,
modifier: Modifier = Modifier,
onClickItem: () -> Unit = {}, onClickItem: () -> Unit = {},
onClickCover: () -> Unit = onClickItem, onClickCover: () -> Unit = onClickItem,
cover: @Composable RowScope.() -> Unit = { defaultCover(manga, onClickCover) }, cover: @Composable RowScope.() -> Unit = { defaultCover(manga, onClickCover) },

View File

@ -13,6 +13,7 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.material.SecondaryItemAlpha import tachiyomi.presentation.core.components.material.SecondaryItemAlpha
import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.i18n.pluralStringResource import tachiyomi.presentation.core.i18n.pluralStringResource
import tachiyomi.presentation.core.i18n.stringResource import tachiyomi.presentation.core.i18n.stringResource
@ -22,16 +23,17 @@ fun ChapterHeader(
chapterCount: Int?, chapterCount: Int?,
missingChapterCount: Int, missingChapterCount: Int,
onClick: () -> Unit, onClick: () -> Unit,
modifier: Modifier = Modifier,
) { ) {
Column( Column(
modifier = Modifier modifier = modifier
.fillMaxWidth() .fillMaxWidth()
.clickable( .clickable(
enabled = enabled, enabled = enabled,
onClick = onClick, onClick = onClick,
) )
.padding(horizontal = 16.dp, vertical = 4.dp), .padding(horizontal = 16.dp, vertical = 4.dp),
verticalArrangement = Arrangement.spacedBy(4.dp), verticalArrangement = Arrangement.spacedBy(MaterialTheme.padding.extraSmall),
) { ) {
Text( Text(
text = if (chapterCount == null) { text = if (chapterCount == null) {

View File

@ -2,13 +2,24 @@ package eu.kanade.presentation.manga.components
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
@Composable @Composable
fun DotSeparatorText() { fun DotSeparatorText(
Text(text = "") modifier: Modifier = Modifier,
) {
Text(
text = "",
modifier = modifier,
)
} }
@Composable @Composable
fun DotSeparatorNoSpaceText() { fun DotSeparatorNoSpaceText(
Text(text = "") modifier: Modifier = Modifier,
) {
Text(
text = "",
modifier = modifier,
)
} }

View File

@ -222,12 +222,12 @@ private fun RowScope.Button(
@Composable @Composable
fun LibraryBottomActionMenu( fun LibraryBottomActionMenu(
visible: Boolean, visible: Boolean,
modifier: Modifier = Modifier,
onChangeCategoryClicked: () -> Unit, onChangeCategoryClicked: () -> Unit,
onMarkAsReadClicked: () -> Unit, onMarkAsReadClicked: () -> Unit,
onMarkAsUnreadClicked: () -> Unit, onMarkAsUnreadClicked: () -> Unit,
onDownloadClicked: ((DownloadAction) -> Unit)?, onDownloadClicked: ((DownloadAction) -> Unit)?,
onDeleteClicked: () -> Unit, onDeleteClicked: () -> Unit,
modifier: Modifier = Modifier,
) { ) {
AnimatedVisibility( AnimatedVisibility(
visible = visible, visible = visible,

View File

@ -22,8 +22,8 @@ enum class MangaCover(val ratio: Float) {
@Composable @Composable
operator fun invoke( operator fun invoke(
modifier: Modifier = Modifier,
data: Any?, data: Any?,
modifier: Modifier = Modifier,
contentDescription: String = "", contentDescription: String = "",
shape: Shape = MaterialTheme.shapes.extraSmall, shape: Shape = MaterialTheme.shapes.extraSmall,
onClick: (() -> Unit)? = null, onClick: (() -> Unit)? = null,

View File

@ -9,6 +9,7 @@ import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.FlowRow import androidx.compose.foundation.layout.FlowRow
import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Row
@ -283,7 +284,7 @@ fun ExpandableMangaDescription(
if (expanded) { if (expanded) {
FlowRow( FlowRow(
modifier = Modifier.padding(horizontal = 16.dp), modifier = Modifier.padding(horizontal = 16.dp),
horizontalArrangement = Arrangement.spacedBy(4.dp), horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.extraSmall),
) { ) {
tags.forEach { tags.forEach {
TagsChip( TagsChip(
@ -299,7 +300,7 @@ fun ExpandableMangaDescription(
} else { } else {
LazyRow( LazyRow(
contentPadding = PaddingValues(horizontal = MaterialTheme.padding.medium), contentPadding = PaddingValues(horizontal = MaterialTheme.padding.medium),
horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.tiny), horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.extraSmall),
) { ) {
items(items = tags) { items(items = tags) {
TagsChip( TagsChip(
@ -402,7 +403,7 @@ private fun MangaAndSourceTitlesSmall(
} }
@Composable @Composable
private fun MangaContentInfo( private fun ColumnScope.MangaContentInfo(
title: String, title: String,
doSearch: (query: String, global: Boolean) -> Unit, doSearch: (query: String, global: Boolean) -> Unit,
author: String?, author: String?,
@ -434,7 +435,7 @@ private fun MangaContentInfo(
Row( Row(
modifier = Modifier.secondaryItemAlpha(), modifier = Modifier.secondaryItemAlpha(),
horizontalArrangement = Arrangement.spacedBy(4.dp), horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.extraSmall),
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
) { ) {
Icon( Icon(
@ -465,7 +466,7 @@ private fun MangaContentInfo(
if (!artist.isNullOrBlank() && author != artist) { if (!artist.isNullOrBlank() && author != artist) {
Row( Row(
modifier = Modifier.secondaryItemAlpha(), modifier = Modifier.secondaryItemAlpha(),
horizontalArrangement = Arrangement.spacedBy(4.dp), horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.extraSmall),
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
) { ) {
Icon( Icon(

View File

@ -59,7 +59,7 @@ fun NewUpdateScreen(
modifier = Modifier.padding(top = MaterialTheme.padding.small), modifier = Modifier.padding(top = MaterialTheme.padding.small),
) { ) {
Text(text = stringResource(MR.strings.update_check_open)) Text(text = stringResource(MR.strings.update_check_open))
Spacer(modifier = Modifier.width(MaterialTheme.padding.tiny)) Spacer(modifier = Modifier.width(MaterialTheme.padding.extraSmall))
Icon(imageVector = Icons.AutoMirrored.Outlined.OpenInNew, contentDescription = null) Icon(imageVector = Icons.AutoMirrored.Outlined.OpenInNew, contentDescription = null)
} }
} }

View File

@ -15,6 +15,7 @@ import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import eu.kanade.presentation.theme.TachiyomiTheme import eu.kanade.presentation.theme.TachiyomiTheme
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.i18n.stringResource import tachiyomi.presentation.core.i18n.stringResource
internal class GuidesStep( internal class GuidesStep(
@ -29,7 +30,7 @@ internal class GuidesStep(
Column( Column(
modifier = Modifier.padding(16.dp), modifier = Modifier.padding(16.dp),
verticalArrangement = Arrangement.spacedBy(8.dp), verticalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small),
) { ) {
Text(stringResource(MR.strings.onboarding_guides_new_user, stringResource(MR.strings.app_name))) Text(stringResource(MR.strings.onboarding_guides_new_user, stringResource(MR.strings.app_name)))
Button( Button(

View File

@ -5,6 +5,7 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
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.runtime.LaunchedEffect import androidx.compose.runtime.LaunchedEffect
@ -20,6 +21,7 @@ import kotlinx.coroutines.flow.collectLatest
import tachiyomi.domain.storage.service.StoragePreferences import tachiyomi.domain.storage.service.StoragePreferences
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.material.Button import tachiyomi.presentation.core.components.material.Button
import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.i18n.stringResource import tachiyomi.presentation.core.i18n.stringResource
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
@ -40,7 +42,7 @@ internal class StorageStep : OnboardingStep {
Column( Column(
modifier = Modifier.padding(16.dp), modifier = Modifier.padding(16.dp),
verticalArrangement = Arrangement.spacedBy(8.dp), verticalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small),
) { ) {
Text( Text(
stringResource( stringResource(

View File

@ -317,7 +317,7 @@ object SettingsTrackingScreen : SearchableSettings {
) )
}, },
confirmButton = { confirmButton = {
Row(horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.tiny)) { Row(horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.extraSmall)) {
OutlinedButton( OutlinedButton(
modifier = Modifier.weight(1f), modifier = Modifier.weight(1f),
onClick = onDismissRequest, onClick = onDismissRequest,

View File

@ -87,6 +87,8 @@ class CreateBackupScreen : Screen() {
} }
} }
// TODO: separate sections for library and settings
item { item {
LabeledCheckbox( LabeledCheckbox(
label = stringResource(MR.strings.manga), label = stringResource(MR.strings.manga),

View File

@ -16,6 +16,7 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import eu.kanade.tachiyomi.util.storage.DiskUtil import eu.kanade.tachiyomi.util.storage.DiskUtil
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.i18n.stringResource import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.theme.header import tachiyomi.presentation.core.theme.header
import tachiyomi.presentation.core.util.secondaryItemAlpha import tachiyomi.presentation.core.util.secondaryItemAlpha
@ -30,7 +31,7 @@ fun StorageInfo(
Column( Column(
modifier = modifier, modifier = modifier,
verticalArrangement = Arrangement.spacedBy(8.dp), verticalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small),
) { ) {
storages.forEach { storages.forEach {
StorageInfo(it) StorageInfo(it)
@ -50,7 +51,7 @@ private fun StorageInfo(
val totalText = remember(total) { Formatter.formatFileSize(context, total) } val totalText = remember(total) { Formatter.formatFileSize(context, total) }
Column( Column(
verticalArrangement = Arrangement.spacedBy(4.dp), verticalArrangement = Arrangement.spacedBy(MaterialTheme.padding.extraSmall),
) { ) {
Text( Text(
text = file.absolutePath, text = file.absolutePath,

View File

@ -6,7 +6,7 @@ import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.height
import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.foundation.lazy.LazyItemScope
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.CollectionsBookmark import androidx.compose.material.icons.outlined.CollectionsBookmark
import androidx.compose.material.icons.outlined.LocalLibrary import androidx.compose.material.icons.outlined.LocalLibrary
@ -18,10 +18,10 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import eu.kanade.presentation.more.stats.components.StatsItem import eu.kanade.presentation.more.stats.components.StatsItem
import eu.kanade.presentation.more.stats.components.StatsOverviewItem import eu.kanade.presentation.more.stats.components.StatsOverviewItem
import eu.kanade.presentation.more.stats.components.StatsSection
import eu.kanade.presentation.more.stats.data.StatsData import eu.kanade.presentation.more.stats.data.StatsData
import eu.kanade.presentation.util.toDurationString import eu.kanade.presentation.util.toDurationString
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.SectionCard
import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.i18n.stringResource import tachiyomi.presentation.core.i18n.stringResource
import java.util.Locale import java.util.Locale
@ -33,9 +33,7 @@ fun StatsScreenContent(
state: StatsScreenState.Success, state: StatsScreenState.Success,
paddingValues: PaddingValues, paddingValues: PaddingValues,
) { ) {
val statListState = rememberLazyListState()
LazyColumn( LazyColumn(
state = statListState,
contentPadding = paddingValues, contentPadding = paddingValues,
verticalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small), verticalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small),
) { ) {
@ -55,7 +53,7 @@ fun StatsScreenContent(
} }
@Composable @Composable
private fun OverviewSection( private fun LazyItemScope.OverviewSection(
data: StatsData.Overview, data: StatsData.Overview,
) { ) {
val none = stringResource(MR.strings.none) val none = stringResource(MR.strings.none)
@ -65,7 +63,7 @@ private fun OverviewSection(
.toDuration(DurationUnit.MILLISECONDS) .toDuration(DurationUnit.MILLISECONDS)
.toDurationString(context, fallback = none) .toDurationString(context, fallback = none)
} }
StatsSection(MR.strings.label_overview_section) { SectionCard(MR.strings.label_overview_section) {
Row( Row(
modifier = Modifier.height(IntrinsicSize.Min), modifier = Modifier.height(IntrinsicSize.Min),
) { ) {
@ -89,10 +87,10 @@ private fun OverviewSection(
} }
@Composable @Composable
private fun TitlesStats( private fun LazyItemScope.TitlesStats(
data: StatsData.Titles, data: StatsData.Titles,
) { ) {
StatsSection(MR.strings.label_titles_section) { SectionCard(MR.strings.label_titles_section) {
Row { Row {
StatsItem( StatsItem(
data.globalUpdateItemCount.toString(), data.globalUpdateItemCount.toString(),
@ -111,10 +109,10 @@ private fun TitlesStats(
} }
@Composable @Composable
private fun ChapterStats( private fun LazyItemScope.ChapterStats(
data: StatsData.Chapters, data: StatsData.Chapters,
) { ) {
StatsSection(MR.strings.chapters) { SectionCard(MR.strings.chapters) {
Row { Row {
StatsItem( StatsItem(
data.totalChapterCount.toString(), data.totalChapterCount.toString(),
@ -133,7 +131,7 @@ private fun ChapterStats(
} }
@Composable @Composable
private fun TrackerStats( private fun LazyItemScope.TrackerStats(
data: StatsData.Trackers, data: StatsData.Trackers,
) { ) {
val notApplicable = stringResource(MR.strings.not_applicable) val notApplicable = stringResource(MR.strings.not_applicable)
@ -145,7 +143,7 @@ private fun TrackerStats(
notApplicable notApplicable
} }
} }
StatsSection(MR.strings.label_tracker_section) { SectionCard(MR.strings.label_tracker_section) {
Row { Row {
StatsItem( StatsItem(
data.trackedTitleCount.toString(), data.trackedTitleCount.toString(),

View File

@ -29,6 +29,7 @@ import eu.kanade.tachiyomi.ui.reader.viewer.Viewer
import eu.kanade.tachiyomi.ui.reader.viewer.pager.R2LPagerViewer import eu.kanade.tachiyomi.ui.reader.viewer.pager.R2LPagerViewer
import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.persistentListOf
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.i18n.stringResource import tachiyomi.presentation.core.i18n.stringResource
private val animationSpec = tween<IntOffset>(200) private val animationSpec = tween<IntOffset>(200)
@ -156,7 +157,7 @@ fun ReaderAppBars(
) { ) {
Column( Column(
modifier = modifierWithInsetsPadding, modifier = modifierWithInsetsPadding,
verticalArrangement = Arrangement.spacedBy(8.dp), verticalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small),
) { ) {
ChapterNavigator( ChapterNavigator(
isRtl = isRtl, isRtl = isRtl,

View File

@ -10,6 +10,7 @@ import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Check import androidx.compose.material.icons.outlined.Check
import androidx.compose.material3.FilledTonalButton import androidx.compose.material3.FilledTonalButton
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedButton import androidx.compose.material3.OutlinedButton
import androidx.compose.material3.Surface import androidx.compose.material3.Surface
import androidx.compose.material3.Text import androidx.compose.material3.Text
@ -21,6 +22,7 @@ import androidx.compose.ui.unit.dp
import eu.kanade.presentation.theme.TachiyomiTheme import eu.kanade.presentation.theme.TachiyomiTheme
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.SettingsItemsPaddings import tachiyomi.presentation.core.components.SettingsItemsPaddings
import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.i18n.stringResource import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
@ -50,7 +52,7 @@ fun ModeSelectionDialog(
onClick = onApply, onClick = onApply,
) { ) {
Row( Row(
horizontalArrangement = Arrangement.spacedBy(8.dp), horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small),
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
) { ) {
Icon( Icon(

View File

@ -309,7 +309,7 @@ private fun SearchResultItemDetails(
title: String, title: String,
text: String, text: String,
) { ) {
Row(horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.tiny)) { Row(horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.extraSmall)) {
Text( Text(
text = title, text = title,
maxLines = 1, maxLines = 1,

View File

@ -19,7 +19,6 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.toMutableStateList import androidx.compose.runtime.toMutableStateList
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import cafe.adriel.voyager.core.model.StateScreenModel import cafe.adriel.voyager.core.model.StateScreenModel
import eu.kanade.domain.chapter.interactor.SyncChaptersWithSource import eu.kanade.domain.chapter.interactor.SyncChaptersWithSource
import eu.kanade.domain.manga.interactor.UpdateManga import eu.kanade.domain.manga.interactor.UpdateManga
@ -49,6 +48,7 @@ import tachiyomi.domain.track.interactor.GetTracks
import tachiyomi.domain.track.interactor.InsertTrack import tachiyomi.domain.track.interactor.InsertTrack
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.LabeledCheckbox import tachiyomi.presentation.core.components.LabeledCheckbox
import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.i18n.stringResource import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.screens.LoadingScreen import tachiyomi.presentation.core.screens.LoadingScreen
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
@ -96,7 +96,7 @@ internal fun MigrateDialog(
}, },
confirmButton = { confirmButton = {
FlowRow( FlowRow(
horizontalArrangement = Arrangement.spacedBy(4.dp), horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.extraSmall),
) { ) {
TextButton( TextButton(
onClick = { onClick = {

View File

@ -30,7 +30,6 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.input.TextFieldValue import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import cafe.adriel.voyager.core.model.ScreenModel import cafe.adriel.voyager.core.model.ScreenModel
import cafe.adriel.voyager.core.model.StateScreenModel import cafe.adriel.voyager.core.model.StateScreenModel
import cafe.adriel.voyager.core.model.rememberScreenModel import cafe.adriel.voyager.core.model.rememberScreenModel
@ -759,7 +758,7 @@ private data class TrackerRemoveScreen(
}, },
text = { text = {
Column( Column(
verticalArrangement = Arrangement.spacedBy(8.dp), verticalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small),
) { ) {
Text( Text(
text = stringResource(MR.strings.track_delete_text, serviceName), text = stringResource(MR.strings.track_delete_text, serviceName),

View File

@ -3,6 +3,7 @@ package tachiyomi.presentation.core.components
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.TextButton import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
@ -10,7 +11,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp import tachiyomi.presentation.core.components.material.padding
@Composable @Composable
fun ActionButton( fun ActionButton(
@ -24,7 +25,7 @@ fun ActionButton(
onClick = onClick, onClick = onClick,
) { ) {
Column( Column(
verticalArrangement = Arrangement.spacedBy(4.dp), verticalArrangement = Arrangement.spacedBy(MaterialTheme.padding.extraSmall),
horizontalAlignment = Alignment.CenterHorizontally, horizontalAlignment = Alignment.CenterHorizontally,
) { ) {
Icon( Icon(

View File

@ -14,6 +14,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.clip
import androidx.compose.ui.semantics.Role import androidx.compose.ui.semantics.Role
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import tachiyomi.presentation.core.components.material.padding
@Composable @Composable
fun LabeledCheckbox( fun LabeledCheckbox(
@ -33,7 +34,7 @@ fun LabeledCheckbox(
onClick = { onCheckedChange(!checked) }, onClick = { onCheckedChange(!checked) },
), ),
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(8.dp), horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small),
) { ) {
Checkbox( Checkbox(
checked = checked, checked = checked,

View File

@ -1,8 +1,9 @@
package eu.kanade.presentation.more.stats.components package tachiyomi.presentation.core.components
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyItemScope
import androidx.compose.material3.ElevatedCard import androidx.compose.material3.ElevatedCard
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text import androidx.compose.material3.Text
@ -13,15 +14,18 @@ import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.i18n.stringResource import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun StatsSection( fun LazyItemScope.SectionCard(
titleRes: StringResource, titleRes: StringResource? = null,
content: @Composable () -> Unit, content: @Composable () -> Unit,
) { ) {
Text( if (titleRes != null) {
modifier = Modifier.padding(horizontal = MaterialTheme.padding.extraLarge), Text(
text = stringResource(titleRes), modifier = Modifier.padding(horizontal = MaterialTheme.padding.extraLarge),
style = MaterialTheme.typography.titleSmall, text = stringResource(titleRes),
) style = MaterialTheme.typography.titleSmall,
)
}
ElevatedCard( ElevatedCard(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()

View File

@ -345,7 +345,7 @@ fun SettingsIconGrid(labelRes: StringResource, content: LazyGridScope.() -> Unit
end = SettingsItemsPaddings.Horizontal, end = SettingsItemsPaddings.Horizontal,
bottom = SettingsItemsPaddings.Vertical, bottom = SettingsItemsPaddings.Vertical,
), ),
verticalArrangement = Arrangement.spacedBy(MaterialTheme.padding.tiny), verticalArrangement = Arrangement.spacedBy(MaterialTheme.padding.extraSmall),
horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small), horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small),
content = content, content = content,
) )

View File

@ -19,7 +19,7 @@ class Padding {
val small = 8.dp val small = 8.dp
val tiny = 4.dp val extraSmall = 4.dp
} }
val MaterialTheme.padding: Padding val MaterialTheme.padding: Padding

View File

@ -45,11 +45,11 @@ fun NavigationRail(
.fillMaxHeight() .fillMaxHeight()
.windowInsetsPadding(windowInsets) .windowInsetsPadding(windowInsets)
.widthIn(min = 80.dp) .widthIn(min = 80.dp)
.padding(vertical = MaterialTheme.padding.tiny) .padding(vertical = MaterialTheme.padding.extraSmall)
.selectableGroup(), .selectableGroup(),
horizontalAlignment = Alignment.CenterHorizontally, horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy( verticalArrangement = Arrangement.spacedBy(
MaterialTheme.padding.tiny, MaterialTheme.padding.extraSmall,
alignment = Alignment.CenterVertically, alignment = Alignment.CenterVertically,
), ),
) { ) {