101 Commits

Author SHA1 Message Date
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
9f2e6864d2 [NavigationBar] Set badges to be null instead of removing them from the sparse array so that removing badges before restoring badge states will not override the current state
PiperOrigin-RevId: 546027617
2023-07-07 17:49:34 +00:00
rightnao
8b016a0e8b [NavigationRail][Badge] Added bigger padding in between items on the navigation rail when font scale is large so there is more room for the badges when they are forced inside the view bounds
Also fixed bug with navigation rail items moving when there is a badge vs when there is no longer a badge, and adds 4dp padding between icon container/active indicator and label text as per specs https://m3.material.io/components/navigation-rail/overview

PiperOrigin-RevId: 540349399
2023-06-14 12:47:57 -07:00
afohrman
f2e70d2d66 [Android U] Replaced BuildCompat#isAtLeastU() method calls with explicit SDK checks for UPSIDE_DOWN_CAKE.
Before 1.12.0-alpha01 which was released on 6/7, BuildCompat#isAtLeastU() only returns true if API level is greater than 33 and the version running is a pre-release. Two things happened on 6/7 -- the version became a "platform stable" version, and core library version 1.12.0-alpha01 was released, which changes BuildCompat#isAtLeastU() to return true if the version is 34 and stable.

PiperOrigin-RevId: 540304068
2023-06-14 12:45:51 -07:00
hunterstich
a67a885668 [Predictive Back] Update components to use BackEventCompat
Clients should prefer listening to back events using androidx.activity.OnBackPressedCallback which has been updated to forward BackEventCompat objects in androidx.activity:activity:1.8.0-alpha05. This updates component predictive back APIs to take in BackEventCompat objects instead of android.window.BackEvent objects to simplify usage - getting rid of the need for version checks and object conversions.

PiperOrigin-RevId: 540290323
2023-06-14 12:44:53 -07:00
pfthomas
022e217770 [Navigation] Add itemTextAppearanceActiveBoldEnabled attr
Resolves https://github.com/material-components/material-components-android/issues/3191
Resolves https://github.com/material-components/material-components-android/issues/3293

PiperOrigin-RevId: 539977391
2023-06-14 15:14:24 +00:00
hunterstich
c031144d26 [NavigationView] Updated NavigationView to use ViewOutlineProvider to handle corner clipping when possible and remove drawerLayoutCornerClippingEnabled attribute.
PiperOrigin-RevId: 527633449
2023-04-27 16:38:17 -04:00
rightnao
3b2b827597 [NavigationRail] Integrate tokens and add shapeAppearance attribute
PiperOrigin-RevId: 525551069
2023-04-24 15:28:56 -04:00
dsn5ft
9405121f62 [Predictive Back] Update side container back helper to support containers with arbitrary child views
PiperOrigin-RevId: 525466973
2023-04-19 14:12:04 -07:00
rightnao
7bd9724078 [BottomNavigationView] Integrate tokens and add shape appearance support
PiperOrigin-RevId: 524919091
2023-04-19 13:53:26 -07:00
pekingme
9f1caa2c64 [Tokens] Upgraded to v0.162.
PiperOrigin-RevId: 517446114
2023-03-20 21:23:07 +00:00
hunterstich
0a0bff1489 Automated g4 rollback of changelist 515410464
PiperOrigin-RevId: 517409678
2023-03-20 21:21:59 +00:00
dsn5ft
2c297faf4b [Predictive Back][Navigation Drawer] Infrastructure for back handling in components + Navigation Drawer predictive back support
- Added MaterialBackHandler interface and MaterialBackOrchestrator class
- Implemented animations in MaterialSideContainerBackHelper for NavigationView when DrawerLayout parent

