Browse Source

Minor cleanup/address lint warnings

arkon 1 year ago
parent
commit
6bb77bcf1a
30 changed files with 91 additions and 63 deletions
  1. 1 1
      app/src/main/java/eu/kanade/presentation/browse/ExtensionDetailsScreen.kt
  2. 2 2
      app/src/main/java/eu/kanade/presentation/browse/ExtensionsScreen.kt
  3. 1 1
      app/src/main/java/eu/kanade/presentation/browse/components/GlobalSearchCardRow.kt
  4. 1 1
      app/src/main/java/eu/kanade/presentation/browse/components/GlobalSearchResultItems.kt
  5. 3 2
      app/src/main/java/eu/kanade/presentation/history/components/HistoryDialogs.kt
  6. 3 2
      app/src/main/java/eu/kanade/presentation/manga/DuplicateMangaDialog.kt
  7. 1 1
      app/src/main/java/eu/kanade/presentation/manga/components/BaseMangaListItem.kt
  8. 4 2
      app/src/main/java/eu/kanade/presentation/manga/components/ChapterHeader.kt
  9. 15 4
      app/src/main/java/eu/kanade/presentation/manga/components/DotSeparatorText.kt
  10. 1 1
      app/src/main/java/eu/kanade/presentation/manga/components/MangaBottomActionMenu.kt
  11. 1 1
      app/src/main/java/eu/kanade/presentation/manga/components/MangaCover.kt
  12. 6 5
      app/src/main/java/eu/kanade/presentation/manga/components/MangaInfoHeader.kt
  13. 1 1
      app/src/main/java/eu/kanade/presentation/more/NewUpdateScreen.kt
  14. 2 1
      app/src/main/java/eu/kanade/presentation/more/onboarding/GuidesStep.kt
  15. 3 1
      app/src/main/java/eu/kanade/presentation/more/onboarding/StorageStep.kt
  16. 1 1
      app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsTrackingScreen.kt
  17. 2 0
      app/src/main/java/eu/kanade/presentation/more/settings/screen/data/CreateBackupScreen.kt
  18. 3 2
      app/src/main/java/eu/kanade/presentation/more/settings/screen/data/StorageInfo.kt
  19. 10 12
      app/src/main/java/eu/kanade/presentation/more/stats/StatsScreenContent.kt
  20. 2 1
      app/src/main/java/eu/kanade/presentation/reader/appbars/ReaderAppBars.kt
  21. 3 1
      app/src/main/java/eu/kanade/presentation/reader/components/ModeSelectionDialog.kt
  22. 1 1
      app/src/main/java/eu/kanade/presentation/track/TrackerSearch.kt
  23. 2 2
      app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateDialog.kt
  24. 1 2
      app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackInfoDialog.kt
  25. 3 2
      presentation-core/src/main/java/tachiyomi/presentation/core/components/ActionButton.kt
  26. 2 1
      presentation-core/src/main/java/tachiyomi/presentation/core/components/LabeledCheckbox.kt
  27. 12 8
      presentation-core/src/main/java/tachiyomi/presentation/core/components/SectionCard.kt
  28. 1 1
      presentation-core/src/main/java/tachiyomi/presentation/core/components/SettingsItems.kt
  29. 1 1
      presentation-core/src/main/java/tachiyomi/presentation/core/components/material/Constants.kt
  30. 2 2
      presentation-core/src/main/java/tachiyomi/presentation/core/components/material/NavigationRail.kt

+ 1 - 1
app/src/main/java/eu/kanade/presentation/browse/ExtensionDetailsScreen.kt

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

+ 2 - 2
app/src/main/java/eu/kanade/presentation/browse/ExtensionsScreen.kt

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

+ 1 - 1
app/src/main/java/eu/kanade/presentation/browse/components/GlobalSearchCardRow.kt

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

+ 1 - 1
app/src/main/java/eu/kanade/presentation/browse/components/GlobalSearchResultItems.kt

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

+ 3 - 2
app/src/main/java/eu/kanade/presentation/history/components/HistoryDialogs.kt

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

+ 3 - 2
app/src/main/java/eu/kanade/presentation/manga/DuplicateMangaDialog.kt

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

+ 1 - 1
app/src/main/java/eu/kanade/presentation/manga/components/BaseMangaListItem.kt

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

+ 4 - 2
app/src/main/java/eu/kanade/presentation/manga/components/ChapterHeader.kt

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

