1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-06-18 06:24:14 +00:00

Always show comment thumbnails, even if placeholders

This commit is contained in:
Isira Seneviratne 2024-08-04 05:07:55 +05:30
parent e955beeef1
commit f9dae9078e
2 changed files with 23 additions and 27 deletions

View File

@ -66,22 +66,20 @@ fun Comment(comment: CommentsInfoItem) {
.padding(8.dp), .padding(8.dp),
horizontalArrangement = Arrangement.spacedBy(8.dp) horizontalArrangement = Arrangement.spacedBy(8.dp)
) { ) {
if (ImageStrategy.shouldLoadImages()) { AsyncImage(
AsyncImage( model = ImageStrategy.choosePreferredImage(comment.uploaderAvatars),
model = ImageStrategy.choosePreferredImage(comment.uploaderAvatars), contentDescription = null,
contentDescription = null, placeholder = painterResource(R.drawable.placeholder_person),
placeholder = painterResource(R.drawable.placeholder_person), error = painterResource(R.drawable.placeholder_person),
error = painterResource(R.drawable.placeholder_person), modifier = Modifier
modifier = Modifier .size(42.dp)
.size(42.dp) .clip(CircleShape)
.clip(CircleShape) .clickable {
.clickable { NavigationHelper.openCommentAuthorIfPresent(
NavigationHelper.openCommentAuthorIfPresent( context as FragmentActivity, comment
context as FragmentActivity, comment )
) }
} )
)
}
Column(verticalArrangement = Arrangement.spacedBy(4.dp)) { Column(verticalArrangement = Arrangement.spacedBy(4.dp)) {
Row(horizontalArrangement = Arrangement.spacedBy(4.dp)) { Row(horizontalArrangement = Arrangement.spacedBy(4.dp)) {

View File

@ -51,17 +51,15 @@ fun CommentRepliesHeader(comment: CommentsInfoItem) {
horizontalArrangement = Arrangement.spacedBy(8.dp), horizontalArrangement = Arrangement.spacedBy(8.dp),
verticalAlignment = Alignment.CenterVertically verticalAlignment = Alignment.CenterVertically
) { ) {
if (ImageStrategy.shouldLoadImages()) { AsyncImage(
AsyncImage( model = ImageStrategy.choosePreferredImage(comment.uploaderAvatars),
model = ImageStrategy.choosePreferredImage(comment.uploaderAvatars), contentDescription = null,
contentDescription = null, placeholder = painterResource(R.drawable.placeholder_person),
placeholder = painterResource(R.drawable.placeholder_person), error = painterResource(R.drawable.placeholder_person),
error = painterResource(R.drawable.placeholder_person), modifier = Modifier
modifier = Modifier .size(42.dp)
.size(42.dp) .clip(CircleShape)
.clip(CircleShape) )
)
}
Column { Column {
Text(text = comment.uploaderName) Text(text = comment.uploaderName)