47 Commits

Author SHA1 Message Date
cketcham
ccc629f064 Only read letter spacing for TextAppearance on API levels where it exists
PiperOrigin-RevId: 330771283
2020-09-10 11:12:47 -04:00
cketcham
d4a019359c Update TextAppearance and CollapsingTextHelper to respect letterSpacing set with TextAppearance styles
PiperOrigin-RevId: 328985766
2020-08-28 18:06:30 -04:00
leticiars
bc4c6e47ae [TextFields] Adjusted label position and edit text padding of filled text field for large font support. Also removed margin of icons when font is large.
PiperOrigin-RevId: 326486771
2020-08-13 16:50:06 -04:00
leticiars
1f8e76b3a1 [TextInputLayout] Fixed helper text position for large font sizes.
PiperOrigin-RevId: 325521228
2020-08-10 13:18:03 -04:00
dniz
b0240d9a77 [Resources] Fixed the types of some public attrs
Resolves https://github.com/material-components/material-components-android/issues/1560

PiperOrigin-RevId: 325010287
2020-08-05 10:59:36 -04:00
marianomartin
049ad022a6 Delete components build.gradle files
PiperOrigin-RevId: 320944144
2020-07-15 09:38:31 -07:00
marianomartin
e5f7951b01 [Chip] Support setting text size without changing TextAppearance
PiperOrigin-RevId: 320083914
2020-07-08 15:00:37 -04:00
marianomartin
555356b03f Internal cleanup
PiperOrigin-RevId: 318134343
2020-06-26 14:06:52 -04:00
Material Design Team
342ea9ad25 Internal cleanup
PiperOrigin-RevId: 317147378
2020-06-19 13:42:35 -04:00
Material Design Team
5213b46edd [Chip] Support setting checked icon's tint via xml attribute
PiperOrigin-RevId: 299429881
2020-03-09 10:45:57 -07:00
isabellekim
497cb97ef0 Expose common attributes that should be public.
PiperOrigin-RevId: 293840542
2020-02-10 09:56:09 -05:00
haodong
bb34f717df Refactor trackColor attribute into common resources.
PiperOrigin-RevId: 291983432
2020-01-29 15:32:01 -05:00
marianomartin
a4b90321e3 Add selection required option to MaterialButtonToggleGroup
Setting selectionRequired = true. Makes it so that the last option on the Group cannot be unselected. Similar to how a Text Alignment toggle works.

PiperOrigin-RevId: 281366158
2019-11-20 14:36:15 -05:00
marianomartin
573efa4b2f Add selection required option to ChipGroup
Resolves https://github.com/material-components/material-components-android/issues/651

PiperOrigin-RevId: 281274404
2019-11-19 10:31:43 -08:00
ldjesper
394bac6be0 Add MaterialDatePicker style and theme attributes to public.xml
Resolves https://github.com/material-components/material-components-android/issues/664

PiperOrigin-RevId: 273854001
2019-10-10 15:53:13 -04:00
marianomartin
0d4515cb46 Internal cleanup
PiperOrigin-RevId: 265971745
2019-08-29 14:59:20 -04:00
marianomartin
c99f9522c7 Update peekHeight's getter and setter to be not final.
PiperOrigin-RevId: 265891346
2019-08-29 14:51:33 -04:00
cketcham
1d2cb7aa35 Add @NonNull and @Nullable annotations
PiperOrigin-RevId: 265133488
2019-08-29 11:21:03 -04:00
dniz
cc73c2a630 Update TODOs
PiperOrigin-RevId: 259535844
2019-07-23 11:21:39 -04:00
dniz
0512f776c5 Remove sub-package AndroidManifest.xml files from lib directory
PiperOrigin-RevId: 258390736
2019-07-16 13:18:32 -04:00
raajkumars
d7a92485f8 Added support to automatically inflate MaterialTextView component into TextView.
Added support to prevent applying line heights from text appearance styles if the current theme sets the flag 'textAppearanceLineHeightEnabled' to false.

PiperOrigin-RevId: 256216184
2019-07-03 14:12:29 -04:00
isabellekim
1f4ea84a33 Adding dimension resources for ripple ColorStateLists.
Because ripples are implemented differently for different API levels, we are adding dimension resources that can be used when specific alphas are desired for the pressed, focused, and hovered states.

Ripples on top of surface color should use:
mtrl_low_ripple_pressed_alpha: effective 12%
mtrl_low_ripple_focused_alpha: effective 12%
mtrl_low_ripple_hovered_alpha: effective 4%
mtrl_low_ripple_default_alpha: effective 0%

Ripples on top of primary / secondary colors should use:
mtrl_high_ripple_pressed_alpha: effective 24%
mtrl_high_ripple_focused_alpha: effective 24%
mtrl_high_ripple_hovered_alpha: effective 8%
mtrl_high_ripple_default_alpha: effective 0%

Note: the "default" alpha needs to be non-zero for API 22-27 in order to prevent ripples for terminating prematurely.
PiperOrigin-RevId: 253825206
2019-06-24 16:44:58 -04:00
ldjesper
297f0d8913 Day Selection Styles for MaterialCalendar
PiperOrigin-RevId: 249456817
2019-05-24 14:17:18 -04:00
ldjesper
59070cc111 Simplified the redundant naming of MaterialAttributes static methods.
Added default values for non-throw cases.
Avoid returning TypedValue to simplify code using the helper methods.

PiperOrigin-RevId: 244007695
2019-04-19 21:27:28 -04:00
ldjesper
a94152a475 Change GM Dialog elevation to 6dp (which improves text contrast) and correct theme loading order such that materialAlertDialogTheme correctly overrides attributes in alertDialogTheme.
PiperOrigin-RevId: 243708330
2019-04-19 21:09:36 -04:00
ldjesper
30c15174a1 Add a helper method to resolve min touch target size (defaults 48dp)
PiperOrigin-RevId: 240622378
2019-04-05 15:13:25 -04:00
marianomartin
05bc55723a Add a way to disable min touch target size in fab
PiperOrigin-RevId: 239395098
2019-03-22 17:00:43 -04:00
dniz
be564e558b Update ElevationOverlayProvider to not throw an exception if related attributes
are missing from theme

PiperOrigin-RevId: 238584902
2019-03-22 16:14:51 -04:00
dniz
7b594393c8 Dark Theme Elevation Overlay system
PiperOrigin-RevId: 237829773
2019-03-22 16:02:26 -04:00
marianomartin
77ac869283 Add single selection attr to resources package
PiperOrigin-RevId: 236851563
2019-03-08 09:58:19 -05:00
dniz
a245d5725b Add @hide annotations to restricted classes in com.google.android.material.resources package
PiperOrigin-RevId: 232524359
2019-02-11 11:16:20 -08:00
ldjesper
37a8acf454 Spinner Picker Window Shape
PiperOrigin-RevId: 230618573
2019-01-25 13:59:37 -05:00
dniz
11df79f95c Clean up Gradle build shorthands for appcompat/androidx libraries
PiperOrigin-RevId: 229369959
2019-01-18 14:13:26 -05:00
marianomartin
8b7ec0c80e Add check drawable when card is selected.
PiperOrigin-RevId: 228715367
2019-01-10 17:17:34 -05:00
cketcham
dc72aaeed4 Migrate Gradle build and sources to androidx
PiperOrigin-RevId: 225551505
2018-12-21 11:07:45 -05:00
ldjesper
831ad7dde7 a11y for selection control touch targets
PiperOrigin-RevId: 222898711
2018-12-06 11:24:17 -05:00
dniz
fadcb7fc31 Add a MaterialAttributes#resolveAttribute method that doesn't throw, a
MaterialColors#getColor method that allows for a default value, and a MaterialResources#getColorStateList that accepts a TintTypedArray

PiperOrigin-RevId: 219170329
2018-11-01 16:07:21 -07:00
cketcham
f6f2f98c66 Read color value as CSL correctly on API 15 and below
PiperOrigin-RevId: 218858216
2018-10-28 21:41:38 -04:00
connieshi
f3a95d09fe Avoid constantly invalidating ChipDrawable when used in standalone mode.
Created TextAppearanceFontCallback (a fork of FontCallback) in order to pass parameter indicating whether font was resolved synchronously.

PiperOrigin-RevId: 216566240
2018-10-11 18:21:33 -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
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
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
dniz
24867f367c Fix error in Gradle build due to TextAppearance variable scope
PiperOrigin-RevId: 202488746
2018-07-02 09:46:29 -04:00
connieshi
d584f91ccc Resolve fonts asynchronously to avoid ANR.
Added flag to specify that fonts should be resolved synchronously for instrumentation tests.

PiperOrigin-RevId: 202033678
2018-07-02 09:37:14 -04:00
dniz
b97023751b Restrict TextAppearance class to library usage
PiperOrigin-RevId: 193249985
2018-04-30 11:27:44 -04:00
dniz
9ca33544ac Update package name to com.google.android.material
PiperOrigin-RevId: 193236235
2018-04-30 11:24:23 -04:00