mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
use cache for user avatars again (ignore flickering)
in the future, avatarVersion might be available for user avatars as well.. Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
d560a4a2a9
commit
898728cef9
@ -68,8 +68,6 @@ class ConversationItem(
|
|||||||
IFilterable<String?> {
|
IFilterable<String?> {
|
||||||
private var header: GenericTextHeaderItem? = null
|
private var header: GenericTextHeaderItem? = null
|
||||||
|
|
||||||
private var isInitialLoad = true
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
conversation: Conversation,
|
conversation: Conversation,
|
||||||
user: User,
|
user: User,
|
||||||
@ -172,7 +170,12 @@ class ConversationItem(
|
|||||||
when (model.type) {
|
when (model.type) {
|
||||||
ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL -> {
|
ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL -> {
|
||||||
if (!TextUtils.isEmpty(model.name)) {
|
if (!TextUtils.isEmpty(model.name)) {
|
||||||
holder.binding.dialogAvatar.loadUserAvatar(user, model.name!!, true, isInitialLoad)
|
holder.binding.dialogAvatar.loadUserAvatar(
|
||||||
|
user,
|
||||||
|
model.name!!,
|
||||||
|
true,
|
||||||
|
false
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
holder.binding.dialogAvatar.visibility = View.GONE
|
holder.binding.dialogAvatar.visibility = View.GONE
|
||||||
}
|
}
|
||||||
@ -186,7 +189,6 @@ class ConversationItem(
|
|||||||
else -> holder.binding.dialogAvatar.visibility = View.GONE
|
else -> holder.binding.dialogAvatar.visibility = View.GONE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
isInitialLoad = false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun shouldLoadAvatar(
|
private fun shouldLoadAvatar(
|
||||||
|
@ -84,7 +84,7 @@ fun ImageView.loadUserAvatar(
|
|||||||
user: User,
|
user: User,
|
||||||
avatarId: String,
|
avatarId: String,
|
||||||
requestBigSize: Boolean = true,
|
requestBigSize: Boolean = true,
|
||||||
replace: Boolean
|
ignoreCache: Boolean
|
||||||
): io.reactivex.disposables
|
): io.reactivex.disposables
|
||||||
.Disposable {
|
.Disposable {
|
||||||
val imageRequestUri = ApiUtils.getUrlForAvatar(
|
val imageRequestUri = ApiUtils.getUrlForAvatar(
|
||||||
@ -93,7 +93,7 @@ fun ImageView.loadUserAvatar(
|
|||||||
requestBigSize
|
requestBigSize
|
||||||
)
|
)
|
||||||
|
|
||||||
return loadAvatarInternal(user, imageRequestUri, replace, null)
|
return loadAvatarInternal(user, imageRequestUri, ignoreCache, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalCoilApi::class)
|
@OptIn(ExperimentalCoilApi::class)
|
||||||
|
Loading…
Reference in New Issue
Block a user