130 Commits

Author SHA1 Message Date
rightnao
b184df6848 [NavigationBar] Add active indicator attributes to change active indicator height, width, and horizontal margins when it is in an expanded state (ie. when start icon gravity is set to 'start')
PiperOrigin-RevId: 657266378
2024-07-30 09:12:47 -07:00
Material Design Team
3ea7709cff [BottomNavigationView] Fixing bad link in class doc comment
PiperOrigin-RevId: 656464997
2024-07-30 09:04:02 -07:00
rightnao
3fbb198a1c [BottomNavigationView] Update max item count to 6
PiperOrigin-RevId: 650353790
2024-07-08 20:34:03 +00:00
pekingme
61597e1aed [Tokens] Refreshed tokens in version "4.0.0"
PiperOrigin-RevId: 641994522
2024-06-11 18:58:26 +00:00
rightnao
87ab6606fd [NavigationRail] Add an attribute to control how we measure the bottom padding of the navigation item
PiperOrigin-RevId: 640992331
2024-06-11 18:57:33 +00:00
rightnao
abb6e91a0a [NavigationBar] Add new itemIconGravity attribute
PiperOrigin-RevId: 638866190
2024-06-05 18:24:24 +00:00
rightnao
60a525a167 [BottomNavigationView][NavigationRailView] Modifying NavigationBarView to match more to specs and restructuring layout to prepare for expressive changes
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
2024-05-23 14:54:36 +00:00
pubiqq
510881a469 [Internal] Stop using deprecated androidx.core.view.* methods
Resolves https://github.com/material-components/material-components-android/pull/4117

GIT_ORIGIN_REV_ID=dd157e8360c2511810496693cec1616fce578655
PiperOrigin-RevId: 632284856
2024-05-13 17:37:38 +00:00
Ga\u00ebtan Muller
b3fe6a7f61 [Cleanup] Remove redundant version checks for api <= 19.
Resolves https://github.com/material-components/material-components-android/pull/3849

GIT_ORIGIN_REV_ID=47bb2fcc8031740e5a7d4f741f1ada2af025e126
PiperOrigin-RevId: 632154861
2024-05-09 18:46:02 +00:00
rightnao
3880efefef [Badge] Adjust badges to fit within the bounds of the first ancestor view that clips its children to avoid getting cut off
PiperOrigin-RevId: 629810011
2024-05-02 15:42:17 +00:00
pekingme
28cc2441d0 [Tokens] Updated to version 2.3.4.
PiperOrigin-RevId: 610835532
2024-02-29 08:36:02 -08:00
pekingme
ee7b4bddb4 [Tokens] Added formatting to break long lines and differentiate different comments.
PiperOrigin-RevId: 605684816
2024-02-12 18:03:59 +00:00
pekingme
89212044a9 [Tokens] Updated to v0.213.
PiperOrigin-RevId: 603749766
2024-02-06 14:30:16 +00:00
pekingme
08d7ded67b [Tokens] Upgraded to v0.207.
PiperOrigin-RevId: 600947836
2024-01-24 21:05:53 +00:00
pekingme
4ccaaaa31d [Tokens] Upgraded to v0.203
PiperOrigin-RevId: 579928128
2023-11-08 15:12:21 +00:00
pekingme
637362d597 [Tokens] Upgraded to v0.195
PiperOrigin-RevId: 579905417
2023-11-06 20:27:15 +00:00
pekingme
0463c507d7 [Tokens] Upgraded to v0.185
PiperOrigin-RevId: 579904837
2023-11-06 20:26:18 +00:00
pekingme
bfee8a74d7 [Tokens] Upgraded to v0.175.
PiperOrigin-RevId: 572648883
2023-10-12 11:04:28 -07:00
rightnao
78cc54b8c3 [Badge][NavRail][BottomNavBar] Adjust badge vertical offset for certain components to fit design requirements
PiperOrigin-RevId: 569527192
2023-10-02 13:41:39 +00:00
pekingme
8204856dd4 [Token][Color] Upgraded to v0.170 for tonal surface colors.
PiperOrigin-RevId: 555230534
2023-08-09 19:03:25 +00:00
rightnao
e3b255b3a0 [Docs] Crosslink github docs in javadocs
PiperOrigin-RevId: 546393704
2023-07-11 19:37:37 +00:00
rightnao
7bd9724078 [BottomNavigationView] Integrate tokens and add shape appearance support
PiperOrigin-RevId: 524919091
2023-04-19 13:53:26 -07:00
rightnao
b706506c3d [Badge] Add attribute to automatically adjust badge so that it is within the anchor view's grandparent view's bounds
PiperOrigin-RevId: 523171594
2023-04-11 20:00:06 -07:00
pekingme
9f1caa2c64 [Tokens] Upgraded to v0.162.
PiperOrigin-RevId: 517446114
2023-03-20 21:23:07 +00:00
pekingme
23dc14ca3a [Tokens] Updated to v0.157.
PiperOrigin-RevId: 505978081
2023-01-31 20:01:13 +00:00
pekingme
355702f954 [BottomNavigation] Integrated tokens.
Created a new copy of CSL of icon/text/ripple tint for navigation bar. Before this change, they are shared with navigation rail.
Changed item text appearance from textAppearanceTitleSmall to textAppearanceLabelMedium

PiperOrigin-RevId: 503210110
2023-01-24 16:45:31 +00:00
rightnao
e3937483c3 [BottomNavigationView] Remove elevation shadows
PiperOrigin-RevId: 483721316
2022-10-28 07:42:47 -07:00
Anyer Castillo
a2ce1dd102 [BottomNavigation] Fix hardcoded number of children
Resolves https://github.com/material-components/material-components-android/pull/2923

