727 Commits

Author SHA1 Message Date
dniz
6adba8f93b Fix MaterialShapeDrawable to work with ColorStateLists for fill and stroke tint
and paint

PiperOrigin-RevId: 238478987
2019-03-22 16:09:16 -04:00
Chris Banes
78054fe4ea AppBarLayout + WindowInset handling fixes
When AppBarLayout is used with a CollapsingToolbarLayout
child, it currently does not handle WindowInsets
very well. This commit fixes that by properly handling
insets.

The primary issue is when an AppBarLayout is used
with a single Toolbar (very common use case), where
the Toolbar will currently be displayed behind the status bar.

Another issue is with HeaderScrollingViewBehavior.
To workaround CoordinatorLayout using its 'compatible measuring'
for insets, the behavior manually sets the scrolling view to fit
system windows. This has other issues though because
that view will get padded in. Fixed by manually adding the insets
back into the measured dimensions.

Also updated the catalog layouts to make use of
android:fitsSystemWindows=true

Resolves https://github.com/material-components/material-components-android/pull/299

PiperOrigin-RevId: 238396626
2019-03-22 16:08:28 -04:00
connieshi
931b97a360 Add res-public for BadgeDrawable.
PiperOrigin-RevId: 238295054
2019-03-22 16:07:55 -04:00
connieshi
b9112b2811 Viewoverlay is only available on API 18+. To support pre API-18, change BadgeDrawable to inherit from Drawable instead of MaterialShapeDrawable. Instead, add an instance of MaterialShapeDrawable as a member variable to BadgeDrawable.
PiperOrigin-RevId: 238289676
2019-03-22 16:06:49 -04:00
marianomartin
8b277edc7c [MaterialCardView] Change strokeColor to be a ColorStateList
PiperOrigin-RevId: 238241769
2019-03-22 16:05:58 -04:00
Material Design Team
3bce1b6f46 Set MaterialButton's accessibility class name to match the platform Button widget so that a11y services can verbalize instances as Buttons. For instance, a button with content description "foo" should be verbalized as "foo Button"
PiperOrigin-RevId: 238032322
2019-03-22 16:05:13 -04:00
gauthams
c7d081a9e8 Use getEllipsizedWidth rather than getWidth when measuring text in MaterialButton
PiperOrigin-RevId: 237853613
2019-03-22 16:03:58 -04:00
dniz
7b594393c8 Dark Theme Elevation Overlay system
PiperOrigin-RevId: 237829773
2019-03-22 16:02:26 -04:00
connieshi
9594f64985 Implement basic layout and drawing functionality for BadgeDrawable.
PiperOrigin-RevId: 237500680
2019-03-22 15:55:00 -04:00
connieshi
046089cf13 Fix values-21 name spelling error, should be values-v21 instead.
PiperOrigin-RevId: 237451216
2019-03-22 15:53:56 -04:00
connieshi
4455d1904c Add TextAppearance.MaterialComponents.Badge (Roboto Medium 10sp). Intentionally not adding it to res-public/public.xml nor a corresponding theme attribute because it is meant to be used internally by the library only.
PiperOrigin-RevId: 237446384
2019-03-22 15:52:59 -04:00
Material Design Team
aae325e6b4 Migrate interpolator android support libraries to androidx.
PiperOrigin-RevId: 237401244
2019-03-08 10:11:23 -05:00
ldjesper
a6968befc1 Unique name for MaterialDatePickerView styles
PiperOrigin-RevId: 237271488
2019-03-08 10:09:55 -05:00
connieshi
5a9e0d378d Update ChipDrawable to use TextDrawableHelper to handle logic related to text rendering. ChipDrawable is still responsible for drawing text.
PiperOrigin-RevId: 237257476
2019-03-08 10:08:59 -05:00
ldjesper
0aa32c1ce6 Adds a bare implementation of a date picker not yet ready for use
PiperOrigin-RevId: 237052095
2019-03-08 10:06:25 -05:00
Material Design Team
357ac6a800 Automated g4 rollback of changelist 236909539
PiperOrigin-RevId: 236951421
2019-03-08 10:05:39 -05:00
ldjesper
206ef37620 Adds a bare implementation of a date picker
PiperOrigin-RevId: 236909539
2019-03-08 10:03:53 -05:00
Material Design Team
1cc0a2b4e4 Automated g4 rollback of changelist 236879782
PiperOrigin-RevId: 236896313
2019-03-08 10:00:53 -05:00
ldjesper
8c9f9d5e01 Date Range Picker
PiperOrigin-RevId: 236879782
2019-03-08 09:59:54 -05:00
marianomartin
01874ad4e9 Change setElevation in MSD to use default offset
PiperOrigin-RevId: 236858323
2019-03-08 09:58:58 -05:00
marianomartin
77ac869283 Add single selection attr to resources package
PiperOrigin-RevId: 236851563
2019-03-08 09:58:19 -05:00
gauthams
cad9d7d5f5 Add MaterialButtonToggleGroup
PiperOrigin-RevId: 236745008
2019-03-08 09:56:58 -05:00
isabellekim
6f965da141 Move content padding to be inside the intermediate FrameLayout in MaterialCardView. This allows clipping to the inside of the stroke as the FrameLayout bounds and the stroke bounds will be the same.
PiperOrigin-RevId: 236646347
2019-03-08 09:55:07 -05:00
leticiars
4690a8893d Fixing end icon tint always being overriden by old password toggle tint.
PiperOrigin-RevId: 236645688
2019-03-08 09:51:23 -05:00
gauthams
e1c8b13064 Add package-private methods to set shape appearance on MaterialButton
PiperOrigin-RevId: 236355481
2019-03-08 09:50:08 -05:00
gauthams
1deb4cc1db Add state_checkable to MaterialCardView drawable state, if isCheckable()
PiperOrigin-RevId: 236116032
2019-03-08 09:46:49 -05:00
gauthams
bc33a8042f Update MaterialButton checked colors
PiperOrigin-RevId: 235987525
2019-03-08 09:42:40 -05:00
marianomartin
fd4d66227d Remove background from MaterialComponents Fab style
PiperOrigin-RevId: 235983820
2019-03-08 09:41:58 -05:00
connieshi
93c5fc737b Add TextDrawableHelper, a class that helps drawables support drawing text.
PiperOrigin-RevId: 235979500
2019-03-08 09:41:15 -05:00
marianomartin
68357af199 [MaterialCardView] Fix clipping logic to inset by stroke
PiperOrigin-RevId: 235979330
2019-03-08 09:40:38 -05:00
connieshi
3bd6fd4688 Composite chip surface and background color to reduce ovedraw.
PiperOrigin-RevId: 235979248
2019-03-08 09:39:53 -05:00
dniz
c0de00cdac Fix MaterialShapeDrawable bug that causes compat shadows to be drawn for round rects on lollipop+
PiperOrigin-RevId: 235786787
2019-02-27 18:00:21 -05:00
leticiars
168a468f29 Refactoring TextInputLayout's end icon initialization to always have the end icon view ready. Also refactoring OnEndIconInitializedListener to OnEditTextAttached listener.
PiperOrigin-RevId: 235781672
2019-02-27 17:59:10 -05:00
gauthams
1db449c897 Refactor dpToPx method into ViewUtils
PiperOrigin-RevId: 235243747
2019-02-24 14:38:37 -05:00
isabellekim
6c3b51022e Adds itemRippleColor attribute to the BottomNavigationView as an alternative for itemBackground to support using ripples based on theme attributes pre-23. And update BottomNavigationView ripples to match TabLayout ripples.
PiperOrigin-RevId: 235237859
2019-02-24 14:37:45 -05:00
leticiars
b7f520d0f6 Fix padding of TextInputEditText when an icon is present.
PiperOrigin-RevId: 235236593
2019-02-24 14:36:44 -05:00
isabellekim
db94f66f86 Updating MDC library build files to add testing of each target.
PiperOrigin-RevId: 235203056
2019-02-24 14:35:32 -05:00
Material Design Team
3745cc5960 There is no need to use deprecated Space class from support library. Space was added in API 14 in platform and hasn't changed since.
PiperOrigin-RevId: 235055577
2019-02-24 14:33:42 -05:00
cketcham
1f6314cc2f Fix menu position bug in BottomAppBar
Fixes bug where the MenuView would not be positioned correctly if the first call to replaceMenu() happened after the view was laid out.

