更新图片缓存

调整图片加载库的缓存策略,启用默认的内存和磁盘缓存。
This commit is contained in:
2024-08-28 19:49:37 +08:00
parent 101d164658
commit a157b5ec11
2 changed files with 15 additions and 17 deletions

View File

@@ -123,9 +123,6 @@ object PostViewModel : ViewModel() {
fun preTransit(momentEntity: MomentEntity?) {
this.postId = momentEntity?.id.toString()
this.moment = momentEntity
this._commentsFlow = MutableStateFlow<PagingData<CommentEntity>>(PagingData.empty())
this.accountProfileEntity = null
viewModelScope.launch {
Pager(
config = PagingConfig(pageSize = 5, enablePlaceholders = false),
@@ -348,7 +345,6 @@ fun PostScreen(
Box(
modifier = Modifier
.fillMaxWidth()
) {
CommentsSection(
lazyPagingItems = commentsPagging,
@@ -588,8 +584,8 @@ fun CommentItem(commentEntity: CommentEntity, onLike: () -> Unit = {}) {
Column {
Row(modifier = Modifier.padding(vertical = 8.dp)) {
CustomAsyncImage(
context,
commentEntity.avatar,
context = context,
imageUrl = commentEntity.avatar,
contentDescription = "Comment Profile Picture",
modifier = Modifier
.size(40.dp)