mmobin789 / Android-Dynamic-Expandable-List-Adapter

Source code for one for all expandable list adapter that provides an expandable listing feature to unlimited number of extending adapters for their individual lists.
46 stars 11 forks source link

UI freezes on scroll #1

Open ishaan-khan opened 4 years ago

ishaan-khan commented 4 years ago

Hi, A wonderful attempt at vertically nested Recylcerviews. I had initially developed a similar concept and it had slight lag on scrolling, unfortunately your solution has the same issue.

Do you happen to have a solution for that?

mmobin789 commented 4 years ago

I just verified your issue when I scrolled the sample app I am fixing it asap subscribe to this repo as when its fixed I will push the code.

mmobin789 commented 4 years ago

@malikdawar take pull and create your branch and send a PR with above fix asap.

NunoPontes commented 4 years ago

Hello, any news on when this would be solved? thanks

mmobin789 commented 4 years ago

@ishaan-khan @NunoPontes can you mention Android API versions you are testing on ? i - e 21,24 etc.

Also mention steps to reproduce lag or any videos pointing it out would be really helpful.

I experience negligible lag in Android 9 (Pie) and 9+.

However expandable adapter should perform smoothly with negligible lag on Android 7 and greater.

I am also trying to fix this but any optimal fix isn't found yet.

Tried what so far:

  1. Using same recycled view pool for parent and child isn't working as when the view is retrieved from the pool a classCastException occurs because sometimes the view requested by parent turns out to be a child and contrary as well. (Failed)

  2. You can initialize the child recycler view adapter in ExpandableRecyclerViewClass in a worker thread however collapse/expand animations are affected which converts to a bad user experience though the lag is gone. (Passed but not graceful)

As of current I am trying to optimize the 2nd approach.

Thanks.