Closed NielsMasdorp closed 9 years ago
@NielsMasdorp I was planning on adding additional modes for the FAB (see issue #4) but didn't have the time lately. Sorry for that! If you want to change the code yourself have a look at the ViewDragHelper in the library. I would love a pull request!
@NielsMasdorp More specifically: if you look into the code search for "if (mHasFloatingActionButton)". This should get you the two areas that actually change the FAB position. The line faby = y - mPanelHeight + mFabExpandedY;
puts the FAB on top of the dragview (currently only used for anchor). So if you delete the rest this should work for you.
No problem! thanks for your quick reply:) more modes would be awesome though if you want to reach more people (e.g. floating action button fade out etc.) Also you are using a older version. I will try to adjust the code, will let you know!
@TR4Android if i remove all the other code that sets faby i get weird behaviour (fab dissapearing and reappearing in different spots) so i figure i have to do more then that..
@NielsMasdorp Have you done the same with the clampedY in the method dragTo( )?
I'll try to add this functionality next weekend. No promises though.
@TR4Android Yes I did so that they both look like this:
if (mHasFloatingActionButton) { final int fabclampedY = clampedY - mPanelHeight + mFabExpandedY; final int faboldTop = mFloatingActionButton.getTop(); mFloatingActionButton.offsetTopAndBottom(fabclampedY - faboldTop); }
No promises needed! I'm not in a rush or anything, I just like to know how I can do it myself, still learning:)
@NielsMasdorp Hmm. I really don't know why this code wouldn't work. Maybe you should leave some of the other if statements in the code block. I wouldn't have thought of them as totally necessary, but it might solve the issue. Otherwise you'll have to wait till next weekend.
No problem! Will try some stuff or wait for the weekend. Thanks for your help.
@TR4Android By the way, it seems that the only place fabclampedY and faby are getting initialized is in the if(!mHasAchor){} block, so fabclampedY = clampedY - mPanelHeight + mFabExpandedY; isn't even used(with me atleast). I'm guessing the mFabRatio makes it moves up a little less so it ends up at the bottom of the panel. Not sure what ratio I should use so it follows the top though.
@NielsMasdorp This line is only used when the panel has an anchor set, so it's in the else{ } part of the statement. If you don't use an anchor point this code will thus not be used.
@NielsMasdorp This should now be supported with the new version. You have to add the attribute sothree:umanoFabMode="circular_reveal"
to the FloatingActionButtonLayout in your layout and then it should give you the wanted behaviour.
@NielsMasdorp If you still have this issue or the new mode isn't quite what you wanted please reopen. Thanks!
Great fork! Do you know what I have to modify so that the FAB moves alongside the top of the panel (and not move to the bottom of the dragview) ?