491 Commits

Author SHA1 Message Date
afohrman
beee015feb Use EditText's background for the filled text field and fix underline flakiness.
PiperOrigin-RevId: 231857938
2019-02-11 11:08:22 -08:00
isabellekim
c149a75edb Stop adjusting content padding based on stroke width.
It is the responsibility of clients who want content to be inside the
stroke to set their content padding accordingly.

PiperOrigin-RevId: 231815048
2019-02-11 11:07:37 -08:00
ldjesper
e22d745ec0 materialAlertDialogTheme changes to spec (padding, text opacity, scrim color, divider color)
PiperOrigin-RevId: 231757787
2019-02-11 11:06:48 -08:00
Material Design Team
63d11da7e5 Extended FAB.
Implementation of an ExtendedFloatingActionButton which extends from a MaterialButton.

PiperOrigin-RevId: 231682739
2019-02-11 11:04:14 -08:00
Material Design Team
267bca1fd2 setHideable(false) on hidden bottom sheet animates to collapsed state
PiperOrigin-RevId: 231655251
2019-02-11 11:01:36 -08:00
leticiars
564bd28527 Fixing bug where font set via xml for text input's labels wouldn't be applied to the labels of an EditText with password transformation.
PiperOrigin-RevId: 231611177
2019-02-11 11:00:25 -08:00
gauthams
354349d833 Expose background shape drawable in MaterialButtonHelper
PiperOrigin-RevId: 231321351
2019-02-01 12:38:48 -05:00
afohrman
19039f7772 Automated g4 rollback of changelist 231246920
PiperOrigin-RevId: 231313735
2019-02-01 12:37:35 -05:00
afohrman
ef919e870a Use EditText's background for the filled text field and fix underline flakiness.
Use the EditText's background for the filled box text field and a MaterialShapeDrawable drawn to the canvas for the underline. This allows for many improvements to the filled text field.

This commit:
- Fixes the underline flakiness, where the underline used to not meet the edges until drawableStateChanged() was called after a layout pass (because TextInputLayout was attempting to use EditText's pre-existing underline, and the bounds of that Drawable weren't known in order to modify them until after drawableStateChanged())
- Removes the hard-coded box offset since it was only necessary when trying to use EditText's background drawable
- Brings the expanded label/hint a bit closer to the vertical center. Any more than this will require changing the bounds set on the expanded hint text and create misalignment between the expanded hint and any compound drawable that might be set

Specs: https://material.io/design/components/text-fields.html#spec

There is a possible alternative to drawing the underline manually: including the underline as part of the EditText's background. I investigated this option and rejected it, since it would require a re-architecture of the way TextInputLayout handles the box logic and many layers of box drawable nesting. It is much more straightforward and performant to draw the underline directly to the canvas than to convert the boxBackground to {LayerDrawable{MaterialShapeDrawable,{InsetDrawable{MaterialShapeDrawable}}}}.

This commit should only change the visuals of the filled text field; the outline text field should be visually untouched.

PiperOrigin-RevId: 231246920
2019-02-01 12:35:48 -05:00
ldjesper
9c4bed6503 Hide MaterialDatePickerDialog while the API is influx
PiperOrigin-RevId: 231218156
2019-02-01 12:34:14 -05:00
melaniegoetz
eefb5d4d77 Create ThemeOverlay's for BottomSheets, changes bottomSheetDialogTheme to use Overlay instead of full theme reference
PiperOrigin-RevId: 230944305
2019-01-25 15:23:16 -05:00
Material Design Team
a0ab1c29a3 Update Chip padding on RTL properties change
Prior to this change, when setLayoutDirection is called on a parent/ancestor View of a Chip, the updated layout direction could be propagated to the Chip without updating its text padding. This change forces a padding update whenever layout direction changes.

PiperOrigin-RevId: 230933347
2019-01-25 15:22:40 -05:00
melaniegoetz
c94b5209b9 Fix non-scrollable bottomsheet corners when set directly to STATE_EXPANDED
PiperOrigin-RevId: 230933282
2019-01-25 15:21:29 -05:00
ldjesper
704aff2f14 Removing constructor comments because of JDiff
PiperOrigin-RevId: 230751570
2019-01-25 14:02:21 -05:00
isabellekim
6362e720ec Use stroke width to determine whether a stroke should be drawn for
MaterialCardView.

