Skip to content

Commit 7cb05b8

Browse files
fix(conversations): don't show the fallback avatar while loading
Scrolling the conversation list flashed the generic fallback avatar on rows entering the viewport for the first time in a session: the lazy list disposes off-screen rows, and re-entering rows without a memory cache entry showed the fallback as a de-facto loading indicator until the disk read or fetch completed. Render nothing while an avatar loads (the slot keeps its size and the avatar crossfades in), keep the last shown avatar as the placeholder when one is known, and reserve the fallback icon for what its name says: a failed load with no previously shown avatar. Assisted-by: Claude Code:claude-fable-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
1 parent 6934136 commit 7cb05b8

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

app/src/main/java/com/nextcloud/talk/conversationlist/ui/ConversationListItem.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,14 +269,13 @@ private fun ConversationAvatarImage(model: ConversationModel, currentUser: User,
269269
val lastShownAvatar = remember(request) {
270270
imageLoader.memoryCache?.get(aliasKey)?.bitmap?.let { BitmapPainter(it.asImageBitmap()) }
271271
}
272-
val fallback = painterResource(R.drawable.account_circle_96dp)
273272
AsyncImage(
274273
model = request,
275274
imageLoader = imageLoader,
276275
contentDescription = stringResource(R.string.avatar),
277276
contentScale = ContentScale.Crop,
278-
placeholder = lastShownAvatar ?: fallback,
279-
error = lastShownAvatar ?: fallback,
277+
placeholder = lastShownAvatar,
278+
error = lastShownAvatar ?: painterResource(R.drawable.account_circle_96dp),
280279
modifier = modifier
281280
)
282281
}

0 commit comments

Comments
 (0)