2306 Commits

Author SHA1 Message Date
nikhiljainlive
0181029efb [MaterialTimePicker] Fix Input mode is not changed when keyboard icon is clicked when the app is returned from background
Resolves https://github.com/material-components/material-components-android/pull/2419

GIT_ORIGIN_REV_ID=80ba4c214cbd565ad461bef80fb9ae01b8671a0e
PiperOrigin-RevId: 402550766
2021-10-12 11:40:24 -04:00
pekingme
c1f7dfc314 [Tokens] Updated resources to v0.54.
PiperOrigin-RevId: 402383462
2021-10-12 11:39:48 -04:00
conradchen
79ae9b1351 [TextInputLayout] Create label cutout only on borders
When a collapsed label is showing, we cutout part of the border of an outlined text input box according to the exact stroke width. However when using rounded corners, there can be slight offsets from where the border is really drawn. Also, if the corner size is large, the part of border we need to cutout might not just be a straight line but contains part of the corner.

However, with the existing cutout logic, we cannot just cutout the whole label area, which will cause the area inside the border also gets cutout, if it has color. This CL changes the cutout drawing logic to only apply the cutout on stroke drawing to fix the issue.

This CL also fixes the bug that when the label is too long, we didn't take the ellipsized text length into account. Creates a variable to store the calculated collapsed text width to fix the issue.

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

PiperOrigin-RevId: 402316057
2021-10-12 11:26:21 -04:00
Material Design Team
c1f48a74c2 [NavigationBar] getPresenter update
PiperOrigin-RevId: 401843016
2021-10-11 10:59:53 -04:00
Riccardo Ciovati
1b8fb30370 [CollapsingToolbarLayout] Allow customizing the title position interpolator
Resolves https://github.com/material-components/material-components-android/pull/1757

GIT_ORIGIN_REV_ID=87dea3a74d8a8f460cc9beb32bcb783f71ee6e63
PiperOrigin-RevId: 401826042
2021-10-11 10:59:08 -04:00
conradchen
f6426f691c [M3][Theme] Remove redundant day-night theme overly aliasing
PiperOrigin-RevId: 401799637
2021-10-11 10:54:07 -04:00
Material Design Team
90c78b97a5 [M3][Color] Add M3 Dynamic Color Themes for AppWidgets
PiperOrigin-RevId: 401780997
2021-10-11 10:52:20 -04:00
pekingme
e9bca65652 Automated g4 rollback of changelist 398768587
PiperOrigin-RevId: 401342017
2021-10-06 20:14:36 -04:00
conradchen
a1e33f19d4 [M3][Dialog] Simplify M3 dialog theme structure
Removes unneeded inheritance structure to improve maintainability and readability.

PiperOrigin-RevId: 401327728
2021-10-06 20:12:43 -04:00
conradchen
cde684ab42 [DatePicker][TimePicker] Replace confirm button strings
On certain Android devices it seems the framework string @android:string/ok is not available. Replaces the usage of the strings with Material specific strings.

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

PiperOrigin-RevId: 400814492
2021-10-05 09:05:36 -04:00
serniebanders
5844d3c134 [Button] Update icon state on Drawable state change.
Resolves: https://github.com/material-components/material-components-android/issues/2322

Follows pattern in View.drawableStateChanged() where drawable properties have states manually set.

PiperOrigin-RevId: 400754477
2021-10-05 09:04:56 -04:00
conradchen
7fc006c5e4 [TopAppBar] Fix the issue that top app bars not collapsed when top padding is set
In the snap logic we didn't take the AppBarLayout's top padding into account, therefore in certain cases the scrolling will be incorrectly snapped to the top of CollapsingToolbarLayout instead of the bottom of it, which cause the title not collapsed.