PiperOrigin-RevId: 230713479
2019-01-25 14:01:46 -05:00
ldjesper
37a8acf454 Spinner Picker Window Shape
PiperOrigin-RevId: 230618573
2019-01-25 13:59:37 -05:00
marianomartin
20691fec78 Remove long click toggle behavior from MaterialCardView
PiperOrigin-RevId: 230617290
2019-01-25 13:58:17 -05:00
afohrman
e847a22103 Remove @VisibleForTesting annotation from CollapsingTextHelper#getCurrentCollapsedTextColor.
The annotation was only necessary for the method in TextInputLayout that calls CollapsingTextHelper#getCurrentCollapsedTextColor.

PiperOrigin-RevId: 230616582
2019-01-25 13:57:02 -05:00
afohrman
0aa470af86 Support custom backgrounds for outline text fields and use EditText's background for the text field's outline.
The outline box styles previously didn't allow a custom drawable to be set. The box background was handled by TextInputLayout, which nulled out the EditText's background and drew the boxBackground directly to the canvas. That meant that a call to TextInputEditText#setBackground() would not actually do anything - it would result in the same outline text field.

In order to respect the background drawable, TextInputEditText's background is set to null in the style. Then, TextInputLayout programmatically sets the custom outline drawable if the background is already null. This avoids overwriting a drawable that may have already been set on the TextInputEditText.

This change does pretty much nothing to the filled box style; since the EditText's underline is still being used, the background of the EditText was never set to null for that style. This change should be a no-op for that style.

This move to using the EditText's background for the outline also improves the bounds of the outline text field and gets rid of the cutoff that was appearing at the top of the outline when TextInputLayout's hint was disabled and a hint was set on the EditText.

PiperOrigin-RevId: 230538561
2019-01-25 13:55:36 -05:00
dniz
d1cd5d451f Only use window insets for Snackbar (BaseTransientBottomBar) bottom margin if
anchor view is not provided

PiperOrigin-RevId: 230532747
2019-01-25 13:54:48 -05:00
shuhart
ce2af89a1d [IndicatorViewController] Fix a caption view animations issue when you set two error subsequently.
Resolves https://github.com/material-components/material-components-android/pull/254

GIT_ORIGIN_REV_ID=e30dc1cac2a30394128a1ffcf82f8a995b787d90
PiperOrigin-RevId: 230405237
2019-01-22 17:07:29 -05:00
leticiars
ef0ca8d774 Updating default colors of password toggle in text fields.
PiperOrigin-RevId: 230401355
2019-01-22 17:06:37 -05:00
marianomartin
c20c2a4330 Fix DrawerLayout with NavigationView insetForeground
PiperOrigin-RevId: 230398984
2019-01-22 17:06:01 -05:00
dniz
4f75ec6daa Update FAB to respond to themed cornerFamily
- Remove hardcoded "rounded" corner family from FAB shapeAppearanceOverlay
- Remove BottomAppBar shape toggle override from demo (now that we have a
global switcher)
- Update BottomAppBar demo to base top edge on FAB shape appearance

PiperOrigin-RevId: 229971238
2019-01-22 17:03:27 -05:00
dniz
80aedb96ab Update AppBarLayout to new NestedScrolling3 API
Fixes issue where item click is ignored within one second of fling

PiperOrigin-RevId: 229957998
2019-01-18 14:30:27 -05:00
食梦兽
7caa7139c1 Height increase the bottomMargin of the view
Because the Behavior is to slide down to disappear, the more reasonable sliding distance should be the height of the view plus the bottomMargin of the view.

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

