1291 Commits

Author SHA1 Message Date
ruben
cde09d4b4e [Slider] Add missing functionality from SeekBar regarding touch events and value changes
Resolves https://github.com/material-components/material-components-android/pull/831

GIT_ORIGIN_REV_ID=70dd0a10ef204837b01ed9593cfdd9bcf9137228
Co-authored-by: cketcham <cketcham@gmail.com>
PiperOrigin-RevId: 287545665
2019-12-30 14:15:50 -05:00
cketcham
a011ace28f Remove ticksCoordinates from SliderState
There's no point in caching ticksCoordinates since it will have to be recalculated based on the new width once it's laid out again.

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

PiperOrigin-RevId: 287363665
2019-12-30 14:14:55 -05:00
cketcham
2098c0b460 Update Tooltip dimensions to match spec
PiperOrigin-RevId: 287249126
2019-12-30 14:13:55 -05:00
cketcham
9ae1494597 Add option to hide the Slider's label
This creates 3 options, to have the label floating, within the bounds of the view, or not shown.

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

PiperOrigin-RevId: 287244827
2019-12-30 13:31:52 -05:00
Material Design Team
5de9f01ade Move a11y delegate code from BottomNavigationView and TabLayout to onInitializeA11yNodeInfo.
PiperOrigin-RevId: 286929652
2019-12-23 15:44:28 -05:00
Material Design Team
4389a18128 Add CollectionInfos and CollectionItemInfos to MaterialButtonToggleGroup and MaterialButton for accessibility.
PiperOrigin-RevId: 286922716
2019-12-23 15:43:46 -05:00
cketcham
354edd09f4 Rename method in Slider
PiperOrigin-RevId: 286912170
2019-12-23 15:43:11 -05:00
leticiars
bf6ece0489 [TextInputLayout] Fixing outlined text fields not taking into account top padding for inseting the cutout properly.
Resolves https://github.com/material-components/material-components-android/issues/597

PiperOrigin-RevId: 286887568
2019-12-23 15:39:44 -05:00
cketcham
df61bff112 Fixed halo rendering bug for Slider
Using a hardware layer was causing problems in some versions of Android when drawing the halo ripple. Hardware layer really only needs to be used when the slider is disabled.

PiperOrigin-RevId: 286640042
2019-12-21 08:51:03 -05:00
cketcham
e38d260d69 Prevent unnecessary invalidation for Slider if the values haven't changed
PiperOrigin-RevId: 286632473
2019-12-21 08:50:33 -05:00
cketcham
5f631d48f0 Fix logic for when to draw Slider's compat halo
PiperOrigin-RevId: 286629247
2019-12-21 08:50:09 -05:00
cketcham
d8641182f9 Remove call to Slider's requestDisallowInterceptTouchEvent(false) in ACTION_UP
On the start of a new touch event on the parent, this will be reset.

PiperOrigin-RevId: 286623951
2019-12-21 08:49:30 -05:00
leticiars
8ed0ab7964 Fixing crash happening when password toggle is clicked without the edit text having focus in TalkBack mode.
PiperOrigin-RevId: 286590576
2019-12-21 08:49:03 -05:00
dniz
d72f3bc7d0 Remove log line from Chip
PiperOrigin-RevId: 286572627
2019-12-21 08:48:40 -05:00
Material Design Team
67fc0c9ff8 Allow collapsed bottom sheet to settle to half expanded state on dragging up.
PiperOrigin-RevId: 286554369
2019-12-21 08:48:14 -05:00
cketcham
3e212efdc2 Add getters and setters for colors for Slider
Resolves http://github.com/material-components/material-components-android/issues/770

PiperOrigin-RevId: 286472940
2019-12-21 08:47:32 -05:00
ruben
a7da96fac0 [Slider] Fixed behaviour when Slider is in a scrolling container
Resolves https://github.com/material-components/material-components-android/pull/833

GIT_ORIGIN_REV_ID=86b976f757fb8354ffe502c5acc32b6954890bb9
PiperOrigin-RevId: 286431744
2019-12-19 15:49:27 -05:00
leticiars
2084fd3f70 [Text Fields] Pan window so that keyboard doesn't hide helper/error views.
It doesn't pan if the user can already scroll (for example if it's in a scroll view).

PiperOrigin-RevId: 286424421
2019-12-19 15:47:57 -05:00
connieshi
a3204758f9 Fix chip text mis-alignment when its width is less than the minimum recommended touch target width.
Resolves https://github.com/material-components/material-components-android/issues/800

PiperOrigin-RevId: 286421752
2019-12-19 15:46:43 -05:00
Material Design Team
6405635df4 Handle horizontal system insets for BottomAppBar.
Previously only the bottom inset (navigation bar) would add extra padding to the BottomAppBar which avoided overlapping with the bottom inset when drawing edge-to-edge. A problem arises if the device is rotated horizontally. The FAB (or sometimes the ActionMenuView in RtL layouts) would overlap with the right inset, making usage impossible.

This CL adjusts the FAB and ActionMenuView X translations when necessary to avoid the horizontal system insets. Two new stylable attributes have been added to enable/disable this behavior, analogous to the existing attribute for bottom padding.

PiperOrigin-RevId: 286419669
2019-12-19 15:45:44 -05:00
johan12345
8dd8acecd9 Mutate gravity horizontal value on setExpandedTextGravity and setCollapsedTextGravity, so the code can assume they are set.
PiperOrigin-RevId: 286392235
2019-12-19 15:41:45 -05:00
cketcham
b2deaa3f22 Update the radius of the Slider RippleDrawable
PiperOrigin-RevId: 286239127
2019-12-18 15:56:40 -05:00
marianomartin
d49fff38ef Add a StaticLayoutCompat class that supports Max Lines
PiperOrigin-RevId: 286223820
2019-12-18 15:56:04 -05:00
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