Material-components-android: Add a public API for BottomAppBar in order to show/hide it programmatically

Created on 27 Aug 2018  ·  6Comments  ·  Source: material-components/material-components-android

Could you please add some simple public API for BottomAppBar in order to _show/hide_ it programmatically.

For now, I've created the following workaround but I think it will be more logical to have it officially 👨‍💼

Thanks!

Most helpful comment

That change will be available in the next release.

All 6 comments

I am just curious, why do you need to show or hide BottomAppBar programmatically since show/hide on scroll already works when you set app:hideOnScroll="true" attribute in xml?

hideOnScroll works well of course. But in my case, I want to show controls again when a user is about to start searching and it's not related to scrolling at all so that's why I need it. Also, I can imagine a case with some immersive-kinda manual mode when you want to show/hide all distracting details.

In a case of AppBarLayout, I am able to use its layout params and modify ScrollFlags in order to achieve such result.

Oh, I see it, you are right. It should be nice to have such an API.

Are these changes available?
I am using com.google.android.material:material:1.0.0 but the mentioned methods' visibility are still protected both in BottomAppBar and HideBottomViewOnScrollBehavior classes.

That change will be available in the next release.

Was this page helpful?
0 / 5 - 0 ratings