358 Commits

Author SHA1 Message Date
gauthams
cfbc6bb50b Reuse color resources rather than having attribute dependency in MDC Bridge themes
PiperOrigin-RevId: 210438272
2018-08-28 16:41:54 -04:00
cketcham
abee218646 Fix height of BottomAppBar in landscape
BottomAppBar was incorrectly using the Toolbar min height which is less tall in landscape. It should always be 56dp.

PiperOrigin-RevId: 210362480
2018-08-28 16:41:25 -04:00
dniz
498d200f40 Fix Toolbar & ActionBar sizes for large screens
PiperOrigin-RevId: 210361782
2018-08-28 16:41:06 -04:00
connieshi
250a906620 Fix bug that ignored ripple colors set programmatically if device is running Api 21+ and framework ripple is used.
Update chip demo in catalog to have ripple color corresponding to the current theme's primary color.

PiperOrigin-RevId: 210142873
2018-08-28 16:40:45 -04:00
cketcham
71f5ea1415 Add alternate animations for BottomAppBar mode changes
PiperOrigin-RevId: 210096177
2018-08-28 16:40:25 -04:00
Material Design Team
a5c1ea2709 Fixes Chip text padding & drawing.
The previous code was setting total padding (both start & end) as just end padding of the parent TextView and relying on the invalidation phase drawing the text in the correct place by shifting canvas with computed offset of start padding. This is risky as Chip may be just re-laid without actually invalidating it and render wrong paddings. Also RTL layout direction is incorrectly identified as LTR during layout sometimes, which makes the text being rendered with incorrect offset.

This change sets the paddings correctly removing the need of manual offsetting during onDraw() and relies purely on TextView for its text rendering.

PiperOrigin-RevId: 210042249
2018-08-28 16:40:05 -04:00
cketcham
7b564d1d52 Update default animation spec for BottomSheetDialogs
PiperOrigin-RevId: 209996117
2018-08-28 16:38:35 -04:00
cketcham
9820f85843 Fix bug caused by not resetting imageMatrixScale in FloatingActionButton
PiperOrigin-RevId: 209995243
2018-08-28 16:38:12 -04:00
cketcham
18be1b73af Modify BottomAppBar to react to the transformations of the FloatingActionButton
PiperOrigin-RevId: 209988651
2018-08-28 16:37:42 -04:00
Holger Schmidt
2b8952d8e8 Stop ignoring bottomPadding and rightPadding set on ChipGroup.
Resolves https://github.com/material-components/material-components-android/pull/186

Resolves #186

PiperOrigin-RevId: 209962412
2018-08-28 16:36:23 -04:00
connieshi
1f98c64b66 Remove redundant call to onSizeChange() in ChipDrawable#setTextAppearance(). Always evoke callback in TextAppearance#getFontAsync
Switch to using TextUtils.equals for more robust string comparison.

PiperOrigin-RevId: 209764943
2018-08-28 16:36:00 -04:00
marianomartin
585e2fede0 Remove constructor comments
PiperOrigin-RevId: 209762154
2018-08-28 16:34:43 -04:00
Material Design Team
7a2b5f0cd7 Automated g4 rollback of changelist 209640439
PiperOrigin-RevId: 209705959
2018-08-28 16:34:03 -04:00
cketcham
148ca998fe Modify BottomAppBar to react to the transformations of the FloatingActionButton
PiperOrigin-RevId: 209640439
2018-08-28 16:33:22 -04:00
Material Design Team
e8c6a84246 Create the material CheckBox component with a catalog demo.
PiperOrigin-RevId: 209638198
2018-08-28 16:32:59 -04:00
gauthams
460c226fdf Fix bug in TabLayout where TabViews initialized to unselected would not have unselected state.
Essentially, the issue is that when "selected" tabs were added to a TabLayout, we were calling tab.select() which updated the state of the selected tab to selected, and sets all other tabs to unselected. HOWEVER, when an "unselected" tab is added, we never call tab.select(), so the unselected tab's state never gets updated until a tab is clicked manually. The default state of tabs is "selected", so unselected tabs appeared selected.

PiperOrigin-RevId: 209622793
2018-08-28 16:32:34 -04:00
gauthams
15bf27d7cd Update MaterialButton to use new color attributes
PiperOrigin-RevId: 209617286
2018-08-28 16:31:53 -04:00
afohrman
a239a14139 Use null check instead of instanceOf for boxBackground's GradientDrawable initialization.
PiperOrigin-RevId: 209596322
2018-08-28 16:31:27 -04:00
gauthams
65e33f20af Clarify documentation for TabLayout's GRAVITY_FILL behavior to specify that it does not take effect on screens wider than 600dp.
PiperOrigin-RevId: 209524721
2018-08-28 16:30:27 -04:00
marianomartin
7e3ec00320 Fix broken gradle build because of duplicated attr
PiperOrigin-RevId: 209415765
2018-08-20 11:33:06 -04:00
cketcham
f9ca2463fd Clarify Roboto medium TextAppearance styles
Roboto Medium is only available after api 21, before that the font falls back to regular bold roboto

PiperOrigin-RevId: 209197782
2018-08-17 17:32:49 -04:00
marianomartin
4b73cb095e MaterialCardView API 16 ripple
PiperOrigin-RevId: 209182404
2018-08-17 17:30:29 -04:00
marianomartin
7020b37719 Set background transparent foreground on cardview
PiperOrigin-RevId: 209152296
2018-08-17 17:28:29 -04:00
Material Design Team
b65d0e3e57 TextAppearance typeface bug fix & refactoring of getFontAsync().
This is in preparation of larger change of moving CollapsingTextHelper onto TextAppearance to fix related bugs & avoid code duplication.

