1425 Commits

Author SHA1 Message Date
cketcham
dc17035a8b Fix height of Slider when floating label is false
PiperOrigin-RevId: 286201599
2019-12-18 15:55:40 -05:00
dniz
4e0a016d07 Update MaterialDatePicker to read colorSurface from correct context
Fixes issue where colorSurface from materialCalendarTheme is ignored

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

PiperOrigin-RevId: 286194512
2019-12-18 15:55:09 -05:00
cketcham
f28cc095a7 Reorganized and updated comments in Slider
PiperOrigin-RevId: 286194091
2019-12-18 15:54:30 -05:00
dniz
2059499085 Fix AppBarLayout statusBarForeground issue where status bar drawable is drawn behind content
Resolves https://github.com/material-components/material-components-android/issues/824

PiperOrigin-RevId: 285981837
2019-12-17 17:07:12 -05:00
cketcham
921d392602 Rename slider tick and track color attributes to keep them together when sorted alphabetically
PiperOrigin-RevId: 285972204
2019-12-17 17:06:10 -05:00
cketcham
1723dd4580 Recaulculate Slider ticks when the step size changes
PiperOrigin-RevId: 285968387
2019-12-17 17:05:44 -05:00
leticiars
9dcb12169f [TextInputLayout] Fixing cutout not working with CENTER_HORIZONTAL.
Resolves https://github.com/material-components/material-components-android/issues/822

PiperOrigin-RevId: 285781713
2019-12-16 16:01:50 -05:00
cketcham
b1816e118b Draw the halo color instead of the thumb color for the compat halo for Slider
PiperOrigin-RevId: 285489212
2019-12-16 16:01:03 -05:00
cketcham
6adbcc2777 Rename Slider forceDrawCompatShadow to be forceDrawCompatHalo
PiperOrigin-RevId: 285442759
2019-12-16 16:00:24 -05:00
cketcham
8728e8d0be Remove extra thumbElevation declaration from Slider's public.xml
PiperOrigin-RevId: 285413256
2019-12-13 17:33:06 -05:00
marianomartin
1aef5b9a9e [ImageView] Add catalog ImageView demo
PiperOrigin-RevId: 285279245
2019-12-13 17:30:43 -05:00
dniz
86b2ec3243 Update Snackbar gesture inset calculation to factor in translationY
Fixes issue of compounding margins for legacy Snackbar which uses a slide animation that affects it's position on the screen

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

PiperOrigin-RevId: 285246645
2019-12-12 16:10:26 -05:00
Jake Wharton
d7a5dc8fb7 Use conditional keep rule for MaterialComponentsViewInflater
Resolves https://github.com/material-components/material-components-android/issues/818
Resolves https://github.com/material-components/material-components-android/pull/821

GIT_ORIGIN_REV_ID=2e0039b5881fdb58b691b37eb0cf3ff4e043ffb7
PiperOrigin-RevId: 285198021
2019-12-12 11:44:55 -05:00
cketcham
3c3ac61c91 Add workaround to prevent FloatingActionButton crash on API 26.
Resolves https://github.com/material-components/material-components-android/issues/66

PiperOrigin-RevId: 284999697
2019-12-11 17:10:07 -05:00
connieshi
7461eda024 Add null check so that TabelLayoutMediator.detach can be called more than once without causing NPE.
Resolves https://github.com/material-components/material-components-android/issues/804

PiperOrigin-RevId: 284976120
2019-12-11 17:09:14 -05:00
afohrman
201ec6241c Add support for placeholder text in TextInputLayout.
This is the initial implementation of placeholder text; it does not contain motion. At this stage, TextInputLayout sets the placeholder text visibility based on whether or not it should show.

PiperOrigin-RevId: 284808331
2019-12-11 17:06:57 -05:00
cketcham
fe160f33e6 Add option to set the track height of the Slider
PiperOrigin-RevId: 284667379
2019-12-10 07:25:07 -05:00
cketcham
df94cd1bca Remove the requirement to setClipChildren false on the parent of Slider
Draw the Slider label with ViewOverlay, and update the way the halo is drawn pre lollipop. This stops any clipping that happens by the bounds view.

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

PiperOrigin-RevId: 284650572
2019-12-10 07:24:00 -05:00
haodong
6694175a5f Fixed getDayCopy utility function in UtcDates for DatePicker.
- was copying year/month/date fields between Calendar objects in different time zones.
- convert input Calendar object into a Calendar object in UTC, then copy year/month/date fields to the return Calendar object.