PiperOrigin-RevId: 400749401
2021-10-05 09:04:10 -04:00
conradchen
d045b2d1eb [M3][Dialog] Update M3 dialog elevation
PiperOrigin-RevId: 400245762
2021-10-05 08:36:59 -04:00
conradchen
ca09b7b04b [M3][DatePicker] Fix month naviation button alignment
With MaterialButton, if we want an icon to be center aligned when there's no text, we need to set icon padding to 0dp and icon gravity to text-start or text-end. Updates the M3 style to make the icon center aligned.

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

PiperOrigin-RevId: 400242967
2021-10-04 20:20:19 +00:00
Daniel Frett
8297cf86ab [Slider] addOnChangeListener should take NonNull value
Resolves https://github.com/material-components/material-components-android/pull/2377

GIT_ORIGIN_REV_ID=e839483bfa9331ecc728ebf283d0c48d40af8fa9
PiperOrigin-RevId: 400212014
2021-10-01 15:57:46 +00: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
conradchen
ff2c03b099 [M3][Color] Implement M3 text colors
PiperOrigin-RevId: 399682484
2021-09-29 10:54:25 -04:00
conradchen
b40b782525 [M3][Card] Add filled card style to M3 themes
PiperOrigin-RevId: 398780149
2021-09-28 14:52:04 +00:00
jeremymuhia
5da2d2d0dc [M3][BottomNav] update bottom nav dev doc
PiperOrigin-RevId: 398779288
2021-09-28 14:22:46 +00:00
Material Design Team
bc201c61fd Automated g4 rollback of changelist 396584016
PiperOrigin-RevId: 398768587
2021-09-24 18:13:06 +00:00
conradchen
23f1af15a1 [M3][Dialog] Update M3 dialog dev doc
PiperOrigin-RevId: 398733152
2021-09-24 18:08:42 +00:00
dsn5ft
241e855552 [M3][Theme] Remove some todos
PiperOrigin-RevId: 398732498
2021-09-24 18:06:42 +00: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
dsn5ft
c40ac672d8 [M3][Docs] Updated Top App Bar dev doc to Material3 and added new styles/attrs to res-public
PiperOrigin-RevId: 398465771
2021-09-23 19:37:46 +00:00
conradchen
c3e8fa60f1 [M3][Dialog] Update M3 dialog paddings
PiperOrigin-RevId: 398262777
2021-09-23 19:25:58 +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
Material Design Team
e89e46e046 [M3][Color] Hct update for gamut mapping.
When mapping colors from a perceptually accurate color space to RGB for display, we need to identify if the color clipped to RGB is close enough to the requested color, this change allows 1 part in 1 billion error.

PiperOrigin-RevId: 398195568
2021-09-23 19:22:09 +00:00
conradchen
4bec3e2b13 [AppBar] Fix incorrect scroll position after orientation changes
An app bar remembers the visible percentage of its first visible child during recreation to restore its scroll position. However, if an app bar is "fully" scrolled (scrolled to its maximum range), gets recreated, and changes its size after recreation, it can become not fully scrolled even if it keeps the same visible percentage of its first visible child, due to the difference in its own size. This can result in unexpected "gaps" in the layout due to inconsistency between AppBar layout's scroll position and the content view's.

Fixes this by remembering the "fully scrolled" state and restore it during recreation.

PiperOrigin-RevId: 398013525
2021-09-23 19:18:08 +00:00
conradchen
168c69189e [TimePicker] Add ability to customize positive and negative button
Resolves https://github.com/material-components/material-components-android/issues/2275

PiperOrigin-RevId: 398010381
2021-09-23 19:15:42 +00:00
hunterstich
c6d0f7c785 [M3][NavigationRail] Added new navigation rail styles.
PiperOrigin-RevId: 397846116
2021-09-21 08:35:12 -07:00
conradchen
328d269e6d [Tab] Fix NPE caused by null tab indicator
PiperOrigin-RevId: 397841987
2021-09-21 08:22:49 -07:00
conradchen
868f8aaba3 [Tab] Fix setting tab indicator and its full-width flag
1. When a new tab indicator drawable is set, we didn't correctly restore the previous set indicator height to the new drawable, or set the drawing bound to the intrinsic height of the drawable, if the indicator height was not specified. This result in a 0-height drawing bound after setting the tab indicator, which makes it disappear and can never go back if the tab indicator gravity is not "stretch" (which will recalculate the height after moving the indicator). Fixes this by correctly set the drawing bounds after a new tab indicator drawable is set.

