material-sheet-fab icon indicating copy to clipboard operation
material-sheet-fab copied to clipboard

Circular reveal animation too fast when hiding sheet

Open nackko opened this issue 8 years ago • 9 comments

On a Nexus 5 with android 6.0.1, the circular reveal works fine when clicking on the fab but plays too fast when it's reversed to hide the sheet.

I first saw that behavior in the app I'm coding using your great library but could witness it in the sample applicaiton as well. Maybe that's the intended behavior but it doesn't match the 'preview' visible in the readme.

nackko avatar Mar 31 '16 16:03 nackko

The hide animation does look a bit fast but I'm not sure if I intentionally made it this way or if something changed in Android 6.0.1. Is the animation any different on older versions of Android?

The gif in the readme is also a bit laggy so it might just appear to be slower than it actually is.

gowong avatar Mar 31 '16 19:03 gowong

It looks better on a Galaxy Nexus under 4.3, though a tad fast to my liking ^^ It might be related to CPU load because my app is not optimized yet. What strikes me is that I can't seem to see the circular unreveal on 6.0.1, looks like the sheet disapears and the button pops in a few frames. Maybe expose an interface so we could fiddle with the values and not bother you ?

nackko avatar Mar 31 '16 19:03 nackko

The library that was implemented to make the animation (CircularReveal) only works when a layout is opening, it doesn't animate on the closing. So do you have any thoughts on how to animate it while closing?

curliq avatar Apr 03 '16 22:04 curliq

@f8full Do you happen to be using Proguard? The animations can be incredibly choppy if the Proguard rules in the readme aren't added. I've also noticed that when there are very complex view layouts on screen, the animation can lag a bit. Can you try the sample app on your devices and see if the animation is any different? If it's not laggy on the sample app, then you might want to try optimizing your layouts and see if that helps.

@joaosardinha It's already animating when closing. It's just that the sheet's visibility is being hidden partway through in an attempt to blend the multiple animations together.

gowong avatar Apr 04 '16 03:04 gowong

Well yea it's animating but looks really weird >.<

curliq avatar Apr 04 '16 13:04 curliq

Alright, after more investigation, my client code was faulty. Sorry about that. Your library is great, I even learnt how to circular reveal by reading it :+1:

nackko avatar Apr 04 '16 16:04 nackko

Had a big brain fart : I thought my problem was in the sheet reveal, and not hiding. I can confirm the sample app displays the same "faulty" behavior on closing : circular unreveal last for a few frames and button pops. This is weird because the reveal from fab to sheet just looks perfect. I don't use proguard and yeah, my layouts are a bit complex. I'll make sure to investigate deeper after the all nighters and release :)

nackko avatar Apr 04 '16 17:04 nackko

The animation values may need some tweaking. I don't have time to look at it right now but feel free to play around with it and submit a PR if you think it looks good!

gowong avatar Apr 05 '16 18:04 gowong

Sure thing ! And maybe, I'd code an interface to allow client code to tweak it. Just maybe because I never contributed to a library before. In fact, I never contributed at all. But I'm eager to learn and we all start somewhere. I might bother you if after RTFM I'm still unsure on how to proceed.

nackko avatar Apr 06 '16 04:04 nackko