1. When a new tab indicator drawable is set, we didn't correctly restore the previous set indicator height to the new drawable, or set the drawing bound to the intrinsic height of the drawable, if the indicator height was not specified. This result in a 0-height drawing bound after setting the tab indicator, which makes it disappear and can never go back if the tab indicator gravity is not "stretch" (which will recalculate the height after moving the indicator). Fixes this by correctly set the drawing bounds after a new tab indicator drawable is set.
2. After we set full-width flag of tab indicator, the width won't be updated until we move the tab indicator. Fixes this by explicitly triggering the recalculation of tab indicator's drawing bound after changing the flag.
Resolves: https://github.com/material-components/material-components-android/issues/2354
PiperOrigin-RevId: 397823617
Helpful for the case where the Top App Bar text/icons are still visible underneath a transparent status bar, when the Top App Bar is scrolled up.
PiperOrigin-RevId: 384985602
MaterialButton is using TextViewCompat.setCompoundDrawablesRelative() under the hood to implement setIcon() operation. TextViewCompat won't call its compound drawables' setVisible() method, on which we rely to start progress indicator drawables automatically.
Calls setVisible() explicitly to start progressing.
Also adds a demo to catalog.
Resolves https://github.com/material-components/material-components-android/issues/2095
PiperOrigin-RevId: 383483364
The listeners were deprecated in favor of `NavigationBarView#OnItemSelectedListener` and `NavigationBarView#OnItemReselectedListener`, but deprecation documentation was never added, so it's unclear what developers should use instead.
Also removed internal usages of these deprecated usages in the catalog and in tests.
PiperOrigin-RevId: 378021534
Changed the demo to use toggle button groups instead of a combination of "manual toggle buttons", regular buttons, and AppCompat toggle buttons. This creates consistency throughout the demo and makes it easier to understand which demo control modifies which feature of the BottomAppBar.
Also:
- Changed the hide on scroll demo control to use a switch, as opposed to a ToggleButton. It was previously very hard to tell which position was on and which was off; a switch does a better job of communicating on/off states.
- Added labels for the toggle groups, which makes it easier to understand which demo control applies to which aspect of the BAB.
PiperOrigin-RevId: 377132368