28 Commits

Author SHA1 Message Date
rightnao
20f92dfb51 [NavigationDrawer] Notify each adapter item of a potential change in case there are any item changes
Resolves https://github.com/material-components/material-components-android/issues/4168

PiperOrigin-RevId: 646154192
2024-06-25 14:53:10 +00:00
shawn hwang
3a31eef6f4 [NavigationView] Fixed item being checked instead of submenu item
Resolves https://github.com/material-components/material-components-android/pull/4155

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

GIT_ORIGIN_REV_ID=0f539d1e079f4bfcb044db26a4a0064538d29f05
PiperOrigin-RevId: 642317463
2024-06-11 19:00:12 +00:00
pubiqq
26bfdd2257 [NavigationView] Fix subheader and divider insets and use relative listPreferredItemPaddings.
Resolves https://github.com/material-components/material-components-android/pull/4122
Resolves https://github.com/material-components/material-components-android/pull/4123

GIT_ORIGIN_REV_ID=911d1af88c0d10c6894bf38546b870430e86b6f9
PiperOrigin-RevId: 634517597
2024-05-16 21:30:24 +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
pfthomas
5bf6831b14 [NavDrawer][a11y] Fix wrong item selected after click
PiperOrigin-RevId: 616214272
2024-03-20 18:47:11 +00:00
pfthomas
917da52393 [NavigationDrawer] Do not count headers for accessibility
PiperOrigin-RevId: 540975970
2023-06-26 21:25:15 +00: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
pfthomas
b1f7d5bebc [NavigationView][a11y] Announce number of items in drawer
Resolves https://github.com/material-components/material-components-android/issues/678

PiperOrigin-RevId: 445165922
2022-04-28 12:40:24 -04:00
jeremymuhia
cfc307ed4e [NavigationView] fix navigation view item ripple
PiperOrigin-RevId: 434516655
2022-03-14 18:55:40 +00: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
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
conradchen
5d092b75a6 [Color] Internal change
PiperOrigin-RevId: 372355438
2021-05-07 12:14:33 -04:00
marianomartin
555356b03f Internal cleanup
PiperOrigin-RevId: 318134343
2020-06-26 14:06:52 -04:00
cketcham
81e708e1bb Add @NonNull and @Nullable annotations
PiperOrigin-RevId: 264745164
2019-08-26 11:19:28 -04:00
cketcham
a1a763dde9 Fixing NavigationView scrims
NavigationView tries to determine if it is behind the status bar by checking if it's at the top of the screen. If it is and there are insets, it will draw a scrim. It also tries to determine if it is under the system nav. If it is and the system nav isn't fully transparent, it will also draw a scrim.

PiperOrigin-RevId: 264167166
2019-08-20 11:13:04 -04:00
isabellekim
a628bf516b Revert the library to compile with Java 7: revert lambdas, add necessary casts, and make some variables final.
Continue compile shrine demo, catalog, and tests with Java 8.

PiperOrigin-RevId: 257874888
2019-07-15 19:19:23 -04:00
marianomartin
19aeb9b7a2 Delegate overscrollmode in navigation view to inflated MenuView
PiperOrigin-RevId: 256988688
2019-07-09 12:54:18 -04:00
cketcham
bff75f2d3e Update to lamdas
PiperOrigin-RevId: 252846439
2019-06-18 13:21:02 -04:00
Material Design Team
6096d60959 Roll Forward of CL 242858439
PiperOrigin-RevId: 243197143
2019-04-19 15:48:51 -04:00
Material Design Team
3666e15298 Automated g4 rollback of changelist 242858439
PiperOrigin-RevId: 242907738
2019-04-19 15:30:07 -04:00
Material Design Team
3f12bd50e2 Add a itemMaxLines Attribute to NavigationView
Add a itemMaxLines attr to NavigationView and propagate it down to the internal CheckedTextView.

Also, make a slight change to design_navigation_item.xml layout to accommodate multiple lines of text. Without the layout change, the layout_height of the item is set to "?attr/listPreferredItemHeightSmall" so it can't contain an arbitrary number of lines. It can also chop lines in the middle.

To fix this, we change layout_height to "wrap_content" and add a minHeight attribute set to "?attr/listPreferredItemHeightSmall". This results in the same behavior for single line items but expands appropriately to contain items with multiple rows.

PiperOrigin-RevId: 242858439
2019-04-19 15:15:23 -04:00
cketcham
dc72aaeed4 Migrate Gradle build and sources to androidx
PiperOrigin-RevId: 225551505
2018-12-21 11:07:45 -05:00
cketcham
3ad01eceda Ignore empty header and dividers when counting the number of items in NavigationView for accessibility
PiperOrigin-RevId: 223407274
2018-12-06 11:39:08 -05:00
Brian Attwell
483d34a0f4 Don't rebind/relayout/reinflate any views after clicking a menu item
If none of the check state has changed, let's not update the menu. Background for this diff is at #61. While larger improvements may make sense, this diff is designed to mitigate the most serious issue in a way that doesn't create risk.

Test: used these modified classes inside the Android Uber app and ran a profiler. The problematic 50ms delay caused by this bug was fixed. You can see the before/after traces in https://issuetracker.google.com/issues/73723207.

Resolves https://github.com/material-components/material-components-android/issues/61
Resolves https://github.com/material-components/material-components-android/pull/62

GIT_ORIGIN_REV_ID=f8f8488689be67b8974d29e1c623e1dbe18cfdae
PiperOrigin-RevId: 221799350
2018-11-16 12:23:34 -05:00
Material Design Team
18c93ad9ae Allow setting the size for navigation view icons
PiperOrigin-RevId: 208214420
2018-08-17 17:09:59 -04:00
gauthams
ac27064891 Add paired getter and setter for NavigationView setCheckedItem()/getCheckedItem()
PiperOrigin-RevId: 193267214
2018-04-30 11:28:37 -04:00
dniz
9ca33544ac Update package name to com.google.android.material
PiperOrigin-RevId: 193236235
2018-04-30 11:24:23 -04:00