android-floating-action-button
android-floating-action-button copied to clipboard
Support for the new CoordinatorLayout
WIth the new Design library from Google comes the CoordinatorLayout that allows the official FAB to react to different events such as scrolling or the entrance/dismiss of a Snackbar below the FAB.
Such behavior would be great, as this library still handle many more features than the official FAB.
Is this currently available?!
Sent from my iPhone 6
On Jun 1, 2015, at 10:14 AM, Arnaud Camus [email protected] wrote:
WIth the new Design library from Google comes the CoordinatorLayout that allows the official FAB to react to different events such as scrolling or the entrance/dismiss of a Snackbar below the FAB.
Such behavior would be great, as this library still handle many more features than the official FAB.
— Reply to this email directly or view it on GitHub.
@CodeBendr of course! http://android-developers.blogspot.nl/2015/05/android-design-support-library.html
I'll definitely do this.
+1
+1 This is really useful!
I use Timer as a workaround, it seems ridiculous. I will put my code here, hoping it can help someone:)
//get your FloatingActionMenu or FloatingActionButton
FloatingActionMenu menu = (FloatingActionsMenu) findViewById(R.id.menu);
//show your Snackbar
Snackbar.make(parentLayout, "Selected!", Snackbar.LENGTH_SHORT).show();
//move the menu up
menu.animate().translationYBy(-80);
//set a Timer to move the menu down
Timer timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
menu.animate().translationYBy(80);
}
}, 1800);//Snackbar's short duration is 1500ms, while the long one is 2750ms, adjust the delay of timer to fit the moment the Snackbar dismiss
Looking forward to the real implementation.
When is this feature expected to be implemented?
I have implemented it myself in the past. Going to make a pull request if that is wanted. But that will involve the support library as a dependency. Is that wanted? Else this can't be implemented.
@Ph1b Ideally this should be an optional dependency, but AFAIK gradle doesn't support it. As a workaround we can create a submodule with Behavior implementation. The only downside is that we won't be able to specify DefaultBehavior for FAB/FAM.
I could also just provide the java file and you can include it how ever you like. Just tell me.
@Ph1b Open PR or put it in gist, I'll think about the best way to include it.
It seems I have less time than I thought ;-)
So here we go. I aggree to license my changes under your license. But as it was mostly a copy and paste I don't think I have too much a creative licensing right ;-) It's basically the ported behavior of googles FAB for the SnackBar only. Building upon that one could also implement the other layout types easily.
link is broken :(
@Ph1b how must I set the behaviour to the FAB?
Waiting for this feature
@vergauwen-simon
In xml by
app:layout_behavior="de.ph1b.audiobook.uitools.FabBehavior"
@nicktogo You can use Handler instead.
+1
here is a solution: https://lab.getbase.com/introduction-to-coordinator-layout-on-android/
@sakuyayc I posted the solution already on 25th of July 2015 but it was not yet included into the library.
@chalup If this is wanted I can do a pull requst.
Thanks for the PR, it works
@chalup will you include PaulWoitaschek's PR?