nikhilpanju / FabFilter

Android app to showcase complex UI/Animations with and without MotionLayout
https://medium.com/@nikhilpanju22/complex-ui-animation-on-android-8f7a46f4aec4?sk=f1fab1861a655b042ff5e9c305a0e012
1.7k stars 221 forks source link

[Question] Dynamic expandable view content #6

Open barchinsky opened 4 years ago

barchinsky commented 4 years ago

Hi @nikhilpanju,

thank you for nice example!

I have question regarding expandable view as I faced some strange behaviour of onPreDraw in case expandable view content heigh is dynamic. For example content of expandable view can be changed once user is refreshing data. In this case onPreDraw returns wrong height of expandable view on each 3rd refresh attempt where on first and second render everything works nice.

Mb you faced with similar behaviour?

baggednismo commented 4 years ago

Have you tried moving the expandable height logic to its own method and calling it inside of onBindViewHolder? I also adjusted the condition. If your dataset has changed you might also want to check it in onViewRecycled()