PiperOrigin-RevId: 284597830
2019-12-10 07:22:59 -05:00
leticiars
eabbfa2aa5 Limiting helper/error view width so that counter view doesn't get pushed out.
Resolves: https://github.com/material-components/material-components-android/issues/689
PiperOrigin-RevId: 284594896
2019-12-10 07:21:56 -05:00
connieshi
186884701d Call themeApplicationContext inside createToggleGroupWithButtons because the order of @Before method calls is not deterministic.
PiperOrigin-RevId: 284244654
2019-12-10 07:18:55 -05:00
Material Design Team
d548948b9c [TabLayout] Re-introducing TabLayout indicator animator fix from cl/283626239
Includes a preemptive fix for b/145715060, which was introduced in the first attempt.

PiperOrigin-RevId: 284229049
2019-12-08 15:21:33 -05:00
marianomartin
15ed06eb86 Move ImageView component to third party
PiperOrigin-RevId: 284189970
2019-12-08 15:20:54 -05:00
Material Design Team
d8c35d7de9 Automated g4 rollback of changelist 283626239
PiperOrigin-RevId: 284045727
2019-12-08 14:43:33 -05:00
Zhaonian Luan
be8fb0f1ff [MaterialButtonToggleGroup] Clean up
Resolves https://github.com/material-components/material-components-android/pull/796

Co-authored-by: wcshi <38438920+wcshi@users.noreply.github.com>

GIT_ORIGIN_REV_ID=77f2471c1fbd9b44a8df1d252a41d582ddcbee0f
PiperOrigin-RevId: 284044596
2019-12-08 14:18:17 -05:00
haodong
77ce281f04 Fixed MaterialDatePicker todayInUtcMilliseconds method.
- Used UtcDates to return the UTC milliseconds of today in local timezone.
- Previous method is replaced with thisMonthInUtcMilliseconds, which fits its function better.
Resolves https://github.com/material-components/material-components-android/issues/778

PiperOrigin-RevId: 283981946
2019-12-05 15:58:26 -05:00
leticiars
b78be8d866 [TextInputLayout] Fixing error message getting announce twice in Q
PiperOrigin-RevId: 283972549
2019-12-05 15:15:32 -05:00
melaniegoetz
e0578295e1 Update BottomSheet to have a singular SettleRunnable
Resolves https://github.com/material-components/material-components-android/issues/516

PiperOrigin-RevId: 283802793
2019-12-05 14:50:09 -05:00
connieshi
2a9c3f3ad1 Automated g4 rollback of changelist 283714901
PiperOrigin-RevId: 283801062
2019-12-05 14:45:24 -05:00
sadeghpro
c4ce69756d [dialog] Fix multichoice and singlechoice alert dialog in rtl mode of old api
Resolves https://github.com/material-components/material-components-android/pull/753

Co-authored-by:hunterstich <hunterstich@google.com>

GIT_ORIGIN_REV_ID=f7475a875d5b9a30fa56928baa43cc2c513a1fe5
PiperOrigin-RevId: 283797976
2019-12-05 14:38:51 -05:00
connieshi
415628f1cd Automated g4 rollback of changelist 283621202
PiperOrigin-RevId: 283714901
2019-12-05 14:37:46 -05:00
Material Design Team
aa3164d43a [Tabs] Remove unnecessary animator cancellation in SlidingTabIndicator's onLayout method.
PiperOrigin-RevId: 283626239
2019-12-05 14:37:00 -05:00
connieshi
e3be6b0e85 Support setting textAllCaps in textAppearance xml, switch from calling setSingleLine to setLines(1) so the transformation methods don't replace each other.
android:textAllCaps="true" in the layout xml is being ignored because:

1) A known issue where Chip only reads from its textappearance. However, even after creating a custom textappearance that sets textAllCaps to true, I'm observing an odd behavior:
if I comment out the setSingleLine method call in the constructor, then the text becomes all caps. If I comment setSingleLine back in and call setAllCaps, then the text becomes capitalized and single line.

I think it's related to two different transformation methods being applied. The one inside setsingleline clobbers the one set by setAllCaps.

TextView's constructor applies the singleLine transformation before applying text appearance attributes
https://github.com/aosp-mirror/platform_frameworks_base/blob/master/core/java/android/widget/TextView.java#L1570-L1609

