talk-android icon indicating copy to clipboard operation
talk-android copied to clipboard

Conversation list flickers

Open skjnldsv opened this issue 7 months ago • 2 comments

Steps to reproduce

Use Talk 21.1.0RC2 Have a list of conversations Switch back and forth to messages list and conversation list

Expected behaviour

No flickers

Actual behaviour

https://github.com/user-attachments/assets/e53761b8-94d3-4e4f-a6a9-0267cd6eb435

Device brand and model

Samsung A33

Android version

14

Nextcloud Talk app version

21.1.0 RC2

Nextcloud server version

31

Talk version

No response

Custom Signaling server configured

None

Custom TURN server configured

None

Custom STUN server configured

None

Android logs

No response

Server log


Additional information

No response

skjnldsv avatar May 28 '25 10:05 skjnldsv

This is a known behavior (although it seems to be more intense than on my devices).

For the conversation list we will have a look especially when migrating this screen to compose.

The avatars in chat may flicker because of a different reason.

mahibi avatar Jun 03 '25 17:06 mahibi

This is a known behavior (although it seems to be more intense than on my devices).

It was better a few weeks ago. Last update I did (don't recall which version I was on), dramatically increased the issue :)

skjnldsv avatar Jun 04 '25 06:06 skjnldsv

I have taken some time to investigate this one; it is a bit tricky.

There are a few issues in place:

ConversationListActivity issues

  1. The ConversationListActivity is using the FlexibleAdapter to display the items, which does provide an updateDataSet method to update the list without animations. Unfortunately, passing animate: false doesn't really do much.
  2. If to remove the item animator from the recylerView, the flickering goes away (as do all the other animations, but there is a workaround)

Image loading issues:

  1. However, in that case, another flickering happens: the image loading makes the avatar flicker, and it's not the fault of coil, but the fact that the views don't seem to preserve, and the images load multiple times for seemingly the same item
  2. I saw it on the "Note to self" chat, and tried just setting the drawable without using coil, but that didn't help, the image was overwritten.
fun ImageView.loadNoteToSelfAvatar() {
    val layers = arrayOfNulls<Drawable>(2)
    layers[0] = ContextCompat.getDrawable(context, R.drawable.ic_launcher_background)
    layers[1] = ContextCompat.getDrawable(context, R.drawable.ic_note_to_self)
    val layerDrawable = LayerDrawable(layers)
    val data: Any = layerDrawable

   // This does not help
    setImageDrawable(data)
}

I'll keep digging into it, since the flickering annoys me very much. I'll try to make sure the views don't get rerendered if not changed.

ariedov avatar Jul 30 '25 14:07 ariedov

Found another potential solution to the ConversationList flicker.

I messed with the ConversationModel class equals and hashCode functions, and limited it to internalId. That completely got rid of the flickering, which suggests that if only the fields we care about displaying are changed, it is possible to reduce the flickering significantly.

ariedov avatar Jul 30 '25 15:07 ariedov

And since there are no more extra redraws, the icons now also stay in place on the ConversationActivity, which is a pleasant improvement. Preparing pull request now.

ariedov avatar Jul 30 '25 16:07 ariedov