+ 15 - 4
app/src/main/java/eu/kanade/presentation/manga/components/DotSeparatorText.kt

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

+ 1 - 1
app/src/main/java/eu/kanade/presentation/manga/components/MangaBottomActionMenu.kt

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

+ 1 - 1
app/src/main/java/eu/kanade/presentation/manga/components/MangaCover.kt

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

+ 6 - 5
app/src/main/java/eu/kanade/presentation/manga/components/MangaInfoHeader.kt

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

+ 1 - 1
app/src/main/java/eu/kanade/presentation/more/NewUpdateScreen.kt

@@ -59,7 +59,7 @@ fun NewUpdateScreen(
                 modifier = Modifier.padding(top = MaterialTheme.padding.small),
             ) {
                 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)
             }
         }

+ 2 - 1
app/src/main/java/eu/kanade/presentation/more/onboarding/GuidesStep.kt

@@ -15,6 +15,7 @@ import androidx.compose.ui.tooling.preview.PreviewLightDark
 import androidx.compose.ui.unit.dp
 import eu.kanade.presentation.theme.TachiyomiTheme
 import tachiyomi.i18n.MR
+import tachiyomi.presentation.core.components.material.padding
 import tachiyomi.presentation.core.i18n.stringResource
 
 internal class GuidesStep(
@@ -29,7 +30,7 @@ internal class GuidesStep(
 
         Column(
             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)))
             Button(

+ 3 - 1
app/src/main/java/eu/kanade/presentation/more/onboarding/StorageStep.kt

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

+ 1 - 1
app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsTrackingScreen.kt

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

+ 2 - 0
app/src/main/java/eu/kanade/presentation/more/settings/screen/data/CreateBackupScreen.kt

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

+ 3 - 2
app/src/main/java/eu/kanade/presentation/more/settings/screen/data/StorageInfo.kt

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

+ 10 - 12
app/src/main/java/eu/kanade/presentation/more/stats/StatsScreenContent.kt

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

+ 2 - 1
app/src/main/java/eu/kanade/presentation/reader/appbars/ReaderAppBars.kt

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

+ 3 - 1
app/src/main/java/eu/kanade/presentation/reader/components/ModeSelectionDialog.kt

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

+ 1 - 1
app/src/main/java/eu/kanade/presentation/track/TrackerSearch.kt

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

+ 2 - 2
app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateDialog.kt

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

+ 1 - 2
app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackInfoDialog.kt

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

+ 3 - 2
presentation-core/src/main/java/tachiyomi/presentation/core/components/ActionButton.kt

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

+ 2 - 1
presentation-core/src/main/java/tachiyomi/presentation/core/components/LabeledCheckbox.kt

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

+ 12 - 8
app/src/main/java/eu/kanade/presentation/more/stats/components/StatsSection.kt → presentation-core/src/main/java/tachiyomi/presentation/core/components/SectionCard.kt

@@ -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.fillMaxWidth
 import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.lazy.LazyItemScope
 import androidx.compose.material3.ElevatedCard
 import androidx.compose.material3.MaterialTheme
 import androidx.compose.material3.Text
@@ -13,15 +14,18 @@ import tachiyomi.presentation.core.components.material.padding
 import tachiyomi.presentation.core.i18n.stringResource
 
 @Composable
-fun StatsSection(
-    titleRes: StringResource,
+fun LazyItemScope.SectionCard(
+    titleRes: StringResource? = null,
     content: @Composable () -> Unit,
 ) {
-    Text(
-        modifier = Modifier.padding(horizontal = MaterialTheme.padding.extraLarge),
-        text = stringResource(titleRes),
-        style = MaterialTheme.typography.titleSmall,
-    )
+    if (titleRes != null) {
+        Text(
+            modifier = Modifier.padding(horizontal = MaterialTheme.padding.extraLarge),
+            text = stringResource(titleRes),
+            style = MaterialTheme.typography.titleSmall,
+        )
+    }
+
     ElevatedCard(
         modifier = Modifier
             .fillMaxWidth()

+ 1 - 1
presentation-core/src/main/java/tachiyomi/presentation/core/components/SettingsItems.kt

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

+ 1 - 1
presentation-core/src/main/java/tachiyomi/presentation/core/components/material/Constants.kt

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

+ 2 - 2
presentation-core/src/main/java/tachiyomi/presentation/core/components/material/NavigationRail.kt

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