Skip to content
This repository has been archived by the owner on Oct 23, 2020. It is now read-only.

FloatingActionButton sample is not working properly for animated fab menu. #78

Closed
VishalAdhau opened this issue Jun 29, 2015 · 6 comments

Comments

@VishalAdhau
Copy link

Tested on
Model number : Micromax A290
Android version : 4.4.2

FloatingActionButton sample is not working for animated fab menu on Android 4.4.2. It was working fine on FloatingActionButton version 1.5.0.
Root cause :
In version 1.5.1, mMenuOpened = true is moved inside the postDelay(). On Android version 4.4.2 OnLayout() gets called for each item after fab.show(animated) and there is a mMenuOpened check for fab item that hides the fab menu button.

@Clans
Copy link
Owner

Clans commented Jun 30, 2015

I've checked on Android Emulator 4.4.4 and on Samsung Galaxy S5 4.4.2 - everything works fine.

@VishalAdhau
Copy link
Author

its reproducible on below device
Model number : Micromax A290
Android version : 4.4.2

Please check the video
https://www.dropbox.com/s/jlhgqgmmymflrm3/VID_20150630_132114.mp4?dl=1

@VishalAdhau
Copy link
Author

Is there any specific reason of adding below code in onLayout() of FloatingActionMenu.java?
if (!mMenuOpened) {
fab.hide(false);
}

In my case onMeasure() and onLayout() gets called multiple times in between animation to show the fab. In this case changed parameter in onLayout() has false value.

Issue can be handled by checking changed parameter value in onLayout(), if changed parameter is false, no need to layout the children's in OnLayout().

Please let me know if you need any inputs.

@Clans
Copy link
Owner

Clans commented Jul 8, 2015

Could you please check this build on your device?
https://dl.dropboxusercontent.com/u/4981502/sample-debug.apk

@VishalAdhau
Copy link
Author

Thanks a lot,
Fab animation works fine, I think you missed to handle same for fab labels. Please also handle it for fab label, there is same check for labels in onLayout().
if (!mMenuOpened) {
label.setVisibility(INVISIBLE);
}

Please check the video(using sample-debug.apk)
https://www.dropbox.com/s/51n3hea2feyx3t8/VID_20150709_130507.mp4?dl=1

Clans added a commit that referenced this issue Jul 10, 2015
@Clans Clans closed this as completed Jul 10, 2015
@VishalAdhau
Copy link
Author

Thanks Clans,
It works awesome.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants