39 Commits

Author SHA1 Message Date
marianomartin
9837721733 Replace circular border drawable with a drawable for any shape.
PiperOrigin-RevId: 224205053
2018-12-06 12:05:36 -05:00
cketcham
3ad01eceda Ignore empty header and dividers when counting the number of items in NavigationView for accessibility
PiperOrigin-RevId: 223407274
2018-12-06 11:39:08 -05:00
ldjesper
831ad7dde7 a11y for selection control touch targets
PiperOrigin-RevId: 222898711
2018-12-06 11:24:17 -05:00
Brian Attwell
483d34a0f4 Don't rebind/relayout/reinflate any views after clicking a menu item
If none of the check state has changed, let's not update the menu. Background for this diff is at #61. While larger improvements may make sense, this diff is designed to mitigate the most serious issue in a way that doesn't create risk.

Test: used these modified classes inside the Android Uber app and ran a profiler. The problematic 50ms delay caused by this bug was fixed. You can see the before/after traces in https://issuetracker.google.com/issues/73723207.

Resolves https://github.com/material-components/material-components-android/issues/61
Resolves https://github.com/material-components/material-components-android/pull/62

GIT_ORIGIN_REV_ID=f8f8488689be67b8974d29e1c623e1dbe18cfdae
PiperOrigin-RevId: 221799350
2018-11-16 12:23:34 -05:00
connieshi
3cc29997ec Removed unused touch target helper classes.
PiperOrigin-RevId: 221318504
2018-11-16 11:37:01 -05:00
dniz
35a0839ad6 Add defStyleRes to materialThemeOverlay wrapping
- Fixes materialThemeOverlay case where client is not using our theme or style (e.g., AppCompat + component with no style set)
- Also refactors createThemedContext() to use obtainStyledAttributes with defStyleAttr and defStyleRes instead of getTheme().resolveAttribute()

PiperOrigin-RevId: 213464594
2018-09-28 14:53:34 -04:00
dniz
dff21575fb Add ContextUtils getActivity() method
PiperOrigin-RevId: 213356904
2018-09-28 14:52:27 -04:00
leticiars
df551410c4 Fixing padding of hint label when there is a leading icon
PiperOrigin-RevId: 213277053
2018-09-28 14:49:23 -04:00
dniz
461101bc5b Fix Gradle build by removing Java 8 method reference
PiperOrigin-RevId: 212685609
2018-09-14 11:00:30 -04:00
cketcham
655b3dc1b0 Add materialThemeOverlay attribute
PiperOrigin-RevId: 212665868
2018-09-14 10:58:21 -04:00
Material Design Team
850795da31 Delegates CollapsingTextHelper text attributes processing to TextAppearance.
This removes duplication between the 2 implementations and automatically fixes font loading bug in CollapsingToolbarLayout & TextInputLayout. It has a side effect of changing font loading from sync to async but it shouldn't affect anyone since font loading wasn't really working in the first place. It may affect the UIs that were affected by the original bug though.

To alleviate possible "font flickering" due to async loading, CollapsingTextHelper defers the TextPaint changes until the font is actually loaded.

Another scenario the async loading would have an impact on is when the font is manually overwritten with CollapsingTextHelper.setTypeface() while async op is still ongoing. The result of async load would then overwrite the font back to the originally requested. This happens in TextInputLayout which overwrites its own font setting to this of its child whenever its added. This may happen before async op completes. To guard against that, any direct font setting automatically cancels the async load (cancels == ignores the result when it comes).

PiperOrigin-RevId: 212328671
2018-09-14 10:53:39 -04:00
Material Design Team
a5d38d43d6 Changes SwitchMaterial coloring to composites instead of blends.
Also provides color layering utilities and removes text color changes.

PiperOrigin-RevId: 211692944
2018-09-07 11:55:28 -04:00
Material Design Team
56ee534de2 Creates and colors SwitchMaterial
PiperOrigin-RevId: 210574240
2018-08-28 16:44:02 -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
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
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
cketcham
4f7cf963c4 Automated g4 rollback of changelist 206313825
PiperOrigin-RevId: 206319662
2018-08-02 18:02:01 -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
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
7487a539f7 Add support for ThemeOverlays with the default style attr in MaterialCardView and TextInputLayout
PiperOrigin-RevId: 206004683
2018-08-02 17:54:28 -07:00
marianomartin
4088fdb1ed Implement getConstantState in CircularBorderDrawable
This fixes a crash on FloatingActionButtonLollipop when it tries to set the background. It calls mutate which calls it on this drawable. Which calls getConstantState().newDrawable()

PiperOrigin-RevId: 205108784
2018-07-19 11:02:32 -04:00
connieshi
a4292a11de Always compute layout width / height and call setMeasuredDimension even when there are no children instead of delegating to View (which was erroneously setting the height to take up all available space).
This fixes a bug that causes the chipgroup to erroneously takeover the entire height of the screen.

PiperOrigin-RevId: 204810068
2018-07-17 18:10:11 -04:00
connieshi
36c01edeb2 Switch ChipGroup to inherit from FlowLayout.
PiperOrigin-RevId: 204296714
2018-07-12 16:18:34 -04:00
cketcham
e22213ba58 Automated g4 rollback of changelist 204005581
PiperOrigin-RevId: 204142484
2018-07-11 15:22:03 -04:00
connieshi
602a9b63a4 Switch ChipGroup to inherit from FlowLayout.
PiperOrigin-RevId: 204005581
2018-07-11 15:17:56 -04:00
gauthams
98350d8bdf Update TextAppearance enforcement error to be more clear.
PiperOrigin-RevId: 202189106
2018-07-02 09:43:00 -04:00
gauthams
c852e7f0cf Make ThemeEnforcement TextAppearance check more robust
PiperOrigin-RevId: 202039029
2018-07-02 09:39:28 -04:00
gauthams
580f63bd4d Remove unused ThemeEnforcement method
PiperOrigin-RevId: 201101785
2018-06-20 17:29:16 -04:00
gauthams
670787be83 Update button to use textappearance theme attributes, and enforce textappearance check
PiperOrigin-RevId: 198609334
2018-05-30 17:45:15 -04:00
marianomartin
663fd7abff add res-public files
PiperOrigin-RevId: 198567215
2018-05-30 17:42:48 -04:00
dniz
b4529d2a88 Remove unused MathUtils methods and add documentation. Also replace
MathUtils#constrain with Support Library MathUtils#clamp

PiperOrigin-RevId: 197905324
2018-05-30 17:31:27 -04:00
dniz
81c4ece8f7 Remove colorPrimaryLight, colorSecondaryLight, and colorSecondaryDark
PiperOrigin-RevId: 197093793
2018-05-22 13:56:47 -04:00
dniz
80a6fbe0af Namespace FlexboxLayout styleable
PiperOrigin-RevId: 194788079
2018-04-30 15:12:00 -04:00
dniz
b504d3fc3d Set up Gradle task for docs build
PiperOrigin-RevId: 194457377
2018-04-30 12:03:20 -04:00
gauthams
ac27064891 Add paired getter and setter for NavigationView setCheckedItem()/getCheckedItem()
PiperOrigin-RevId: 193267214
2018-04-30 11:28:37 -04:00
gauthams
224a7e8b4a Add textAppearance check to ThemeEnforcement
PiperOrigin-RevId: 193254833
2018-04-30 11:28:13 -04:00
dniz
9ca33544ac Update package name to com.google.android.material
PiperOrigin-RevId: 193236235
2018-04-30 11:24:23 -04:00