android-floating-action-button icon indicating copy to clipboard operation
android-floating-action-button copied to clipboard

Support for the new CoordinatorLayout

Open lynfogeek opened this issue 9 years ago • 23 comments

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.

lynfogeek avatar Jun 01 '15 10:06 lynfogeek

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 avatar Jun 01 '15 10:06 CodeBendr

@CodeBendr of course! http://android-developers.blogspot.nl/2015/05/android-design-support-library.html

lynfogeek avatar Jun 01 '15 11:06 lynfogeek

I'll definitely do this.

chalup avatar Jun 02 '15 06:06 chalup

+1

mostafazh avatar Jun 15 '15 03:06 mostafazh

+1 This is really useful!

scarletsky avatar Jun 19 '15 07:06 scarletsky

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.

nicktogo avatar Jun 20 '15 20:06 nicktogo

When is this feature expected to be implemented?

xdbas avatar Jul 17 '15 09:07 xdbas

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.

PaulWoitaschek avatar Jul 18 '15 09:07 PaulWoitaschek

@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.

chalup avatar Jul 18 '15 10:07 chalup

I could also just provide the java file and you can include it how ever you like. Just tell me.

PaulWoitaschek avatar Jul 18 '15 16:07 PaulWoitaschek

@Ph1b Open PR or put it in gist, I'll think about the best way to include it.

chalup avatar Jul 19 '15 08:07 chalup

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.

PaulWoitaschek avatar Jul 25 '15 11:07 PaulWoitaschek

link is broken :(

ghost avatar Sep 16 '15 12:09 ghost

history

PaulWoitaschek avatar Sep 16 '15 13:09 PaulWoitaschek

@Ph1b how must I set the behaviour to the FAB?

nomisRev avatar Nov 02 '15 13:11 nomisRev

Waiting for this feature

mangeshghotage avatar Nov 03 '15 07:11 mangeshghotage

@vergauwen-simon In xml by app:layout_behavior="de.ph1b.audiobook.uitools.FabBehavior"

PaulWoitaschek avatar Nov 09 '15 17:11 PaulWoitaschek

@nicktogo You can use Handler instead.

AndroidDeveloperLB avatar Dec 30 '15 14:12 AndroidDeveloperLB

+1

sandrocsimas avatar Apr 10 '16 23:04 sandrocsimas

here is a solution: https://lab.getbase.com/introduction-to-coordinator-layout-on-android/

ohwald avatar Apr 13 '16 07:04 ohwald

@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.

PaulWoitaschek avatar Apr 13 '16 08:04 PaulWoitaschek

Thanks for the PR, it works

nakirinakuru avatar Apr 20 '17 09:04 nakirinakuru

@chalup will you include PaulWoitaschek's PR?

ja-kub avatar Jul 19 '17 23:07 ja-kub