2022-05-15 20:00:35 +02:00
|
|
|
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
|
2022-06-04 16:01:49 -04:00
|
|
|
import androidx.compose.runtime.ReadOnlyComposable
|
2022-05-15 20:00:35 +02:00
|
|
|
import androidx.compose.ui.platform.LocalLayoutDirection
|
|
|
|
|
|
|
|
@Composable
|
2022-06-04 16:01:49 -04:00
|
|
|
@ReadOnlyComposable
|
2022-05-15 20:00:35 +02:00
|
|
|
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(),
|
|
|
|
)
|
|
|
|
}
|