GIT_ORIGIN_REV_ID=54a68268367a3f0efda6928e10b5f9c299502121
Co-authored-by: imhappi
PiperOrigin-RevId: 475346937
2022-09-20 12:58:29 -04:00
pubiqq
41d4460744 [Internal] Simplify size computations for some views
Resolves https://github.com/material-components/material-components-android/pull/2807

GIT_ORIGIN_REV_ID=199fecd89fb69acaaab2689a4f53966ea1dbd7de
PiperOrigin-RevId: 464151991
2022-08-04 14:24:11 -04:00
hunterstich
9a16aa471b [NavigationBar] Update active indicator to new shape system.
PiperOrigin-RevId: 446760684
2022-05-05 15:16:50 -04:00
afohrman
1222268437 [BottomNavigationView] Added supported NavigationBarView#LabelVisibilityMode alternative to deprecated BottomNavigationView#LabelVisibilityMode.
PiperOrigin-RevId: 430230181
2022-02-23 11:21:14 -08:00
Material Design Team
a487c89185 Internal change
PiperOrigin-RevId: 412135443
2021-11-29 17:35:39 +00:00
conradchen
adbcf8cbbc [M3][BottomNavigation] Set backgroundTint explicity to @null in M3 bottom navigation syles
PiperOrigin-RevId: 410346437
2021-11-29 16:27:58 +00:00
jeremymuhia
5da2d2d0dc [M3][BottomNav] update bottom nav dev doc
PiperOrigin-RevId: 398779288
2021-09-28 14:22:46 +00:00
hunterstich
c6d0f7c785 [M3][NavigationRail] Added new navigation rail styles.
PiperOrigin-RevId: 397846116
2021-09-21 08:35:12 -07:00
hunterstich
f2eaf0c40a [M3][NavigationBar] Reorganize resources.
PiperOrigin-RevId: 392693833
2021-08-24 15:53:56 -04:00
hunterstich
999b24783c [M3][NavigationBar] Add new navigation bar styles.
PiperOrigin-RevId: 392688526
2021-08-24 15:52:44 -04:00
Ian Lake
501ef8ea2a [NavigationRailView] Update inset handling for Navigation Rail & Bottom Nav
Resolves https://github.com/material-components/material-components-android/pull/2253

GIT_ORIGIN_REV_ID=b6c2270b8855e38231c29cbfd48949afd785258c
PiperOrigin-RevId: 383632982
2021-07-08 16:01:01 +00:00
afohrman
720088c5c2 [BottomNavigationView] Added deprecation Javadoc for BottomNavigationView#OnNavigationItemSelectedListener and BottomNavigationView#OnNavigationItemReselectedListener.
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
2021-06-09 18:20:52 +00:00
hunterstich
943c4f0eed [BottomNavigationView] Updated to explicitly read and set minimum height.
PiperOrigin-RevId: 368831987
2021-04-16 18:02:00 -04:00
hunterstich
7eea2b25bc [Navigation bar] Add active indicator.
PiperOrigin-RevId: 368261456
2021-04-16 12:42:14 -04:00
Material Design Team
a200a5ef17 [NavigationRail] Moves OnNavigationItem listeners to the NavigationBarView class
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
2021-04-08 20:43:35 -04:00
dniz
fed90a9e57 [Nav Rail / Bottom Nav / Nav Bar] API Fixes
Resolves https://github.com/material-components/material-components-android/issues/2131

PiperOrigin-RevId: 365873683
2021-03-31 10:27:45 -04:00
raajkumars
aca5bfb6f7 [Bottom Navigation] Extracted common logic from bottom navigation component into navigation package.
PiperOrigin-RevId: 345029590
2020-12-02 09:55:26 -05:00
raajkumars
be616abf49 [internal] Moved common ids from bottom navigation to central location so that it can be reused.
PiperOrigin-RevId: 340255767
2020-11-03 11:11:54 -05:00
Material Design Team
cf9027f098 [TabLayout] Add a localized a11y string for a tab
PiperOrigin-RevId: 338706340
2020-10-23 12:31:51 -07:00
connieshi
9487c33b8a Automated g4 rollback of changelist 336347365
PiperOrigin-RevId: 336978123
2020-10-15 13:23:56 -07:00
Material Design Team
0f717f8cce Automated g4 rollback of changelist 336306885
PiperOrigin-RevId: 336347365
2020-10-15 13:01:02 -07:00
connieshi
5e35d14c18 [Badge] Update badge to support being anchored to any view in pre 18.
In <API18, BadgeDrawable will dynamically 1) wrap the anchor in a FrameLayout and 2) replace the anchor with the FrameLayout in the anchor' view hierarchy. BadgeDrawable will set itself as foreground on the FrameLayout.

If the user does not want BadgeDrawable to manipulate its view hierarchy, the user can pass in an instance of FrameLayout `customBadgeParent` in #attachBadgeDrawable instead.

Labeled BadgeUtils as experimental and removed the RestrictedTo(Scope.Library) annotation.

Updated TopAppBar main demo to show a badge on a toolbar menu item.

PiperOrigin-RevId: 336306885
2020-10-15 12:31:14 -07:00
afohrman
9a5192ae5e [BottomNavigationView] Updated BottomNavigationView to draw compat shadows and elevation overlays in pre-21 and remove top divider for non-legacy backgrounds.
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
2020-10-08 16:13:02 +00:00