1. Introduces a version of getFontAsync() in TextAppearance that doesn't require TextPaint as an argument.
2. Refactors the existing getFontAsync to wrap the new implementation.
3. Fixes a bug - TextAppearance would not apply the correct typeface from a style when fontFamily was not present in the style def.

PiperOrigin-RevId: 209147825
2018-08-17 17:20:54 -04:00
marianomartin
08c729d218 Fix icon tinting not working prep L
PiperOrigin-RevId: 209068353
2018-08-17 17:19:37 -04:00
marianomartin
92e34f6830 MaterialCardView keeps shrinking its inner content when changing its strokeWidth
PiperOrigin-RevId: 209028205
2018-08-17 17:18:31 -04:00
marianomartin
09673a5de7 MaterialCardView add ripple drawable to foreground
PiperOrigin-RevId: 208993686
2018-08-17 17:15:51 -04:00
cketcham
43bdfac37b Expose option to slide the BottomAppBar on and off the screen programmatically
PiperOrigin-RevId: 208866469
2018-08-17 17:14:22 -04:00
connieshi
0ced1bcf8c Return early from Chip#setupTouchTargetDelegate If the client didn't specify touchTargetDelegate attribute in xml.
PiperOrigin-RevId: 208717708
2018-08-17 17:13:05 -04:00
connieshi
36a472b22a ChipGroup's layout should include the rightmost child's end margin.
PiperOrigin-RevId: 208515835
2018-08-17 17:12:12 -04: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
0f5cd3d379 Create a ThemeOverlay for the legacy text field to unset editTextStyle.
The legacy text field had extra spacing from the editTextStyle set in the default textInputStyle. Since explicit styles stack on top of the default style, the editTextStyle with extra padding was set in the default style (which was recently changed to the filled box style) and it was not unset in the legacy style, resulting in the extra spacing.

Adding an empty ThemeOverlay fixes this issue.

PiperOrigin-RevId: 208117313
2018-08-17 17:08:53 -04:00
connieshi
82d02a1112 Call ViewObserver#RemoveOnGlobalLayoutListener to avoid memory leak in Chip.
PiperOrigin-RevId: 208114143
2018-08-17 17:07:33 -04:00
connieshi
0c8dd4f121 Stop unicode wrapping user input strings in Chip#setText.
Remove overridden getText method, and rely on the TextView's implementation.
This also fixes accessibility issues when Talkback granularity is set to "word" or "characters".

PiperOrigin-RevId: 207296625
2018-08-17 16:59:28 -04:00
connieshi
601f2511bc Add localization to Material Design Components lib, initially for chip.
PiperOrigin-RevId: 207265701
2018-08-17 16:58:09 -04:00
marianomartin
2c8209e899 Override Remove view methods in MaterialCardView
PiperOrigin-RevId: 207093142
2018-08-02 18:08:04 -07:00
marianomartin
3b33e5d40f Fix cardview failures, min height should account for content padding to not make the cardview bigger than expected.
PiperOrigin-RevId: 207005747
2018-08-02 18:07:34 -07:00
marianomartin
36cc52f9d8 Add FrameLayout to fix clipping issue with card view
PiperOrigin-RevId: 206958673
2018-08-02 18:06:32 -07:00
connieshi
7449427d36 Each time a chip icon is updated, apply the current chip icon tint.
Fixes bug that only updated chip icon tint if tint is updated after an icon has been set.

PiperOrigin-RevId: 206838032
2018-08-02 18:06:05 -07:00
cketcham
c73ee1b061 Update ThemeEnforcement to correctly read the android:theme attribute from the style
PiperOrigin-RevId: 206579912
2018-08-02 18:04:42 -07:00
gauthams
4564c8c907 Add new color attributes to bridge theme and check for all new attributes in ThemeEnforcement
PiperOrigin-RevId: 206537727
2018-08-02 18:03:20 -07:00
Material Design Team
ee9e754c0a Removed unnecessary complexity
PiperOrigin-RevId: 206320111
2018-08-02 18:02:23 -07:00
cketcham
4f7cf963c4 Automated g4 rollback of changelist 206313825
PiperOrigin-RevId: 206319662
2018-08-02 18:02:01 -07:00
dniz
979e577681 Consume all Snackbar touches with OnTouchListener
PiperOrigin-RevId: 206316703
2018-08-02 18:01:36 -07:00
cketcham
6f714ecc4f Update ThemeEnforcement context to read only the android:theme attribute from the style
PiperOrigin-RevId: 206313825
2018-08-02 18:01:03 -07:00
connieshi
ffa7b10cae Add null check in Chip#setupTouchTargetDelegate
PiperOrigin-RevId: 206215855
2018-08-02 18:00:36 -07:00
cketcham
d1e9dd6427 Fix method name referenced in comment
PiperOrigin-RevId: 206206294
2018-08-02 18:00:12 -07:00
connieshi
516d00d8a6 Add attributes (chipTouchTargetDelegate, chipMinTouchTargetSize) to support chip meeting minimum accessible touch target size.
PiperOrigin-RevId: 206197663
2018-08-02 17:58:34 -07:00
cketcham
40696b02b7 Fix jagged edges on cutout for BottomAppBar
PiperOrigin-RevId: 206194466
2018-08-02 17:57:09 -07:00
Material Design Team
4983b60975 Fix potential bug with shared pointF
PiperOrigin-RevId: 206128392
2018-08-02 17:55:02 -07:00