2029 Commits

Author SHA1 Message Date
conradchen
804cd600b0 [M3][Tab] Make secondary style change label color when selected
To align with the behavior of the main style.

PiperOrigin-RevId: 392037281
2021-08-23 09:44:30 -07:00
pekingme
3caa9cdfea [M3][Tokens] Integrated elevation resources.
PiperOrigin-RevId: 392029517
2021-08-23 09:43:45 -07:00
conradchen
8123c63747 [Menu] Fix toolbar menu arrow not visible
In toolbar styles we use android:theme to override text and icon colors and set ?attr/colorControlNormal to ?attr/colorOnPrimary, which is the same color (white) in the light mode as the menu background. To override this behavior again, we need to use ?attr/popupTheme and set ?attr/colorControlNormal to ?attr/colorOnSurface.

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

PiperOrigin-RevId: 392003704
2021-08-23 09:36:09 -07:00
conradchen
60782a5d9b [M3][Tab] Create M3 styles
PiperOrigin-RevId: 391849752
2021-08-23 09:29:03 -07:00
dsn5ft
cb74134075 [M3][Top App Bar] Fixed collapsing toolbar collapsed title text appearance
PiperOrigin-RevId: 391821355
2021-08-23 09:27:39 -07:00
pekingme
293457c6f8 [M3][Tokens] Integrated typography system resources.
PiperOrigin-RevId: 391801740
2021-08-23 09:25:55 -07:00
dsn5ft
a461de5fd8 [M3][Text Field] Updated text appearance mappings
PiperOrigin-RevId: 391786230
2021-08-23 09:24:52 -07:00
dsn5ft
0c6f435a40 [M3][Top App Bar] Fixed styling in themes due to bad merge
PiperOrigin-RevId: 391780715
2021-08-23 09:24:07 -07:00
pekingme
23c9f27621 [M3][Tokens] Updated ref colors, background/surface color, and error color.
PiperOrigin-RevId: 391779908
2021-08-23 09:23:22 -07:00
conradchen
edbc4e1f64 [M3][Textfield] Create M3 styles
PiperOrigin-RevId: 391773145
2021-08-23 09:22:14 -07:00
dsn5ft
f428f20829 [M3][Color] Updated colorPrimaryDark to point to colorPrimary
Also updated Catalog edge-to-edge logic to handle "light status bar", and default to edge-to-edge enabled for Q+

PiperOrigin-RevId: 391763801
2021-08-23 09:21:21 -07:00
dsn5ft
18490ff82d [M3][Top App Bar] Added new AppBarLayout, CollapsingToolbarLayout, and Toolbar styles and updated Catalog pages + demos
PiperOrigin-RevId: 391755524
2021-08-23 09:20:24 -07:00
dsn5ft
b9e5797c73 [M3][Color] Set up elevation overlays and colors in themes + theme overlays
PiperOrigin-RevId: 391744768
2021-08-23 09:19:24 -07:00
pekingme
0995f99965 [M3][Tokens] Integrated color system resources.
PiperOrigin-RevId: 391597925
2021-08-23 09:18:25 -07:00
dsn5ft
5d940f1ff8 [M3][Catalog] Update Catalog theme(s) to Material3 and fix Material3 date/time picker theme overlays
PiperOrigin-RevId: 391581833
2021-08-23 09:17:02 -07:00
pfthomas
ec3f96cbb9 [CollapsingToolbarLayout] Fix expanded height incorrect after rotation
PiperOrigin-RevId: 391547762
2021-08-18 10:27:05 -07:00
dsn5ft
17a459abd3 [M3][Color] Removed disabled color theme attrs
PiperOrigin-RevId: 391544286
2021-08-18 10:26:23 -07:00
conradchen
04b06ae425 [M3] Create M3 ripple alpha resources
PiperOrigin-RevId: 391532414
2021-08-18 10:25:38 -07:00
hunterstich
baf55ec93c [M3][Typography] Add new typography system TextAppearance styles and set attrs in theme.
PiperOrigin-RevId: 391388105
2021-08-18 10:06:03 -07:00
conradchen
126df4c082 [Tab] Fix icon tint not applied on lower SDKs
On SDK < 23 if the icon is not a TintAwareDrawable, DrawableCompat.wrap() will return a new drawable which wraps the original drawable. However in the original logic after we set the tint to the icon, we didn't really set the tinted icon back to the tab or the image view, therefore the tint is not showing.

Moves the tint logic to updateTextAndIcon() to ensure tinted icons will be used in the image view.

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

PiperOrigin-RevId: 391368322
2021-08-18 10:02:28 -07:00
conradchen
a682ab0ee0 [AppBar] Make it possible to disable app bars' shadow
Originally we always set the outline provider of app bars to BOUND, even if the outline provider is set to none explicitly in the XML file.

