diff --git a/app/src/main/java/eu/kanade/presentation/extension/ExtensionScreen.kt b/app/src/main/java/eu/kanade/presentation/extension/ExtensionScreen.kt index 7be37a398e..1eaf5ad808 100644 --- a/app/src/main/java/eu/kanade/presentation/extension/ExtensionScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/extension/ExtensionScreen.kt @@ -41,7 +41,9 @@ import com.google.accompanist.swiperefresh.rememberSwipeRefreshState import eu.kanade.presentation.browse.components.BaseBrowseItem import eu.kanade.presentation.browse.components.ExtensionIcon import eu.kanade.presentation.theme.header +import eu.kanade.presentation.util.topPaddingValues import eu.kanade.presentation.util.horizontalPadding +import eu.kanade.presentation.util.plus import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.extension.model.InstallStep @@ -110,7 +112,7 @@ fun ExtensionContent( ) { val (trustState, setTrustState) = remember { mutableStateOf(null) } LazyColumn( - contentPadding = WindowInsets.navigationBars.asPaddingValues(), + contentPadding = WindowInsets.navigationBars.asPaddingValues() + topPaddingValues, ) { items( items = items, diff --git a/app/src/main/java/eu/kanade/presentation/history/HistoryScreen.kt b/app/src/main/java/eu/kanade/presentation/history/HistoryScreen.kt index 6904cafa50..1bfcecdc25 100644 --- a/app/src/main/java/eu/kanade/presentation/history/HistoryScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/history/HistoryScreen.kt @@ -44,7 +44,9 @@ import eu.kanade.domain.history.model.HistoryWithRelations import eu.kanade.presentation.components.EmptyScreen import eu.kanade.presentation.components.LoadingScreen import eu.kanade.presentation.components.MangaCover +import eu.kanade.presentation.util.topPaddingValues import eu.kanade.presentation.util.horizontalPadding +import eu.kanade.presentation.util.plus import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.ui.recent.history.HistoryPresenter @@ -107,7 +109,7 @@ fun HistoryContent( LazyColumn( modifier = Modifier .nestedScroll(nestedScroll), - contentPadding = WindowInsets.navigationBars.asPaddingValues(), + contentPadding = WindowInsets.navigationBars.asPaddingValues() + topPaddingValues, state = scrollState, ) { items(history) { item -> diff --git a/app/src/main/java/eu/kanade/presentation/source/MigrateSourceScreen.kt b/app/src/main/java/eu/kanade/presentation/source/MigrateSourceScreen.kt index 5394200d32..d85869d16a 100644 --- a/app/src/main/java/eu/kanade/presentation/source/MigrateSourceScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/source/MigrateSourceScreen.kt @@ -22,7 +22,9 @@ import eu.kanade.presentation.components.ItemBadges import eu.kanade.presentation.components.LoadingScreen import eu.kanade.presentation.source.components.BaseSourceItem import eu.kanade.presentation.theme.header +import eu.kanade.presentation.util.topPaddingValues import eu.kanade.presentation.util.horizontalPadding +import eu.kanade.presentation.util.plus import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.ui.browse.migration.sources.MigrateSourceState import eu.kanade.tachiyomi.ui.browse.migration.sources.MigrationSourcesPresenter @@ -62,7 +64,7 @@ fun MigrateSourceList( LazyColumn( modifier = Modifier.nestedScroll(nestedScrollInterop), - contentPadding = WindowInsets.navigationBars.asPaddingValues(), + contentPadding = WindowInsets.navigationBars.asPaddingValues() + topPaddingValues, ) { item(key = "title") { Text( diff --git a/app/src/main/java/eu/kanade/presentation/source/SourceScreen.kt b/app/src/main/java/eu/kanade/presentation/source/SourceScreen.kt index c6da3123a1..a91517035a 100644 --- a/app/src/main/java/eu/kanade/presentation/source/SourceScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/source/SourceScreen.kt @@ -36,7 +36,9 @@ import eu.kanade.presentation.components.EmptyScreen import eu.kanade.presentation.components.LoadingScreen import eu.kanade.presentation.source.components.BaseSourceItem import eu.kanade.presentation.theme.header +import eu.kanade.presentation.util.topPaddingValues import eu.kanade.presentation.util.horizontalPadding +import eu.kanade.presentation.util.plus import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.source.LocalSource import eu.kanade.tachiyomi.ui.browse.source.SourcePresenter @@ -86,7 +88,7 @@ fun SourceList( LazyColumn( modifier = Modifier .nestedScroll(nestedScrollConnection), - contentPadding = WindowInsets.navigationBars.asPaddingValues(), + contentPadding = WindowInsets.navigationBars.asPaddingValues() + topPaddingValues, ) { items( items = list, diff --git a/app/src/main/java/eu/kanade/presentation/util/Constants.kt b/app/src/main/java/eu/kanade/presentation/util/Constants.kt index fcf64d77b3..da958b5d61 100644 --- a/app/src/main/java/eu/kanade/presentation/util/Constants.kt +++ b/app/src/main/java/eu/kanade/presentation/util/Constants.kt @@ -1,5 +1,8 @@ package eu.kanade.presentation.util +import androidx.compose.foundation.layout.PaddingValues import androidx.compose.ui.unit.dp val horizontalPadding = 16.dp + +val topPaddingValues = PaddingValues(top = 8.dp) diff --git a/app/src/main/java/eu/kanade/presentation/util/PaddingValues.kt b/app/src/main/java/eu/kanade/presentation/util/PaddingValues.kt new file mode 100644 index 0000000000..b1a2a97846 --- /dev/null +++ b/app/src/main/java/eu/kanade/presentation/util/PaddingValues.kt @@ -0,0 +1,20 @@ +package eu.kanade.presentation.util + +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.calculateEndPadding +import androidx.compose.foundation.layout.calculateStartPadding +import androidx.compose.runtime.Composable +import androidx.compose.ui.platform.LocalLayoutDirection + +@Composable +operator fun PaddingValues.plus(other: PaddingValues): PaddingValues { + val layoutDirection = LocalLayoutDirection.current + return PaddingValues( + start = calculateStartPadding(layoutDirection) + + other.calculateStartPadding(layoutDirection), + end = calculateEndPadding(layoutDirection) + + other.calculateEndPadding(layoutDirection), + top = calculateTopPadding() + other.calculateTopPadding(), + bottom = calculateBottomPadding() + other.calculateBottomPadding(), + ) +}