some ui tweaks

This commit is contained in:
Owen LeJeune
2023-05-31 17:36:26 -04:00
parent 13cf4ff4fb
commit d6f43b7579
5 changed files with 24 additions and 23 deletions

View File

@@ -163,8 +163,8 @@ class MainActivity : MonetCompatActivity() {
scrolledContainerColor = MaterialTheme.colorScheme.background
),
actions = {
defaultAppBarActions()
appBarActions.value(this)
defaultAppBarActions()
}
)
}
@@ -292,7 +292,7 @@ class MainActivity : MonetCompatActivity() {
Row(modifier = Modifier.fillMaxSize()) {
NavigationRail {
Spacer(modifier = Modifier.weight(1f))
BottomNavItem.SortedItems.forEach { item ->
BottomNavItem.SortedItems.forEachIndexed { index, item ->
NavigationRailItem(
icon = { Icon(painter = painterResource(id = item.icon), contentDescription = null) },
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))
}

View File

@@ -83,8 +83,6 @@ fun ExpandableContentCard(
Card(
modifier = modifier
.fillMaxWidth()
.wrapContentHeight()
.animateContentSize(
animationSpec = tween(
durationMillis = 300,
@@ -95,7 +93,9 @@ fun ExpandableContentCard(
elevation = CardDefaults.cardElevation(defaultElevation = 8.dp),
colors = CardDefaults.cardColors(containerColor = backgroundColor)
) {
Column(modifier = Modifier.fillMaxSize()) {
Column(
modifier = Modifier.fillMaxSize()
) {
title()
content(expandedState)
Text(
@@ -124,10 +124,10 @@ fun LazyListContentCard(
content: LazyListScope.() -> Unit
) {
Card(
modifier = modifier
.background(color = backgroundColor),
modifier = modifier,
shape = RoundedCornerShape(10.dp),
elevation = CardDefaults.cardElevation(defaultElevation = 8.dp)
elevation = CardDefaults.cardElevation(defaultElevation = 8.dp),
colors = CardDefaults.cardColors(containerColor = backgroundColor)
) {
Column(
modifier = Modifier
@@ -159,10 +159,10 @@ fun ListContentCard(
content: @Composable ColumnScope.() -> Unit
) {
Card(
modifier = modifier
.background(color = backgroundColor),
modifier = modifier,
shape = RoundedCornerShape(10.dp),
elevation = CardDefaults.cardElevation(defaultElevation = 8.dp)
elevation = CardDefaults.cardElevation(defaultElevation = 8.dp),
colors = CardDefaults.cardColors(containerColor = backgroundColor)
) {
Column(
modifier = Modifier

View File

@@ -215,6 +215,7 @@ fun PosterItem(
modifier: Modifier = Modifier,
width: Dp = POSTER_WIDTH,
onClick: () -> Unit = {},
enabled: Boolean = true,
noDataImage: Int = R.drawable.placeholder,
placeholder: Int = R.drawable.placeholder,
elevation: Dp = 8.dp,
@@ -229,7 +230,12 @@ fun PosterItem(
.wrapContentHeight(),
shape = RoundedCornerShape(5.dp)
) {
Box {
Box(
modifier = Modifier.clickable(
enabled = true,
onClick = onClick
)
) {
var sizeImage by remember { mutableStateOf(IntSize.Zero) }
val gradient = Brush.verticalGradient(
colors = listOf(Color.Transparent, Color.Black.copy(alpha = 0.7f)),
@@ -243,9 +249,6 @@ fun PosterItem(
.width(width = width)
.wrapContentHeight()
.clip(RoundedCornerShape(5.dp))
.clickable(
onClick = onClick
)
.onGloballyPositioned { sizeImage = it.size },
onError = { Log.d("Poster", "Error loading: $url") },
error = rememberAsyncImagePainter(model = noDataImage),
@@ -260,9 +263,6 @@ fun PosterItem(
.width(width = width)
.height(height = POSTER_HEIGHT)
.clip(RoundedCornerShape(5.dp))
.clickable(
onClick = onClick
)
.onGloballyPositioned { sizeImage = it.size },
painter = rememberAsyncImagePainter(model = noDataImage),
contentDescription = title,

View File

@@ -75,7 +75,8 @@ fun DetailHeader(
url = posterUrl,
title = posterContentDescription,
elevation = 20.dp,
overrideShowTitle = false
overrideShowTitle = false,
enabled = false
)
rating?.let {

View File

@@ -108,8 +108,7 @@ fun MediaDetailView(
Box(modifier = Modifier.padding(innerPadding)) {
Row(
modifier = Modifier
.background(color = MaterialTheme.colorScheme.background)
.padding(bottom = 16.dp),
.background(color = MaterialTheme.colorScheme.background),
horizontalArrangement = Arrangement.spacedBy(16.dp)
) {
Column(
@@ -169,7 +168,6 @@ fun MediaDetailView(
modifier = Modifier
.background(color = MaterialTheme.colorScheme.background)
.weight(1f)
.padding(bottom = 16.dp)
.verticalScroll(state = rememberScrollState())
) {
ReviewsCard(itemId = itemId, service = service)
@@ -924,7 +922,6 @@ fun SimilarContentCard(
}
}
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun VideosCard(itemId: Int?, service: DetailService, modifier: Modifier = Modifier) {
val videoResponse = remember { mutableStateOf<VideoResponse?>(null) }