Checks if the outline provider is set to BACKGROUND before we override it, to prevent unwanted overriding from happening.

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

PiperOrigin-RevId: 391339943
2021-08-18 10:01:27 -07:00
Natalia Kuznetsova
cdeeb824cb [TextInputLayout] Adding getter and setter for boxCollapsedPaddingTop
Resolves https://github.com/material-components/material-components-android/pull/2289

GIT_ORIGIN_REV_ID=50ec191fbca0e2223ac322adb3f36035186b4bca
PiperOrigin-RevId: 391122971
2021-08-16 13:49:38 -07:00
hunterstich
beb51dc938 [M3][Typography] Define new typography system theme attributes.
PiperOrigin-RevId: 390658242
2021-08-16 13:46:04 -07:00
dsn5ft
1ed1c29de3 [M3][Color] Define new color system theme attributes
PiperOrigin-RevId: 390612653
2021-08-16 13:44:53 -07:00
dsn5ft
45f4fa0ac8 [MaterialTimePicker] Add some defensive null checks for internal views
PiperOrigin-RevId: 390608782
2021-08-16 13:43:58 -07:00
jeremymuhia
10edc29b4f [TextInputLayout] fix counterTextColor java docs
PiperOrigin-RevId: 390602431
2021-08-16 13:43:10 -07:00
dsn5ft
c3691284aa [M3] Update Dark dialog theme to have correct dark dynamic color theme overlay
PiperOrigin-RevId: 390235966
2021-08-16 13:42:24 -07:00
conradchen
27757d026a [M3] Create M3 skeleton themes
PiperOrigin-RevId: 390228317
2021-08-16 13:36:10 -07:00
dsn5ft
57e3bc02fa [i18n] Updated some string translations for date picker, time picker, and text field
PiperOrigin-RevId: 389899697
2021-08-10 21:08:28 -07:00
pekingme
a55f3b8ee9 [LinearProgressIndicator] Fixed the transparent strip drawn at the ends of the indicator.
Resolves https://github.com/material-components/material-components-android/issues/1947

PiperOrigin-RevId: 388966812
2021-08-05 18:24:15 -04:00
pekingme
456abd5471 [LinearProgressIndicator] Added null check in requestAnimatorAfterCurrentCycle for disjoint indeterminate animator.
PiperOrigin-RevId: 388962420
2021-08-05 18:22:17 -04:00
pekingme
f9f57d7d3c [CircularProgressIndicator] Fixed the transparent strip drawn at the ends of the indicator.
Resolves partially https://github.com/material-components/material-components-android/issues/1947

PiperOrigin-RevId: 388953254
2021-08-05 18:21:37 -04:00
dsn5ft
e2c911b9e5 [AppBarLayout] Add setLiftableOverrideEnabled() method to allow toggling between automatic and manual setLifted() behavior
PiperOrigin-RevId: 388786221
2021-08-05 18:20:57 -04:00
dsn5ft
67f9e9da88 [AppBarLayout] Updated setLifted() to preserve lifted state if using setLiftable() programmatically
PiperOrigin-RevId: 388539565
2021-08-05 18:19:51 -04:00
Material Design Team
9fb73b50ff [BottomSheetBehavior] Apply the max width/height during measure instead of modifying layout params
Previously the BottomSheetBehavior was checking the measured size during onLayout and if it exceeded the max width or height configured it would "adjust" them by directly modifying the width and height on the layout params and then posting a setLayoutParams. This has many problems and is fundamentally the wrong way to do it. First off, a view should never modify the layout params that are configured on it for two reasons, one, they are properties of the parent view group, not the view itself, and two, they are almost always intended for users of the view group to configure, not the view group itself. Modifying the layout params directly is clobbering any previously configured parameter and permanently changing the layout (for example consider the case where the max width is set to 100dp and then later set to 200dp, the view would not be allowed to grow to 200dp because its layout params would already have been clobbered). Secondly the post is a very bad way to apply this max, not only does it trigger an entire layout pass a second time but it does so after having completed the first layout pass so it will cause the bottom sheet to render at the original size and then the capped size, it's both inefficient and will cause user visible jank.

The correct way to apply a maximum width/height is to do it during layout by incorporating it into the measure specs that are passed to the child. This doesn't clobber any state that the user of the view configured (i.e. when the parent measure specs change, e.g. due to screen rotation, the views correctly relayout) and it avoids doing multiple layout passes, the child can measure itself to the correct size the first time.

