Bugfixes for migration UI
This commit is contained in:
parent
7a14d9e17b
commit
a9e2394c6d
@ -1,8 +1,11 @@
|
|||||||
package eu.kanade.presentation.browse
|
package eu.kanade.presentation.browse
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
|
import androidx.compose.foundation.layout.IntrinsicSize
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
|
import androidx.compose.foundation.layout.fillMaxHeight
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.lazy.items
|
import androidx.compose.foundation.lazy.items
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
@ -91,7 +94,8 @@ fun MigrationListScreen(
|
|||||||
Modifier
|
Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.animateItemPlacement()
|
.animateItemPlacement()
|
||||||
.padding(horizontal = 16.dp),
|
.padding(horizontal = 16.dp)
|
||||||
|
.height(IntrinsicSize.Min),
|
||||||
horizontalArrangement = Arrangement.SpaceBetween,
|
horizontalArrangement = Arrangement.SpaceBetween,
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
@ -100,7 +104,8 @@ fun MigrationListScreen(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(top = 8.dp)
|
.padding(top = 8.dp)
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.align(Alignment.Top),
|
.align(Alignment.Top)
|
||||||
|
.fillMaxHeight(),
|
||||||
manga = migrationItem.manga,
|
manga = migrationItem.manga,
|
||||||
sourcesString = migrationItem.sourcesString,
|
sourcesString = migrationItem.sourcesString,
|
||||||
chapterInfo = migrationItem.chapterInfo,
|
chapterInfo = migrationItem.chapterInfo,
|
||||||
@ -117,7 +122,8 @@ fun MigrationListScreen(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(top = 8.dp)
|
.padding(top = 8.dp)
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.align(Alignment.Top),
|
.align(Alignment.Top)
|
||||||
|
.fillMaxHeight(),
|
||||||
migrationItem = migrationItem,
|
migrationItem = migrationItem,
|
||||||
result = result,
|
result = result,
|
||||||
getManga = getManga,
|
getManga = getManga,
|
||||||
|
@ -3,11 +3,13 @@ package eu.kanade.presentation.browse.components
|
|||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
|
import androidx.compose.foundation.layout.IntrinsicSize
|
||||||
import androidx.compose.foundation.layout.aspectRatio
|
import androidx.compose.foundation.layout.aspectRatio
|
||||||
|
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.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.widthIn
|
import androidx.compose.foundation.layout.widthIn
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
||||||
import androidx.compose.material3.CircularProgressIndicator
|
import androidx.compose.material3.CircularProgressIndicator
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
@ -37,21 +39,22 @@ fun MigrationItemResult(
|
|||||||
getSourceName: (Manga) -> String,
|
getSourceName: (Manga) -> String,
|
||||||
onMigrationItemClick: (Manga) -> Unit,
|
onMigrationItemClick: (Manga) -> Unit,
|
||||||
) {
|
) {
|
||||||
Box(modifier) {
|
Box(modifier.height(IntrinsicSize.Min)) {
|
||||||
when (result) {
|
when (result) {
|
||||||
MigratingManga.SearchResult.Searching -> Box(
|
MigratingManga.SearchResult.Searching -> Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.widthIn(max = 150.dp)
|
.widthIn(max = 150.dp)
|
||||||
.fillMaxWidth()
|
.fillMaxSize()
|
||||||
.aspectRatio(MangaCover.Book.ratio),
|
.aspectRatio(MangaCover.Book.ratio),
|
||||||
contentAlignment = Alignment.Center,
|
contentAlignment = Alignment.Center,
|
||||||
) {
|
) {
|
||||||
CircularProgressIndicator()
|
CircularProgressIndicator()
|
||||||
}
|
}
|
||||||
MigratingManga.SearchResult.NotFound -> Column(
|
MigratingManga.SearchResult.NotFound -> Column(
|
||||||
Modifier.widthIn(max = 150.dp)
|
Modifier
|
||||||
.fillMaxWidth()
|
.widthIn(max = 150.dp)
|
||||||
.padding(4.dp),
|
.fillMaxSize()
|
||||||
|
.padding(top = 4.dp),
|
||||||
) {
|
) {
|
||||||
Image(
|
Image(
|
||||||
painter = rememberResourceBitmapPainter(id = R.drawable.cover_error),
|
painter = rememberResourceBitmapPainter(id = R.drawable.cover_error),
|
||||||
@ -59,7 +62,7 @@ fun MigrationItemResult(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.aspectRatio(MangaCover.Book.ratio)
|
.aspectRatio(MangaCover.Book.ratio)
|
||||||
.clip(RoundedCornerShape(4.dp)),
|
.clip(MaterialTheme.shapes.extraSmall),
|
||||||
contentScale = ContentScale.Crop,
|
contentScale = ContentScale.Crop,
|
||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
@ -86,7 +89,7 @@ fun MigrationItemResult(
|
|||||||
if (item != null) {
|
if (item != null) {
|
||||||
val (manga, chapterInfo, source) = item!!
|
val (manga, chapterInfo, source) = item!!
|
||||||
MigrationItem(
|
MigrationItem(
|
||||||
modifier = Modifier,
|
modifier = Modifier.fillMaxSize(),
|
||||||
manga = manga,
|
manga = manga,
|
||||||
sourcesString = source,
|
sourcesString = source,
|
||||||
chapterInfo = chapterInfo,
|
chapterInfo = chapterInfo,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user