markormesher / android-fab

Floating action button (FAB) for Android with speed-dial menu functionality
Apache License 2.0
211 stars 29 forks source link

Disappearing menu items when using v2 of library #25

Closed barbeau closed 6 years ago

barbeau commented 6 years ago

Summary:

@markormesher I did a fairly straightforward port of our project to use v2 of this library - WIP PR at: https://github.com/OneBusAway/onebusaway-android/pull/856

However, I'm seeing different behavior in terms of the visibility of menu items.

If I tap on the "Bikeshare" menu item (see left screenshot below), the entire menu item disappears (see right screenshot below):

image

If I tap on the FAB twice (to close and re-open it) then the correct state is shown (i.e., after first tapping on the "Bikeshare" menu item, I would expect it to look like this instead of disappearing:

image

Is there new behavior in v2 that I'm missing that's causing this?

Steps to reproduce:

  1. Clone and pull in WIP PR at https://github.com/OneBusAway/onebusaway-android/pull/856
  2. Run gradlew assembleObaGoogleDebug or build this build variant via Android Studio
  3. Run app
  4. Tap on hamburger menu
  5. Tap on "Settings"
  6. Tap on "Your region" and choose Tampa
  7. Tap on "Layers" FAB button (top FAB in lower-right corner)
  8. Tap on "Bikeshare" menu item

Expected behavior:

"Bikeshare" menu item should stay visible and background should change from blue to gray, indicating that the layer is disabled

Observed behavior:

"Bikeshare" menu item disappears

Device and Android version:

Samsung Galaxy S8+ w/ Android 8.0 beta

markormesher commented 6 years ago

Hey, thanks for flagging this. Looks like should be a straightforward fix: the rebuildSpeedDialMenu method that you call in this block doesn't properly handle rebuilding the menu if it is still open. I'll take a look at this one tomorrow too!

barbeau commented 6 years ago

Awesome, thanks @markormesher! And thanks for the great library!

markormesher commented 6 years ago

https://github.com/markormesher/android-fab/compare/reposition-menu-items-when-rebuilt

Will be merged + released this afternoon

markormesher commented 6 years ago

Fixed in v2.2.0 👍

barbeau commented 6 years ago

Thanks @markormesher! I'll give it a try.

barbeau commented 6 years ago

@markormesher I only see v2.1.0 on JCenter: https://bintray.com/markormesher/maven/android-fab

markormesher commented 6 years ago

My bad, should be published now: https://bintray.com/markormesher/maven/android-fab/v2.2.0