https://github.com/aosp-mirror/platform_frameworks_base/blob/master/core/java/android/widget/TextView.java#L10232

2) The library implementation of TextAppearance reads from "textAllCaps" instead of "android:textAllCaps".
11c57abbd6/lib/java/com/google/android/material/resources/TextAppearance.java (L96)
However, if you call Chip#setTextAppearance(@StyleRes int id) which passes it the super method, then "android:textAllCaps" needs to be set because "textAllCaps" is ignored
::sigh::

PiperOrigin-RevId: 283621202
2019-12-05 14:33:18 -05:00
cketcham
7d4b472262 Add copy of ViewOverlay compatibility until it is included in androidx
PiperOrigin-RevId: 283403884
2019-12-03 17:16:13 -05:00
leticiars
6efedee757 Adding onInitializeAccessibilityNodeInfo override in TextInputEditText.
In APIs < 23 some things set in TextInputLayout's AccessibilityDelegate get overwritten, so announcements are not as expected.

PiperOrigin-RevId: 283396918
2019-12-03 17:04:54 -05:00
connieshi
12c0e435dc Add reference to Github bug in todo for more context.
PiperOrigin-RevId: 283390765
2019-12-03 17:02:41 -05:00
connieshi
d25fa92021 Support tinted chip icons.
Resolves https://github.com/material-components/material-components-android/issues/767

PiperOrigin-RevId: 283387208
2019-12-03 17:00:18 -05:00
leticiars
11c57abbd6 [TextInputLayout] When error message is showing, announce it in place of the helper text when a text field is focused on.
PiperOrigin-RevId: 282801995
2019-12-02 17:33:35 -05:00
leticiars
6849bae3e9 [TextInputLayout] Fixing duplicate announcement when character limit is exceeded and adding announcement for when the limit is reached.
PiperOrigin-RevId: 282787253
2019-12-02 17:32:42 -05:00
marianomartin
58190deb21 [Slider] Cannot set stepSize < 1.0
Resolves https://github.com/material-components/material-components-android/issues/704

PiperOrigin-RevId: 282783034
2019-12-02 17:31:47 -05:00
Andreas Rossbacher
db7fde2cd6 [CardView] Fix potential Proguard/Dexguard/R8(?) optimization problem
Resolves https://github.com/material-components/material-components-android/pull/790

GIT_ORIGIN_REV_ID=fddc631d7a7c010044ab66247bec85f0aba097aa
PiperOrigin-RevId: 282769919
2019-12-02 17:31:16 -05:00
connieshi
3a337c0110 Hardcode non-framework classname used to call AccessibilityNodeInfo#setClassName so it doesn't get obfuscated by Proguard.
PiperOrigin-RevId: 282618314
2019-12-02 17:28:30 -05:00
cketcham
5d1a369ea0 Update Slider to use TooltipDrawable
PiperOrigin-RevId: 282583539
2019-12-02 17:27:40 -05:00
leticiars
29f3d05fa8 Adding helper text to the hint node so that TalkBack announces it when a text field is selected.
This provides more context for the user since the helper text is located below the text field (which is still focusable via TalkBack for now).

PiperOrigin-RevId: 282560641
2019-12-02 17:26:39 -05:00
cketcham
a282afe559 Initial implementation of TooltipDrawable
PiperOrigin-RevId: 282041829
2019-12-02 17:23:58 -05:00
marianomartin
c421319497 Remove tooltip from gradle
PiperOrigin-RevId: 282013901
2019-12-02 17:16:29 -05:00
cketcham
5f4a1394e5 Add OffsetEdgeTreatment
PiperOrigin-RevId: 281991688
2019-11-22 21:45:35 +00:00
marianomartin
781e79f4b1 Disable MaterialCardView bitmap drawing
PiperOrigin-RevId: 281825046
2019-11-22 21:27:37 +00:00
Material Design Team
cc9b9c1103 Add CollectionInfos and CollectionItemInfos to tabs for accessibility. Also make a tab non-clickable by a11y when it is selected.
PiperOrigin-RevId: 281785987
2019-11-22 21:25:50 +00:00
marianomartin
bb1e9e47a4 Enable non convex shadows on Q
PiperOrigin-RevId: 281750600
2019-11-22 21:24:52 +00:00