|
@@ -18,13 +18,11 @@ import androidx.compose.foundation.layout.padding
|
|
|
import androidx.compose.runtime.Composable
|
|
import androidx.compose.runtime.Composable
|
|
|
import androidx.compose.ui.Alignment
|
|
import androidx.compose.ui.Alignment
|
|
|
import androidx.compose.ui.Modifier
|
|
import androidx.compose.ui.Modifier
|
|
|
-import androidx.compose.ui.graphics.Color
|
|
|
|
|
import androidx.compose.ui.layout.ContentScale
|
|
import androidx.compose.ui.layout.ContentScale
|
|
|
-import androidx.compose.ui.unit.dp
|
|
|
|
|
-import androidx.tv.material3.MaterialTheme
|
|
|
|
|
import org.mjdev.tvapp.base.annotations.TvPreview
|
|
import org.mjdev.tvapp.base.annotations.TvPreview
|
|
|
import org.mjdev.tvapp.base.ui.components.image.ImageAny
|
|
import org.mjdev.tvapp.base.ui.components.image.ImageAny
|
|
|
import org.mjdev.tvapp.base.ui.components.text.TextAny
|
|
import org.mjdev.tvapp.base.ui.components.text.TextAny
|
|
|
|
|
+import org.mjdev.tvapp.base.ui.theme.LocalThemeProvider
|
|
|
import org.mjdev.tvapp.data.Movie
|
|
import org.mjdev.tvapp.data.Movie
|
|
|
|
|
|
|
|
@SuppressLint("ModifierParameter")
|
|
@SuppressLint("ModifierParameter")
|
|
@@ -33,49 +31,42 @@ import org.mjdev.tvapp.data.Movie
|
|
|
fun Details(
|
|
fun Details(
|
|
|
movie: Movie? = null,
|
|
movie: Movie? = null,
|
|
|
modifier: Modifier = Modifier,
|
|
modifier: Modifier = Modifier,
|
|
|
- textColor: Color = Color.White.copy(alpha = 0.8f)
|
|
|
|
|
) {
|
|
) {
|
|
|
-
|
|
|
|
|
|
|
+ val themeProvider = LocalThemeProvider.current
|
|
|
Box(
|
|
Box(
|
|
|
modifier = modifier.fillMaxSize(),
|
|
modifier = modifier.fillMaxSize(),
|
|
|
contentAlignment = Alignment.BottomStart,
|
|
contentAlignment = Alignment.BottomStart,
|
|
|
) {
|
|
) {
|
|
|
-
|
|
|
|
|
ImageAny(
|
|
ImageAny(
|
|
|
src = movie?.imageUrl,
|
|
src = movie?.imageUrl,
|
|
|
contentDescription = null,
|
|
contentDescription = null,
|
|
|
contentScale = ContentScale.Crop,
|
|
contentScale = ContentScale.Crop,
|
|
|
modifier = Modifier.fillMaxSize()
|
|
modifier = Modifier.fillMaxSize()
|
|
|
)
|
|
)
|
|
|
-
|
|
|
|
|
Column(
|
|
Column(
|
|
|
modifier = Modifier
|
|
modifier = Modifier
|
|
|
.fillMaxWidth()
|
|
.fillMaxWidth()
|
|
|
- .background(Color.Black)
|
|
|
|
|
- .padding(vertical = 32.dp, horizontal = 48.dp)
|
|
|
|
|
|
|
+ .background(themeProvider.detailTextBackgroundColor)
|
|
|
|
|
+ .padding(
|
|
|
|
|
+ vertical = themeProvider.detailTextPaddingVertical,
|
|
|
|
|
+ horizontal = themeProvider.detailTextPaddingHorizontal
|
|
|
|
|
+ )
|
|
|
) {
|
|
) {
|
|
|
-
|
|
|
|
|
TextAny(
|
|
TextAny(
|
|
|
- text = movie?.title,
|
|
|
|
|
- style = MaterialTheme.typography.headlineLarge,
|
|
|
|
|
- color = textColor
|
|
|
|
|
|
|
+ text = movie?.title ?: "-",
|
|
|
|
|
+ style = themeProvider.detailsTitleTextStyle,
|
|
|
|
|
+ color = themeProvider.detailsTextColor
|
|
|
)
|
|
)
|
|
|
-
|
|
|
|
|
TextAny(
|
|
TextAny(
|
|
|
- text = movie?.studio,
|
|
|
|
|
- style = MaterialTheme.typography.headlineMedium,
|
|
|
|
|
- color = textColor
|
|
|
|
|
|
|
+ text = movie?.studio ?: "-",
|
|
|
|
|
+ style = themeProvider.detailsTextStyle,
|
|
|
|
|
+ color = themeProvider.detailsTextColor
|
|
|
)
|
|
)
|
|
|
-
|
|
|
|
|
TextAny(
|
|
TextAny(
|
|
|
- text = movie?.title,
|
|
|
|
|
- style = MaterialTheme.typography.headlineMedium,
|
|
|
|
|
- color = textColor
|
|
|
|
|
|
|
+ text = movie?.title ?: "-",
|
|
|
|
|
+ style = themeProvider.detailsTextStyle,
|
|
|
|
|
+ color = themeProvider.detailsTextColor
|
|
|
)
|
|
)
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|