2. After we set full-width flag of tab indicator, the width won't be updated until we move the tab indicator. Fixes this by explicitly triggering the recalculation of tab indicator's drawing bound after changing the flag.

Resolves: https://github.com/material-components/material-components-android/issues/2354
PiperOrigin-RevId: 397823617
2021-09-21 08:14:25 -07:00
conradchen
37bb2efb38 [Chip] Rollback workaround of ExploreByTouchHelper bug
The original bug has been fixed.

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

PiperOrigin-RevId: 397813859
2021-09-21 08:07:41 -07:00
jeremymuhia
3e7504f0db [M3][Divider] update divider dev doc
PiperOrigin-RevId: 397754423
2021-09-20 12:33:17 -07:00
conradchen
8a1f221e39 [Tab] Fix isSelected() may returns incorrect result
Resolves https://github.com/material-components/material-components-android/issues/2379

PiperOrigin-RevId: 397394397
2021-09-20 12:16:44 -07:00
serniebanders
10284bcf74 [M3][Docs] Update bottomsheet documentation to describe M3 themes/styles.
Additionally exposes M3 bottomsheet styles in res-public

PiperOrigin-RevId: 397125281
2021-09-20 11:49:12 -07:00
dsn5ft
445c4979b3 [M3][Top App Bar] Updated ActionBar and ActionMode styling
PiperOrigin-RevId: 397107223
2021-09-20 10:59:34 -07:00
jeremymuhia
83e240289e [M3][Badge] sync badge docs with implementation
PiperOrigin-RevId: 397106893
2021-09-20 10:58:52 -07:00
dsn5ft
67dbc21be1 [M3][Docs] Updated Getting Started guide to Material3 and added Material3 Theme resources to res-public
PiperOrigin-RevId: 397100754
2021-09-20 10:52:57 -07:00
hunterstich
674463fb6d [NavigationRail] Updated rail to support a minimum menu item height.
PiperOrigin-RevId: 397085204
2021-09-20 09:37:13 -07:00
pfthomas
00c0df9e7d [TimePicker][Accessibility] Send accessibility event when updating input mode
PiperOrigin-RevId: 397080648
2021-09-20 09:31:49 -07:00
pekingme
9c93dcd626 [M3][Tokens] Update resources to v0.47.
PiperOrigin-RevId: 397066722
2021-09-20 09:31:04 -07:00
jeremymuhia
785f5d4895 [M3][FAB] update FAB dev doc
PiperOrigin-RevId: 396900654
2021-09-16 13:35:27 -07:00
dsn5ft
333dceaa63 [M3][Docs] Updated Typography doc to Material3 and added Material3 Typography resources to res-public
PiperOrigin-RevId: 396876831
2021-09-16 13:13:45 -07:00
afohrman
3af8a93e18 [M3 Dialog] Set alert dialog icon size and color.
Icon size changed from 32dp to 24dp and icon color changed from ?attr/colorOnSurface to ?attr/colorSecondary.

PiperOrigin-RevId: 396847651
2021-09-16 13:04:48 -07:00
serniebanders
6a30ac164a [M3][Docs] Update tabs documentation to describe M3 themes/styles.
Additionally exposes M3 tabs styles in res-public

PiperOrigin-RevId: 396627778
2021-09-16 12:38:21 -07:00
conradchen
db699385b2 [M3][Theme] List widget style attributes to add to base themes
PiperOrigin-RevId: 396624457
2021-09-16 11:48:10 -07:00