Closed IvanBrazza closed 7 years ago
Hi. I'm not sure what I should be looking at in that image. Is it the right link?
A similar issue has cropped up before (#28), and it isn't immediately obvious to me where the bottleneck is. If you could run a profiler on your app and let me know which colorpicker functions show up as slow, that would be very useful.
Hi, apologies if that wasn't clear, it should be a video showing that when the ColorPickerView is included (i.e. in the view when "Family Bathroom Lightstrip" is clicked) there's a lot of lag in the transition animation.
I ran a method profile and it looks like it's the onSizeChanged callback running makeBitmap a lot that's causing the issue:
Perhaps there could be a way to rate limit the callback?
Ah -- I see the video now: Was getting confused by the hover behaviour and thought it was a GIF.
So I suppose when the size of the view is animated it's generating a lot of bitmaps -- I'll investigate.
Is there a way of animating these views by cropping out the child view? (I.e. have the color picker stay the same size and just be revealed when the card grows.) That might be the most effective workaround -- It would avoid a lot of layout recalculation as well as the bitmap generation.
I've pushed a commit which should improve your animations. I haven't released a new version to jcenter yet -- still experimenting with generating the bitmap in a worker thread -- but if you build the library from source you can try it out now.
I did look for a callback for when the animation is complete, but I couldn't find one; which is strange because there's one for before it starts...
However, your commit worked! The animations are buttery smooth now that the bitmap is only being drawn once. Thanks for your help and for a great library - and have a great new year :)
Great! I've published an official release with this fix (version 2.1.0) so you can go back to using the jcenter dependency if you prefer.
Thanks for your help.
My app uses ActivityOptionsCompat.makeSceneTransitionAnimation() to animate the transition between clicking a card in a RecyclerView to an activity which may or may not contain ColorPickerView depending on the card that's been clicked on. The view has a default visibility of GONE and is set to VISIBLE in OnCreate when required, but this appears to cause a huge amount of lag in the transition animation.
Example: https://goo.gl/photos/G9ansCwnEVZq9P9q6
More than happy to provide any code or other information.