Changes:
- minHeight for BottomNavigationView is actually a minimum height, not an exact height; the bar height now wraps content properly
- For BottomNavigationView, bottom item padding now counts from the bottom of the label group instead of from the lowest label baseline. The label TextViews also have a min height of the line height supplied by the provided TextAppearance. This aligns with our m3 specs
- Structural changes in navigation item layouts. Previously the label and the icon were not aware of each other in a FrameLayout and could potentially overlap; this is no longer the case as they are in a LinearLayout
- padding between icon and label is 4dp as per specs
- Centering logic changed to center the icon and label as a group, not separately
PiperOrigin-RevId: 635922505
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
to be easier used by developers and other libraries
An example of where the current implementation fails is in Jetpack Navigation component where we rely on setOnNavigationItemSelectedListener and the similar methods in NavigationBarView (setOnItemSelectedListener) are protected.
PiperOrigin-RevId: 367467206
Previously, `BottomNavigationView` was using `MaterialShapeDrawable` but an elevation value that was set would not actually take effect. It turns out that this is because `BottomNavigationView` did not properly call the appropriate elevation methods. This commit fixes the handling of elevation. It also removes the top divider in pre-21 cases where there is a `MaterialShapeDrawable` background - otherwise the top divider is kept for compatibility with existing legacy versions.
PiperOrigin-RevId: 335867951
BottomNavigationView.
This commit removes backgroundTint from the BottomNavigationView styles and instead sets the respective default colors as ColorDrawable backgrounds of the BottomNavigationView. This allows BottomNavigationView to respect colors set in android:background without requiring the client to override backgroundTint.
PiperOrigin-RevId: 244669964
TODO:
- update javadocs to provide guidance on how to interact with BottomNavigation + Badging.
- Save badge states.
- Support displaying badges when bottom navigation item doesn't show an icon.
PiperOrigin-RevId: 244197244
TODO:
- update javadocs to provide guidance on how to call Badging API.
- Save badge states.
- Support displaying badges when bottom navigation item doesn't show an icon.
PiperOrigin-RevId: 242675939
This method does not provide clear value to the user. I considered deprecating it, but since it was introduced in an alpha release, it can just be deleted.
PiperOrigin-RevId: 193966844