Add missing top padding for screen that was rewritten in Compose (#7145)

This commit is contained in:
Andreas
2022-05-15 20:00:35 +02:00
committed by GitHub
parent 3e2d7d76b9
commit fb83a07f84
6 changed files with 35 additions and 4 deletions

View File

@@ -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)

View File

@@ -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(),
)
}