PiperOrigin-RevId: 235046970
2019-02-24 14:33:02 -05:00
gauthams
f354ff9df0 Add missing a11y info to MaterialButton
PiperOrigin-RevId: 235042404
2019-02-24 14:32:18 -05:00
isabellekim
3e6219ceb2 Rolling forward using colorControlActivated instead of colorSecondary for the activated color of MaterialCheckbox, MaterialRadioButton, and SwitchMaterial.
By default, colorControlActivated is set to colorAccent. Non-bridge themes set colorAccent to colorSecondary.

PiperOrigin-RevId: 235041384
2019-02-24 14:31:35 -05:00
connieshi
59bc6c3ebe Add boilerplate code (getters, setters, override abstract methods) define custom attributes for new custom drawable, BadgeDrawable.
PiperOrigin-RevId: 235037646
2019-02-24 14:30:54 -05:00
marianomartin
7087f8e5d7 Update MaterialCardView javadocs
PiperOrigin-RevId: 235026790
2019-02-24 14:29:55 -05:00
isabellekim
8ffff9c658 Automated g4 rollback of changelist 234987118
PiperOrigin-RevId: 235019920
2019-02-24 14:29:13 -05:00
isabellekim
7b79678f9b Use colorControlActivated instead of colorSecondary for the activated color of MaterialCheckbox, MaterialRadioButton, and SwitchMaterial.
By default, colorControlActivated is set to colorAccent. Non-bridge themes set colorAccent to colorSecondary.

PiperOrigin-RevId: 234987118
2019-02-24 14:27:59 -05:00
dniz
fdbd553fc4 Set ActionMode background in Primary and Surface theme overlays
PiperOrigin-RevId: 234791713
2019-02-24 14:25:47 -05:00
Material Design Team
76a9b23443 Add SCROLL_FLAG_NO_SCROLL flag for AppBarLayout.LayoutParams
PiperOrigin-RevId: 234683507
2019-02-24 14:25:13 -05:00
leticiars
56859415e8 Adding support for a custom end icon for the TextInputLayout.
A user-specified icon can now be set via app:endIconMode="custom" and attributes app:endIconDrawable and app:endIconContentDescription. It is also possible to set a custom OnClickListener via TextInputLayout's end icon API.

PiperOrigin-RevId: 234671237
2019-02-24 14:23:57 -05:00
connieshi
b641bf706f Avoid infinite loop in Chip#SetLayoutDirection.
PiperOrigin-RevId: 234604880
2019-02-24 14:22:05 -05:00
marianomartin
8449d0e7dc Change opacity of dragged state in cards
PiperOrigin-RevId: 234603183
2019-02-24 14:21:10 -05:00