PiperOrigin-RevId: 517399606
2023-03-20 21:10:22 +00:00
hunterstich
0c62df4a60 Automated g4 rollback of changelist 515343383
PiperOrigin-RevId: 515410464
2023-03-13 21:20:02 +00:00
hunterstich
1d2a59ba37 [NavigationRail][NavigationBar] Fixed active item focused state color not being visible.
The color state list used for the ripple to indicate focal/hover state was being set as the background of an item and being obscured by the active indicator. It is now the foreground and visible on top of the active indicator.

PiperOrigin-RevId: 515343383
2023-03-13 21:17:13 +00:00
hunterstich
e3b493f5eb [NavigationView] Removed canvas clipping by default and added an option to enabled/disable manually
Clipping was used to clip navigation view and its children to a shape appearace. This is primarily useful when using a headerLayout that contains full bleed content that would obscure the top end corner shape. Material3 does not use as much imagery/color in the NavigationView header and disabling clipping by default is a nice performace improvement.

PiperOrigin-RevId: 513301639
2023-03-01 23:08:28 +00:00
pubiqq
e06a11982b [Internal] Add compat method to get the screen size
Resolves https://github.com/material-components/material-components-android/pull/3221

GIT_ORIGIN_REV_ID=9323e23689386561d38b0c8c73114e0db7a30557
PiperOrigin-RevId: 509548792
2023-02-15 10:25:53 -08: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
hunterstich
a4107b9072 Automated g4 rollback of changelist 499286690
PiperOrigin-RevId: 499947079
2023-01-10 02:42:19 -05:00
pekingme
8c8db7e874 [NavigationView] Integrated tokens.
Changed the width from 280dp to 360dp

PiperOrigin-RevId: 499479992
2023-01-05 12:51:35 -05:00
hunterstich
acfd97f7ac [NavigationBar][NavigationRail] Expose getMenuView
PiperOrigin-RevId: 499286690
2023-01-05 12:50:15 -05:00
rightnao
dfb9e81eeb [Motion] Motion tweaks
PiperOrigin-RevId: 493105642
2022-12-06 15:22:34 -05:00
rightnao
cb384c5c2c [NavigationView] Disable drawing left and right insets if the nav bar is not edge to edge
resolves https://github.com/material-components/material-components-android/issues/3016

PiperOrigin-RevId: 484304490
2022-10-28 07:44:17 -07:00
pfthomas
11e98f2d11 [BottomNavigationView][NavigationRailView] Updated active text label to use a bold typeface.
PiperOrigin-RevId: 476415508
2022-09-26 22:11:51 +00:00
pubiqq
88c448ed19 [NavigationView] Fix subheaderInsetEnd setter
Resolves https://github.com/material-components/material-components-android/pull/2979
Resolves https://github.com/material-components/material-components-android/issues/2975
Resolves https://github.com/material-components/material-components-android/issues/2976

GIT_ORIGIN_REV_ID=47659c14a2bc72f5c383e3b59dd9d45b60f6af95
PiperOrigin-RevId: 475868928
2022-09-22 17:36:02 +00:00
hunterstich
11578b34f3 [NavigationBar][NavigationRail] Updated item ripple to be contained within active indicator shape when enabled.
PiperOrigin-RevId: 453449225
2022-06-07 18:49:19 -07:00
pekingme
cfeb31a3f2 [Shape][NavView] Migrate M3 NavigationView style to new shape system.
PiperOrigin-RevId: 448042553
2022-05-11 15:01:26 -04:00
hunterstich
1995438305 [NavigationBar][NavigationRail] Updated active indicator to use new motion system.
PiperOrigin-RevId: 447463375
2022-05-09 14:48:11 -04:00
pubiqq
3ca41be8f0 [General] Fix typos
Resolves https://github.com/material-components/material-components-android/pull/2654

GIT_ORIGIN_REV_ID=b8f6728979875629f2c813ef90d2f671cf56b4eb
PiperOrigin-RevId: 442852630
2022-04-19 14:48:55 -04:00
jeremymuhia
cfc307ed4e [NavigationView] fix navigation view item ripple
PiperOrigin-RevId: 434516655
2022-03-14 18:55:40 +00:00
raajkumars
18554d9cb5 [BottomNavigationView] Fix for IllegalArgumentException in preview mode.
Resolves https://github.com/material-components/material-components-android/issues/2489

