mirror of
https://github.com/owenlejeune/TVTime.git
synced 2025-11-20 18:50:54 -05:00
some ui tweaks
This commit is contained in:
@@ -163,8 +163,8 @@ class MainActivity : MonetCompatActivity() {
|
|||||||
scrolledContainerColor = MaterialTheme.colorScheme.background
|
scrolledContainerColor = MaterialTheme.colorScheme.background
|
||||||
),
|
),
|
||||||
actions = {
|
actions = {
|
||||||
defaultAppBarActions()
|
|
||||||
appBarActions.value(this)
|
appBarActions.value(this)
|
||||||
|
defaultAppBarActions()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -292,7 +292,7 @@ class MainActivity : MonetCompatActivity() {
|
|||||||
Row(modifier = Modifier.fillMaxSize()) {
|
Row(modifier = Modifier.fillMaxSize()) {
|
||||||
NavigationRail {
|
NavigationRail {
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
BottomNavItem.SortedItems.forEach { item ->
|
BottomNavItem.SortedItems.forEachIndexed { index, item ->
|
||||||
NavigationRailItem(
|
NavigationRailItem(
|
||||||
icon = { Icon(painter = painterResource(id = item.icon), contentDescription = null) },
|
icon = { Icon(painter = painterResource(id = item.icon), contentDescription = null) },
|
||||||
label = { if (preferences.showBottomTabLabels) Text(item.name) },
|
label = { if (preferences.showBottomTabLabels) Text(item.name) },
|
||||||
@@ -305,6 +305,9 @@ class MainActivity : MonetCompatActivity() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
if (index < BottomNavItem.SortedItems.size - 1) {
|
||||||
|
Spacer(modifier = Modifier.height(20.dp))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,8 +83,6 @@ fun ExpandableContentCard(
|
|||||||
|
|
||||||
Card(
|
Card(
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
.fillMaxWidth()
|
|
||||||
.wrapContentHeight()
|
|
||||||
.animateContentSize(
|
.animateContentSize(
|
||||||
animationSpec = tween(
|
animationSpec = tween(
|
||||||
durationMillis = 300,
|
durationMillis = 300,
|
||||||
@@ -95,7 +93,9 @@ fun ExpandableContentCard(
|
|||||||
elevation = CardDefaults.cardElevation(defaultElevation = 8.dp),
|
elevation = CardDefaults.cardElevation(defaultElevation = 8.dp),
|
||||||
colors = CardDefaults.cardColors(containerColor = backgroundColor)
|
colors = CardDefaults.cardColors(containerColor = backgroundColor)
|
||||||
) {
|
) {
|
||||||
Column(modifier = Modifier.fillMaxSize()) {
|
Column(
|
||||||
|
modifier = Modifier.fillMaxSize()
|
||||||
|
) {
|
||||||
title()
|
title()
|
||||||
content(expandedState)
|
content(expandedState)
|
||||||
Text(
|
Text(
|
||||||
@@ -124,10 +124,10 @@ fun LazyListContentCard(
|
|||||||
content: LazyListScope.() -> Unit
|
content: LazyListScope.() -> Unit
|
||||||
) {
|
) {
|
||||||
Card(
|
Card(
|
||||||
modifier = modifier
|
modifier = modifier,
|
||||||
.background(color = backgroundColor),
|
|
||||||
shape = RoundedCornerShape(10.dp),
|
shape = RoundedCornerShape(10.dp),
|
||||||
elevation = CardDefaults.cardElevation(defaultElevation = 8.dp)
|
elevation = CardDefaults.cardElevation(defaultElevation = 8.dp),
|
||||||
|
colors = CardDefaults.cardColors(containerColor = backgroundColor)
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@@ -159,10 +159,10 @@ fun ListContentCard(
|
|||||||
content: @Composable ColumnScope.() -> Unit
|
content: @Composable ColumnScope.() -> Unit
|
||||||
) {
|
) {
|
||||||
Card(
|
Card(
|
||||||
modifier = modifier
|
modifier = modifier,
|
||||||
.background(color = backgroundColor),
|
|
||||||
shape = RoundedCornerShape(10.dp),
|
shape = RoundedCornerShape(10.dp),
|
||||||
elevation = CardDefaults.cardElevation(defaultElevation = 8.dp)
|
elevation = CardDefaults.cardElevation(defaultElevation = 8.dp),
|
||||||
|
colors = CardDefaults.cardColors(containerColor = backgroundColor)
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
|||||||
@@ -215,6 +215,7 @@ fun PosterItem(
|
|||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
width: Dp = POSTER_WIDTH,
|
width: Dp = POSTER_WIDTH,
|
||||||
onClick: () -> Unit = {},
|
onClick: () -> Unit = {},
|
||||||
|
enabled: Boolean = true,
|
||||||
noDataImage: Int = R.drawable.placeholder,
|
noDataImage: Int = R.drawable.placeholder,
|
||||||
placeholder: Int = R.drawable.placeholder,
|
placeholder: Int = R.drawable.placeholder,
|
||||||
elevation: Dp = 8.dp,
|
elevation: Dp = 8.dp,
|
||||||
@@ -229,7 +230,12 @@ fun PosterItem(
|
|||||||
.wrapContentHeight(),
|
.wrapContentHeight(),
|
||||||
shape = RoundedCornerShape(5.dp)
|
shape = RoundedCornerShape(5.dp)
|
||||||
) {
|
) {
|
||||||
Box {
|
Box(
|
||||||
|
modifier = Modifier.clickable(
|
||||||
|
enabled = true,
|
||||||
|
onClick = onClick
|
||||||
|
)
|
||||||
|
) {
|
||||||
var sizeImage by remember { mutableStateOf(IntSize.Zero) }
|
var sizeImage by remember { mutableStateOf(IntSize.Zero) }
|
||||||
val gradient = Brush.verticalGradient(
|
val gradient = Brush.verticalGradient(
|
||||||
colors = listOf(Color.Transparent, Color.Black.copy(alpha = 0.7f)),
|
colors = listOf(Color.Transparent, Color.Black.copy(alpha = 0.7f)),
|
||||||
@@ -243,9 +249,6 @@ fun PosterItem(
|
|||||||
.width(width = width)
|
.width(width = width)
|
||||||
.wrapContentHeight()
|
.wrapContentHeight()
|
||||||
.clip(RoundedCornerShape(5.dp))
|
.clip(RoundedCornerShape(5.dp))
|
||||||
.clickable(
|
|
||||||
onClick = onClick
|
|
||||||
)
|
|
||||||
.onGloballyPositioned { sizeImage = it.size },
|
.onGloballyPositioned { sizeImage = it.size },
|
||||||
onError = { Log.d("Poster", "Error loading: $url") },
|
onError = { Log.d("Poster", "Error loading: $url") },
|
||||||
error = rememberAsyncImagePainter(model = noDataImage),
|
error = rememberAsyncImagePainter(model = noDataImage),
|
||||||
@@ -260,9 +263,6 @@ fun PosterItem(
|
|||||||
.width(width = width)
|
.width(width = width)
|
||||||
.height(height = POSTER_HEIGHT)
|
.height(height = POSTER_HEIGHT)
|
||||||
.clip(RoundedCornerShape(5.dp))
|
.clip(RoundedCornerShape(5.dp))
|
||||||
.clickable(
|
|
||||||
onClick = onClick
|
|
||||||
)
|
|
||||||
.onGloballyPositioned { sizeImage = it.size },
|
.onGloballyPositioned { sizeImage = it.size },
|
||||||
painter = rememberAsyncImagePainter(model = noDataImage),
|
painter = rememberAsyncImagePainter(model = noDataImage),
|
||||||
contentDescription = title,
|
contentDescription = title,
|
||||||
|
|||||||
@@ -75,7 +75,8 @@ fun DetailHeader(
|
|||||||
url = posterUrl,
|
url = posterUrl,
|
||||||
title = posterContentDescription,
|
title = posterContentDescription,
|
||||||
elevation = 20.dp,
|
elevation = 20.dp,
|
||||||
overrideShowTitle = false
|
overrideShowTitle = false,
|
||||||
|
enabled = false
|
||||||
)
|
)
|
||||||
|
|
||||||
rating?.let {
|
rating?.let {
|
||||||
|
|||||||
@@ -108,8 +108,7 @@ fun MediaDetailView(
|
|||||||
Box(modifier = Modifier.padding(innerPadding)) {
|
Box(modifier = Modifier.padding(innerPadding)) {
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.background(color = MaterialTheme.colorScheme.background)
|
.background(color = MaterialTheme.colorScheme.background),
|
||||||
.padding(bottom = 16.dp),
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(16.dp)
|
horizontalArrangement = Arrangement.spacedBy(16.dp)
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
@@ -169,7 +168,6 @@ fun MediaDetailView(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.background(color = MaterialTheme.colorScheme.background)
|
.background(color = MaterialTheme.colorScheme.background)
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.padding(bottom = 16.dp)
|
|
||||||
.verticalScroll(state = rememberScrollState())
|
.verticalScroll(state = rememberScrollState())
|
||||||
) {
|
) {
|
||||||
ReviewsCard(itemId = itemId, service = service)
|
ReviewsCard(itemId = itemId, service = service)
|
||||||
@@ -924,7 +922,6 @@ fun SimilarContentCard(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalFoundationApi::class)
|
|
||||||
@Composable
|
@Composable
|
||||||
fun VideosCard(itemId: Int?, service: DetailService, modifier: Modifier = Modifier) {
|
fun VideosCard(itemId: Int?, service: DetailService, modifier: Modifier = Modifier) {
|
||||||
val videoResponse = remember { mutableStateOf<VideoResponse?>(null) }
|
val videoResponse = remember { mutableStateOf<VideoResponse?>(null) }
|
||||||
|
|||||||
Reference in New Issue
Block a user