34 Commits

Author SHA1 Message Date
Tad Fisher
a6a750b4ae [NavigationView] Fix obtaining Activity in setupInsetScrimsListener
Resolves https://github.com/material-components/material-components-android/pull/1628
Resolves https://github.com/material-components/material-components-android/issues/1627

GIT_ORIGIN_REV_ID=4042d13c8326144184e46795b217b9172b6552ad
PiperOrigin-RevId: 327446397
2020-08-19 17:44:12 -04:00
Gabriele Mariotti
e6f05bca7e [NavigationView] Support for shapeAppearance and shapeAppearanceOverlay attributes
Resolves https://github.com/material-components/material-components-android/pull/1535

GIT_ORIGIN_REV_ID=f676794634c788fb906bc36c0feadb1628e36fb4
PiperOrigin-RevId: 323783155
2020-07-29 10:39:14 -04:00
marianomartin
555356b03f Internal cleanup
PiperOrigin-RevId: 318134343
2020-06-26 14:06:52 -04:00
Material Design Team
073382034a Migrate android.support.v4.content.ContextCompat to androidx
Android X migration

PiperOrigin-RevId: 315791679
2020-06-11 17:27:51 -07:00
Material Design Team
76ffe35fef Cleanup
PiperOrigin-RevId: 313865830
2020-06-01 16:52:06 -04:00
isabellekim
1f9de68025 [All] Add support for materialThemeOverlay
Resolves https://github.com/material-components/material-components-android/pull/948

GIT_ORIGIN_REV_ID=5a8bb35a56c1b813df47d964de8482a26e0da66d
PiperOrigin-RevId: 293839172
2020-02-10 09:55:19 -05:00
marianomartin
f71d80a960 [NavigationView] Logic error when drawing nav bar scrim
Resolves https://github.com/material-components/material-components-android/issues/629

PiperOrigin-RevId: 273365055
2019-10-08 10:34:29 -04:00
Material Design Team
05367d4358 Fix fragment leak in Material NavigationView
Need to unregister the ViewTreeObserver, which was previously registered on the top-most View in the entire hierarchy.

PiperOrigin-RevId: 268532017
2019-09-12 14:21:38 -04:00
marianomartin
215a839598 Internal cleanup
PiperOrigin-RevId: 267504117
2019-09-12 13:48:16 -04:00
cketcham
7bb525ff59 Update usages of ShapeAppearanceModel to use Builder pattern
PiperOrigin-RevId: 266144471
2019-08-29 15:39:51 -04:00
marianomartin
0d4515cb46 Internal cleanup
PiperOrigin-RevId: 265971745
2019-08-29 14:59:20 -04:00
cketcham
86d4328e24 Add @NonNull and @Nullable annotations
PiperOrigin-RevId: 265447585
2019-08-29 11:24:58 -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
marianomartin
19aeb9b7a2 Delegate overscrollmode in navigation view to inflated MenuView
PiperOrigin-RevId: 256988688
2019-07-09 12:54:18 -04:00
marianomartin
164bf0fabd Internal cleanup
PiperOrigin-RevId: 255609320
2019-07-03 14:02:53 -04:00
dniz
5df3bebd63 Update elevation overlays to be based absolute elevation, factoring in the elevation of all parent views
Will follow-up with TabLayout absolute elevation separately

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

PiperOrigin-RevId: 255404830
2019-07-03 13:55:49 -04:00
afohrman
ab87dd51fb Add shaped selected item background to NavigationView and update the item background color.
PiperOrigin-RevId: 247490949
2019-05-16 12:38:14 -04:00
afohrman
56efa7f634 Add elevation overlay support for NavigationView.
PiperOrigin-RevId: 245312138
2019-04-29 15:49:56 -07:00
afohrman
6b055ffbeb Automated g4 rollback of changelist 243898425
PiperOrigin-RevId: 244049761
2019-04-19 21:29:34 -04:00
afohrman
9dfecb6e36 Support elevation overlays for Navigation Drawers.
This sets the default elevation for Widget.MaterialComponents.NavigationView to 16dp instead of 0dp.

PiperOrigin-RevId: 243898425
2019-04-19 21:23:04 -04:00
afohrman
ed4260f5fb Use the framework's setFitsSystemWindows method rather than the deprecated ViewUtils version.
PiperOrigin-RevId: 243667717
2019-04-19 21:06:28 -04:00
afohrman
6e98554a8c Remove unnecessary return tag in NavigationView#getCheckedItem().
The @return tag is redundant; return tags are not required in cases where the tag does not add value.

PiperOrigin-RevId: 243663808
2019-04-19 21:05:32 -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
Material Design Team
a13ff980a5 Automated g4 rollback of changelist 241720142
PiperOrigin-RevId: 241804673
2019-04-05 15:48:38 -04:00
Material Design Team
264e816f56 * Add selected (Active) item default background to NavigationView - introducing seven itemShape* attributes for this purpose
PiperOrigin-RevId: 241720142
2019-04-05 15:43:56 -04:00
Material Design Team
c5aea4d74f Automated g4 rollback of changelist 232310103
PiperOrigin-RevId: 232890148
2019-02-11 11:17:51 -08:00
marianomartin
85512ef943 Remove attr definition and setting fitSystemWindows from NavigationView since view already handles that.
PiperOrigin-RevId: 232310103
2019-02-11 11:12:35 -08:00
cketcham
dc72aaeed4 Migrate Gradle build and sources to androidx
PiperOrigin-RevId: 225551505
2018-12-21 11:07:45 -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
afohrman
ba1d772575 Annotate NavigationView padding setters and getters.
Annotate with @Dimension, which by default implies a pixel dimension.

PiperOrigin-RevId: 196549450
2018-05-16 11:43:46 -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