gowong / material-sheet-fab

Android library that provides the floating action button to sheet transition from Google's Material Design.
MIT License
1.58k stars 255 forks source link

Sheet is not hiding after fast item click #12

Closed alexeyr15 closed 9 years ago

alexeyr15 commented 9 years ago

Steps to reproduce in the sample:

  1. Click FAB to open the sheet.
  2. Immediately (with no delay) click on some item, for example, "Recording".
  3. The toast "Item pressed" appears but the sheet is not hiding.
gowong commented 9 years ago

The sheet isn't hiding because if an animation is already in motion (opening the sheet), then it won't start the hide sheet animation. The sample app doesn't account for this and simply shows the toast on every item press.

@alexey-rabets Is this behavior causing an issue for your app?

alexeyr15 commented 9 years ago

I think it is a user experiense issue rather than an app issue when a user sometimes click a sheet item and a sheet is not hiding (a user should expect the same behaviour like for popup menu). So can it be fixed in an app to stop the opening animation and start the closing one on item click or some other way?

gowong commented 9 years ago

It's something that has to be changed in the library. I don't think it's too high of a priority since the animations are fairly quick, making it less likely for users to run into this. It can definitely be improved though, just need to figure out a good way for the animations to cancel each other.