Skip to content

Commit

Permalink
fix img url for flow page
Browse files Browse the repository at this point in the history
  • Loading branch information
frearb committed Jul 30, 2022
1 parent 8b6dee4 commit fa21f8f
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import me.ash.reader.ui.component.FeedIcon
import me.ash.reader.ui.component.base.RYAsyncImage
import me.ash.reader.ui.component.base.SIZE_1000
import me.ash.reader.ui.theme.Shape20
import java.net.URI

@Composable
fun ArticleItem(
Expand Down Expand Up @@ -136,12 +137,17 @@ fun ArticleItem(

// Image
if (articleWithFeed.article.img != null && articleListImage.value) {
var imgUrl: String = articleWithFeed.article.img!!
if (imgUrl.startsWith("/")) {
val uri = URI.create(articleWithFeed.feed.url)
imgUrl = "${uri.scheme}://${uri.host}$imgUrl"
}
RYAsyncImage(
modifier = Modifier
.padding(start = 10.dp)
.size(80.dp)
.clip(Shape20),
data = articleWithFeed.article.img,
data = imgUrl,
scale = Scale.FILL,
precision = Precision.INEXACT,
size = SIZE_1000,
Expand Down

0 comments on commit fa21f8f

Please sign in to comment.