Skip to content

Commit fa21f8f

Browse files
committed
fix img url for flow page
1 parent 8b6dee4 commit fa21f8f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/src/main/java/me/ash/reader/ui/page/home/flow/ArticleItem.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import me.ash.reader.ui.component.FeedIcon
2525
import me.ash.reader.ui.component.base.RYAsyncImage
2626
import me.ash.reader.ui.component.base.SIZE_1000
2727
import me.ash.reader.ui.theme.Shape20
28+
import java.net.URI
2829

2930
@Composable
3031
fun ArticleItem(
@@ -136,12 +137,17 @@ fun ArticleItem(
136137

137138
// Image
138139
if (articleWithFeed.article.img != null && articleListImage.value) {
140+
var imgUrl: String = articleWithFeed.article.img!!
141+
if (imgUrl.startsWith("/")) {
142+
val uri = URI.create(articleWithFeed.feed.url)
143+
imgUrl = "${uri.scheme}://${uri.host}$imgUrl"
144+
}
139145
RYAsyncImage(
140146
modifier = Modifier
141147
.padding(start = 10.dp)
142148
.size(80.dp)
143149
.clip(Shape20),
144-
data = articleWithFeed.article.img,
150+
data = imgUrl,
145151
scale = Scale.FILL,
146152
precision = Precision.INEXACT,
147153
size = SIZE_1000,

0 commit comments

Comments
 (0)