PiperOrigin-RevId: 428861308
2022-02-15 21:29:32 +00:00
hunterstich
d66676fd6b [NavigationBar][NavigationRail] Removed font scaling from NavigationBarView item labels.
PiperOrigin-RevId: 426264069
2022-02-03 20:20:31 -08:00
conradchen
b3db1cc028 [Badge] Prevent multiple badges being attached to a menu item at the same time
Fixes the logic in NavigationBarMenuView.restoreBadgeDrawables(), which may override the newly created badges with the restored drawables incorrectly. Also adds a safe guard that removes the previously attached badges if any, before attaching a new badge.

PiperOrigin-RevId: 424923078
2022-01-31 18:12:50 -08:00
Material Design Team
285fa9de30 Automated g4 rollback of changelist 422930284
PiperOrigin-RevId: 422949121
2022-01-20 10:24:30 -05:00
Material Design Team
c52b95d4d5 Automated g4 rollback of changelist 420096508
PiperOrigin-RevId: 422930284
2022-01-19 19:34:23 -05:00
conradchen
bbbeacd64e [Badge] Refactor Badge state managing logic
This CL fixes a couple of badge state related issues. First, it prevents the badges created before restoring instance states from being overwritten by the old instance states. Second, it makes badges reload their default style settings everytime when its being recreated so if the environment has been changed, the default values will reflect the environment change.

This CL also fixes that several attributes were not correctly saved/restored or their default values were not correctly loaded.

Resolves https://github.com/material-components/material-components-android/issues/2032

PiperOrigin-RevId: 420096508
2022-01-06 15:51:50 -05:00
Material Design Team
cfc00aa5a3 Update android core class definitions across material
PiperOrigin-RevId: 414839941
2021-12-08 14:56:25 +00:00
Material Design Team
a487c89185 Internal change
PiperOrigin-RevId: 412135443
2021-11-29 17:35:39 +00:00
Material Design Team
c1f48a74c2 [NavigationBar] getPresenter update
PiperOrigin-RevId: 401843016
2021-10-11 10:59:53 -04:00
hunterstich
fd23c6b0ad [NavigationRail] Added support for unlabeled items to automatically resize their active indicator.
PiperOrigin-RevId: 399689605
2021-09-29 11:19:59 -04:00
hunterstich
6e1acd1aea [Docs][NavigationView] Updated navigation drawer documentation to Material 3.
PiperOrigin-RevId: 398721683
2021-09-24 17:55:32 +00:00
dsn5ft
478ca74a00 [M3][NavigationBar] Update active indicator initialization to skip animator if view not attached to window yet
PiperOrigin-RevId: 398719690
2021-09-24 17:53:11 +00:00
hunterstich
d0edb45893 [M3][NavigationView] Added Material 3 styles for navigation view.
PiperOrigin-RevId: 398719344
2021-09-24 17:51:53 +00:00
hunterstich
b762fbc2dd [Docs][NavigationRail] Updated documentation to Material 3 and added new styles/attrs to res-public
PiperOrigin-RevId: 398481584
2021-09-23 19:38:38 +00:00
hunterstich
e8c1d98b16 [NavigationView] Added support for changing item size, divider insets, label insets, and corner size.
PiperOrigin-RevId: 398261933
2021-09-23 19:23:44 +00:00
hunterstich
c6d0f7c785 [M3][NavigationRail] Added new navigation rail styles.
PiperOrigin-RevId: 397846116
2021-09-21 08:35:12 -07:00
hunterstich
619c95c2f8 [NavigationBar] Fixed menu visibility changes causing active indicator flashing.
PiperOrigin-RevId: 393365926
2021-08-27 15:04:47 -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