GIT_ORIGIN_REV_ID=77073b466107d2741c5688e06d7591a28913dcba
PiperOrigin-RevId: 229931959
2019-01-18 14:28:52 -05:00
ldjesper
3101512737 Remove package from .gradle file
PiperOrigin-RevId: 229743694
2019-01-18 14:25:04 -05:00
melaniegoetz
0f9b84e51f Allow public access of Behavior
PiperOrigin-RevId: 229651276
2019-01-18 14:23:51 -05:00
ldjesper
6a89dfd24a Current Android Date Picker Demos
PiperOrigin-RevId: 229592313
2019-01-18 14:22:48 -05:00
ldjesper
3b2186fb2c Reduces inset margins for small devices
PiperOrigin-RevId: 229549538
2019-01-18 14:17:11 -05:00
marianomartin
74b2ddfd6e Add checked icon tinting for MaterialCardView
PiperOrigin-RevId: 229429322
2019-01-18 14:15:16 -05:00
marianomartin
0a5d7e2b57 Add workaround to force ripple to redraw on P
PiperOrigin-RevId: 229370645
2019-01-18 14:14:31 -05:00
dniz
11df79f95c Clean up Gradle build shorthands for appcompat/androidx libraries
PiperOrigin-RevId: 229369959
2019-01-18 14:13:26 -05:00
melaniegoetz
41daf802f1 Fix NPE in BottomSheetBehavior onViewReleased
PiperOrigin-RevId: 229215869
2019-01-18 14:11:13 -05:00
dniz
03cf027bc7 Deprecate Experimental annotation and remove from Shapes
PiperOrigin-RevId: 229200655
2019-01-18 14:10:16 -05:00
marianomartin
2c1d3d99e0 Fix deprecated getEdgePath method
PiperOrigin-RevId: 229195616
2019-01-18 14:09:20 -05:00
denis-kim
e49cd32a43 Fix wrong position and state when touches settling view
1) When touches normal child view in settling bottom sheet,
the state goes to STATE_EXPANDED or STATE_COLLAPSED by SettleRunnable.
It should be STATE_DRAGGING.
SettleRunnable’s targetState should be ignored when settling is aborted.

2) When touches nested scroll child view in settling bottom sheet,
the settling animation is not stopped.
In settling state, the child view should be captured, not the nested scroll child.

Fixes: https://issuetracker.google.com/issues/119289861
Test: Touch or drag the settling bottom sheet

GIT_ORIGIN_REV_ID=514e20ad10aafcc6e95015d95e1efc888d93bed7
PiperOrigin-RevId: 228944484
2019-01-18 14:02:59 -05:00
Material Design Team
9dab50e145 Expose methods for fine grained control of TabLayout animation
Makes the following methods public:
- setScrollPosition(int, float, boolean, boolean)
- selectTab(Tab)
- selectTab(Tab, boolean)

This makes it possible to separate the link between a TabLayout and a ViewPager to another class.

PiperOrigin-RevId: 228887919
2019-01-18 14:01:38 -05:00
melaniegoetz
685f244e2e Animate Bottomsheet shape corner transitions
PiperOrigin-RevId: 228756397
2019-01-10 17:20:37 -05:00
marianomartin
eeba1619e9 Resubmit fix for MaterialButton padding bug
PiperOrigin-RevId: 228723499
2019-01-10 17:18:36 -05:00
marianomartin
8b7ec0c80e Add check drawable when card is selected.
PiperOrigin-RevId: 228715367
2019-01-10 17:17:34 -05:00
dniz
a4964594a1 Add MaterialShapeDrawable setElevation(float) and deprecate setShadowElevation(int)
PiperOrigin-RevId: 228572421
2019-01-10 17:16:43 -05:00
marianomartin
51bee714f6 Preserve icon after updating menus in BottomNav
PiperOrigin-RevId: 228525610
2019-01-10 17:11:43 -05:00
marianomartin
1220e66ce1 Automated g4 rollback of changelist 228351080
PiperOrigin-RevId: 228386136
2019-01-10 16:50:12 -05:00
marianomartin
218225008a Update stroke instead of creating background again
PiperOrigin-RevId: 228351080
2019-01-10 16:49:24 -05:00
marianomartin
5ef4727d84 Only use BorderDrawable in fab for Rounded Rects
PiperOrigin-RevId: 228350250
2019-01-10 16:48:03 -05:00
ldjesper
499dc02f8c Respect dialogCornerRadius in MaterialAlertDialogBuilders.
PiperOrigin-RevId: 228337335
2019-01-10 16:46:42 -05:00
gauthams
32db2e2af1 Update shape path edge length to prevent concave path
PiperOrigin-RevId: 228238196
2019-01-10 16:35:58 -05:00
leticiars
872cae3400 Updating MDC text field text appearance.
PiperOrigin-RevId: 228150532
2019-01-10 16:34:41 -05:00
marianomartin
0c00762410 Resubmit card view ripple changes
PiperOrigin-RevId: 227909348
2019-01-10 16:30:51 -05:00