PiperOrigin-RevId: 387379138
2021-07-30 10:55:45 -04:00
pfthomas
47868d884e [DatePicker] Date selector hint incorrectly localized
PiperOrigin-RevId: 387066584
2021-07-29 14:28:10 -04:00
Material Design Team
cbf7bcad59 Internal change
PiperOrigin-RevId: 386513223
2021-07-28 14:29:52 -04:00
dsn5ft
3008d782e7 [AppBarLayout] Added listener for when lift on scroll background elevation and color change
PiperOrigin-RevId: 386243658
2021-07-28 14:26:55 -04:00
conradchen
b51692da7d [Transition] Fix NPE when removing window background
Null background is a totally valid state. Handles the nullness to prevent NPE from happening.

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

PiperOrigin-RevId: 386081632
2021-07-22 11:55:11 -04:00
conradchen
ac1caf460a [BottomAppBar] Fix default style not being applied
The constructors was not properly cascaded.

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

PiperOrigin-RevId: 385155453
2021-07-22 11:54:28 -04:00
Material Design Team
3eea60727f [AppBarLayout] Modify updateAppBarLayoutDrawableState logic to only require a child at an offset for conditions that depend on that child. For conditions that can be determined just based on the AppBarLayout, always check those conditions.
PiperOrigin-RevId: 385026332
2021-07-22 10:17:08 -04:00
dsn5ft
aaa0444308 [AppBarLayout] Added support for statusBarForeground lift on scroll elevation overlay for edge to edge mode and updated demo
Helpful for the case where the Top App Bar text/icons are still visible underneath a transparent status bar, when the Top App Bar is scrolled up.

PiperOrigin-RevId: 384985602
2021-07-22 10:11:22 -04:00
conradchen
a2e76736c5 [BottomSheetBehavior] Fix ViewDragHelper state inconsistency
When BottomSheetBehavior is set to not draggable, it's still forwarding touch event to ViewDragHelper, which causes ViewDragHelper changes its state to dragging although it's not really dragging. This causes bugs like if we change draggable to true during "no-effect" dragging, ViewDragHelper won't report the dragging state change because it thinks the state is not changing.

Fixes this by avoiding forwarding touch events to ViewDragHelper when it's not draggable, so its state won't be changed.

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

PiperOrigin-RevId: 384942764
2021-07-15 12:37:35 -04:00
zmunm
4acc56dceb [MaterialCardView] Add invalidate when stroke changed
Resolves https://github.com/material-components/material-components-android/pull/2173

GIT_ORIGIN_REV_ID=424c5862c22b41064ef473869bb0ca707bd53c13
PiperOrigin-RevId: 384921024
2021-07-15 12:35:51 -04:00
Maxwell
3bb0911d1b [BottomAppBar] Add functions for checking (STATE_SCROLLED_UP | STATE_SCROLLED_DOWN)
Resolves https://github.com/material-components/material-components-android/pull/2279

GIT_ORIGIN_REV_ID=93704406cbf827eddf9273b5f4b2e8a3cb467c03
PiperOrigin-RevId: 384775019
2021-07-15 12:34:59 -04:00
Afzal Najam
c3713724de [BottomSheet] Fix fitToContents reference in comment
Resolves https://github.com/material-components/material-components-android/pull/2196

GIT_ORIGIN_REV_ID=d996a3692496f60bd895df1a3a22b6bb4697d41f
PiperOrigin-RevId: 384750498
2021-07-15 12:33:43 -04:00
conradchen
7085319b35 [Chip] Fix touching cannot put focus on chips with Talkback
We disabled ChipTouchHelper on purpose to workaround a Talkback issue but we didn't stop forwarding touch/hover events to ChipTouchHelper, which cause some Talkback logic work incorrectly on certain API levels.

Adds a state variable to avoid using ChipTouchHelper when it's not registered as accessibility delegate to solve the issue.

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

PiperOrigin-RevId: 383911836
2021-07-12 19:41:11 +00:00
Material Design Team
2d589bd351 [RangeSlider] Fix minSeparation having no effect when stepSize > 0
Resolves https://github.com/material-components/material-components-android/issues/2147

Note: `minSeparation` cannot be set as a dimension when using `stepSize`, make sure to use `rangeSlider.setMinSeparationValue()`.
PiperOrigin-RevId: 383893367
2021-07-12 19:39:32 +00:00
conradchen
31ca1106ab [Chip] Report a11y class name as RadioButton in single selection mode
Also consolidates the logic of reporting a11y class name.

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

PiperOrigin-RevId: 383849367
2021-07-12 19:38:32 +00:00
ymarian
b06446006c [Card] Fix checked icon tint for API < 21, BitmapDrawables
Resolves https://github.com/material-components/material-components-android/issues/1993

PiperOrigin-RevId: 383754894
2021-07-09 15:29:15 -04:00