make chapter select items look better

This commit is contained in:
Christian Schabesberger 2024-09-06 14:18:47 +02:00
parent 09f32dd893
commit 0d8662fb5b
3 changed files with 10 additions and 4 deletions

View File

@ -106,25 +106,28 @@ fun ChapterItem(
Row { Row {
val contentDescription = stringResource(R.string.chapter_thumbnail) val contentDescription = stringResource(R.string.chapter_thumbnail)
Thumbnail( Thumbnail(
modifier = Modifier.fillMaxHeight(),
thumbnail = thumbnail, thumbnail = thumbnail,
contentDescription = contentDescription, contentDescription = contentDescription,
shape = ITEM_CORNER_SHAPE shape = ITEM_CORNER_SHAPE
) )
Column( Column(
modifier = Modifier modifier = Modifier
.padding(start = 8.dp, top = 5.dp, bottom = 5.dp) .padding(6.dp)
.weight(1f), .weight(1f),
horizontalAlignment = Alignment.Start, horizontalAlignment = Alignment.Start,
) { ) {
Text( Text(
text = chapterTitle, text = chapterTitle,
fontSize = 18.sp, fontSize = 14.sp,
fontWeight = FontWeight.Bold, fontWeight = FontWeight.Bold,
maxLines = 1, maxLines = 2,
overflow = TextOverflow.Ellipsis overflow = TextOverflow.Ellipsis
) )
Text( Text(
getTimeStringFromMs(chapterStartInMs, locale), getTimeStringFromMs(chapterStartInMs, locale),
fontSize = 13.sp,
fontWeight = FontWeight.Light,
maxLines = 1, maxLines = 1,
overflow = TextOverflow.Ellipsis overflow = TextOverflow.Ellipsis
) )

View File

@ -32,6 +32,7 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.aspectRatio import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.height
@ -133,6 +134,7 @@ fun StreamItem(
) { ) {
val contentDescription = stringResource(R.string.stream_item_thumbnail) val contentDescription = stringResource(R.string.stream_item_thumbnail)
Thumbnail( Thumbnail(
modifier = Modifier.fillMaxHeight(),
thumbnail = playlistItem.thumbnail, thumbnail = playlistItem.thumbnail,
contentDescription = contentDescription, contentDescription = contentDescription,
shape = ITEM_CORNER_SHAPE shape = ITEM_CORNER_SHAPE

View File

@ -39,6 +39,7 @@ import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.ReadOnlyComposable import androidx.compose.runtime.ReadOnlyComposable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.clip
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalView import androidx.compose.ui.platform.LocalView
@ -166,7 +167,7 @@ fun Thumbnail(
is OnlineThumbnail -> AsyncImage( is OnlineThumbnail -> AsyncImage(
modifier = modifier, modifier = modifier,
model = thumbnail.url, model = thumbnail.url,
contentDescription = contentDescription contentDescription = contentDescription,
) )
is BitmapThumbnail -> Image( is BitmapThumbnail -> Image(