material-components / material-components/material-components-android

How to get ExtendedFloatingActionButton to behave similar to FloatingActionButton when interacting with CoordinatorLayout and scrolling?

Open
#880 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request Widget: FloatingActionButton
Dominant language
Java
Stars
17.4k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

Trying to use the new `ExtendedFloatingActionButton`. It seems by default `ExtendedFloatingActionButton` acts differently from `FloatingActionButton` when interacting with `CoordinatorLayout`. See here the red one is the typical `FloatingActionButton` and the 2 black ones are the `ExtendedFloatingActionButton` with exactly the same setup (except for colors and text).
What I need is for the black ones to hide away just like the red one does.

![FAB vs EXFAB small](https://user-images.githubusercontent.com/12901702/71912566-bd7ee000-3143-11ea-83d5-d9b0e4602f0c.gif)

Here's the layout:
```


```

I see in source that there's a nested class `ExtendedFloatingActionButton.ExtendedFloatingActionButtonBehavior` and it seems to have maybe some properties that might be useful/related to this such as `autoHideEnabled` and `autoShrinkEnabled` but the class is protected and I can't figure out how it is meant to be accessed.
Please help.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading ExtendedFloatingActionButton.ExtendedFloatingActionButtonBehavior and the autoHideEnabled and autoShrinkEnabled properties mentioned in the issue, then compare its CoordinatorLayout interaction with FloatingActionButton. Reproduce the supplied layout and scrolling behavior; done means the extended buttons hide or otherwise match the requested FloatingActionButton behavior, with coverage for the demonstrated setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.