fix: adjust poster card shape for homecollectionrow

This commit is contained in:
tapframe 2026-04-13 19:21:17 +05:30
parent e373759de7
commit 21963d35cc

View file

@ -1,6 +1,5 @@
package com.nuvio.app.features.home.components
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxWithConstraints
@ -26,6 +25,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.nuvio.app.core.ui.NuvioShelfSection
import com.nuvio.app.core.ui.PosterLandscapeAspectRatio
import com.nuvio.app.core.ui.landscapePosterWidth
import com.nuvio.app.core.ui.posterCardClickable
import com.nuvio.app.core.ui.rememberPosterCardStyleUiState
import com.nuvio.app.features.collection.Collection
@ -89,21 +89,22 @@ private fun CollectionFolderCard(
onClick: (() -> Unit)? = null,
) {
val posterCardStyle = rememberPosterCardStyleUiState()
val shape = folder.posterShape
val isLandscapeMode = posterCardStyle.catalogLandscapeModeEnabled
val shape = if (isLandscapeMode) PosterShape.Landscape else folder.posterShape
val cardWidth: Dp
val aspectRatio: Float
when (shape) {
PosterShape.Poster -> {
cardWidth = 110.dp
cardWidth = posterCardStyle.widthDp.dp
aspectRatio = 0.675f
}
PosterShape.Landscape -> {
cardWidth = 180.dp
cardWidth = landscapePosterWidth(posterCardStyle.widthDp)
aspectRatio = PosterLandscapeAspectRatio
}
PosterShape.Square -> {
cardWidth = 120.dp
cardWidth = posterCardStyle.widthDp.dp
aspectRatio = 1f
}
}