68 Commits

Author SHA1 Message Date
hunterstich
733c9e08c2 [Carousel] Updated MaskableFrameLayout to clip more performantly.
Clipping is now handled differently depending on the shape being used and API level.
* 30+ always uses a ViewOutlineProvider
* 21+ uses a ViewOutlineProvider when the shape is a round rect
* All other API levels and cases fall back to canvas clipping

PiperOrigin-RevId: 516297199
2023-03-13 21:21:48 +00:00
pubiqq
158d9f012a [ShapeAppearance] Change relative corner size behavior for "vertical" shapes
Resolves https://github.com/material-components/material-components-android/pull/2929

GIT_ORIGIN_REV_ID=38438252c1d43d1ccbeb333bdfc7a76b469033f4
PiperOrigin-RevId: 471564817
2022-09-01 10:25:55 -07:00
hunterstich
5b50bf13a2 [Transitions] Fix container transform easing mapping.
PiperOrigin-RevId: 444901780
2022-04-27 13:32:37 -04:00
hunterstich
e151b7a8ae [Transitions] Update shared axis, fade through, and fade to use new easing and duration system.
PiperOrigin-RevId: 444897183
2022-04-27 13:31:00 -04:00
hunterstich
f2f454ba8a [Motion] Update container transform to use new motion system.
PiperOrigin-RevId: 444848054
2022-04-27 10:12:54 -04:00
hunterstich
0ab2068bac [Motion] Add new motion system duration theming
PiperOrigin-RevId: 436975443
2022-03-28 15:57:30 +00:00
hunterstich
0d91f4ac3b [Motion] Add motion easing xml interpolators and theme attributes.
PiperOrigin-RevId: 435639751
2022-03-18 18:52:15 +00:00
Material Design Team
cfc00aa5a3 Update android core class definitions across material
PiperOrigin-RevId: 414839941
2021-12-08 14:56:25 +00:00
Material Design Team
a487c89185 Internal change
PiperOrigin-RevId: 412135443
2021-11-29 17:35:39 +00:00
conradchen
b51692da7d [Transition] Fix NPE when removing window background
Null background is a totally valid state. Handles the nullness to prevent NPE from happening.

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

PiperOrigin-RevId: 386081632
2021-07-22 11:55:11 -04:00
hunterstich
217bdef9f0 [Motion] Add motion package and utils to resolve motion theme attrs.
PiperOrigin-RevId: 366065469
2021-04-01 10:51:35 -04:00
hunterstich
5d65278c82 [Motion] Updated FadeThroughProvider to allow customization of the fade through threshold.
PiperOrigin-RevId: 362065364
2021-03-15 15:12:41 -04:00
hunterstich
edd2eb57e5 [Motion] Updated motion theming attr names.
PiperOrigin-RevId: 356983952
2021-02-17 06:47:56 -08:00
afohrman
655caeddba [Motion] Added theming to MaterialFadeThrough transition.
PiperOrigin-RevId: 351843861
2021-01-15 17:01:51 -05:00
afohrman
478b4124d2 [Motion] Added theming to MaterialSharedAxis transition.
PiperOrigin-RevId: 351841194
2021-01-15 16:59:34 -05:00
afohrman
15a2307e91 [Motion] Refactored applyThemeValues() and related methods.
PiperOrigin-RevId: 351220994
2021-01-11 21:19:11 -05:00
afohrman
8e79c7ea1c [Motion] Added theming to MaterialFade transition.
PiperOrigin-RevId: 351180119
2021-01-11 21:15:56 -05:00
dniz
7e578e4b13 [Motion] Changed motionPath theme attr format to enum|string
PiperOrigin-RevId: 344865393
2020-12-01 09:28:06 -05:00
dniz
5154eeae32 [Motion] Applied easing, duration, and path theme attributes to MaterialContainerTransform
Also removed custom dagger container transform config from Catalog so that these motion theme changes are observable

PiperOrigin-RevId: 344118337
2020-11-25 10:25:26 -05:00
dniz
186d5ed023 [Motion] Added easing, duration, and path theme attributes, as well as utilities to read them
PiperOrigin-RevId: 343380483
2020-11-20 15:00:13 -05:00
dniz
ad1d173018 [Motion] Updated MaterialContainerTransform to support overshoot and added OvershootInterpolator, AnticipateOvershootInterpolator, and BounceInterpolator options to Catalog demos
Allows overshoot for the translation and width/height scale parts of the container transform's animation, not the fade part of the animation.

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

PiperOrigin-RevId: 341432972
2020-11-09 13:34:50 -05:00
hunterstich
d4d0dcdbc6 [Motion] Update ScaleProvider and SlideDistanceProvider to respect and restore a targets original scale/translation.
PiperOrigin-RevId: 339309231
2020-10-28 09:46:39 -04:00
hunterstich
5d0e0322b1 [Motion] Updated FadeProvider and FadeThroughProvider to support Activity alpha.
PiperOrigin-RevId: 338448088
2020-10-22 17:40:15 -04:00
hunterstich
49ad52288c [Motion] Updated FadeThroughProvider and FadeProvider to restore target's original alpha value.
Resloves https://github.com/material-components/material-components-android/issues/1701

PiperOrigin-RevId: 337374791
2020-10-16 05:53:46 -07:00
hunterstich
1fc5e8c51c [Slider] Added animation to scale in/out label above thumbs.
PiperOrigin-RevId: 336635571
2020-10-15 13:13:28 -07:00
hunterstich
06322aadb9 [Motion] Updated MaterialFadeThrough to respect client-set alpha values on target views.
Resolves https://github.com/material-components/material-components-android/issues/1701

PiperOrigin-RevId: 330932760
2020-09-10 11:15:14 -04:00
hunterstich
05e0496cf9 [Motion] Removed internal listener from container transform after transition ends.
Resolves https://github.com/material-components/material-components-android/issues/1601

PiperOrigin-RevId: 325798894
2020-08-10 13:21:50 -04:00
marianomartin
c59c04639c [MaterialShapeDrawable] Convert ShapeAppearancePathProvider to a singleton.
Also allocate less path objects.

PiperOrigin-RevId: 325287653
2020-08-06 21:10:36 -04:00
dniz
23d610007d [Motion] Improved MaterialContainerTransform approximation of native elevation shadows by using location of bounds on screen
Resolves https://github.com/material-components/material-components-android/issues/1543
Follow-up to https://github.com/material-components/material-components-android/issues/1126

PiperOrigin-RevId: 324807509
2020-08-04 10:47:27 -04:00
dniz
88ca5c9eeb [Motion] Removed extra transition background fade duration from MaterialContainerTransformSharedElementCallback in favor of nulling out sharedElementReenterTransition to prevent extra transition from happening
Related to https://github.com/material-components/material-components-android/issues/1433
Related to https://github.com/material-components/material-components-android/issues/1344

PiperOrigin-RevId: 322614608
2020-07-22 14:25:30 -04:00
dniz
889fca55a2 [Motion] Added extra transition background fade duration to MaterialContainerTransformSharedElementCallback to prevent extra Activity transition from happening
Resolves https://github.com/material-components/material-components-android/issues/1433
Mentioned in https://github.com/material-components/material-components-android/issues/1344

PiperOrigin-RevId: 321550602
2020-07-16 07:27:36 -07:00
marianomartin
049ad022a6 Delete components build.gradle files
PiperOrigin-RevId: 320944144
2020-07-15 09:38:31 -07:00
dniz
6b63c117fd [Motion] Changed MaterialContainerTransform to skip transition instead of crash when no view bounds
Resolves https://github.com/material-components/material-components-android/issues/1377

PiperOrigin-RevId: 319977600
2020-07-07 11:00:27 -04:00
hunterstich
3c9096d451 [Motion] Fix zero-length motion path container transform bug.
getPosTan, which calculates the translation of the conatienr bounds, no-ops if the startView doesn't move to a new position (when the startView and endView are top aligned and centered horizontally on one another). This was causing motionPathPositions, the int array holding the x and y of the animated bounds to never be initialized, defaulting to 0, and throwing off the bounds calculation.
This CL updates the int array with actual default x and y values so when getPosTan no-ops, the motionPathPosition array contains the correct values.

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

PiperOrigin-RevId: 319247326
2020-07-06 11:08:36 -04:00
marianomartin
555356b03f Internal cleanup
PiperOrigin-RevId: 318134343
2020-06-26 14:06:52 -04:00
dniz
ef64df5adc [Motion] Updated MaterialElevationScale default scale value to 0.85
PiperOrigin-RevId: 316905583
2020-06-17 20:40:56 -07:00
dniz
3379c45980 [Motion] Added MaterialElevationScale transition
Useful as an exit transition and reenter transition in conjunction with MaterialContainerTransform

PiperOrigin-RevId: 316708216
2020-06-17 18:32:57 -07:00
hunterstich
56b33909ee [Motion] Update ScaleProvider to use growing/shrinking naming. Fix MaterialSharedAxis isForward getter naming.
PiperOrigin-RevId: 313217150
2020-05-26 16:02:20 -04:00
dniz
1a6ebc0c56 [Motion] Remove boolean entering from MaterialFade constructor and don't set default duration
This makes MaterialFade more consistent with the other transition patterns

PiperOrigin-RevId: 312718402
2020-05-21 16:58:07 -04:00
dniz
ae6fcf14e7 [Motion] Add more explanation to the MaterialContainerTransform method Javadocs
PiperOrigin-RevId: 312672592
2020-05-21 16:52:11 -04:00
dniz
f20a91f980 [Motion] Update MaterialContainerTransform to use default scrim color constant instead of theme attribute
PiperOrigin-RevId: 312492669
2020-05-20 17:09:02 -04:00
dniz
ed41b2756f [Motion] Improve MaterialContainerTransform exception if start or end view bounds are null
PiperOrigin-RevId: 312273459
2020-05-19 18:31:04 -04:00
hunterstich
e00df6d075 [Motion] Add support for container transform start and end container colors.
PiperOrigin-RevId: 312152199
2020-05-19 10:23:24 -04:00
dniz
a5381acf02 [Motion] Update MaterialContainerTransformSharedElementCallback to support custom shape appearances
PiperOrigin-RevId: 311150643
2020-05-12 19:31:12 -04:00
dniz
1094b48080 [Motion] Update MaterialContainerTransform to support drawing elevation shadows during transition
By default, the elevation shadows are only enabled for API level 28 and above, because Paint shadows are not supported with hardware acceleration below API level 28. If enabled for below API level 28, then the shadows will be drawn using MaterialShapeDrawable, however this may cause performance issues.

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

PiperOrigin-RevId: 310602814
2020-05-08 15:30:17 -04:00
hunterstich
6ab9e11a0e [Motion] Fix container transform start delay flash
Switch the container transform to use a transition listener instead of an animator listener. A transition listener calls onTransitionStart as soon as the transition begins where an animator listener calls onAnimatorStart after the transitions delay, if any, casuing an unwanted visual flash of the end view before the animator starts.

PiperOrigin-RevId: 309977033
2020-05-07 11:26:11 -04:00
dniz
b854a73772 [Motion] Add support for adding additional animator providers to MaterialVisibility transitions
PiperOrigin-RevId: 309767552
2020-05-04 14:52:19 -04:00
dniz
04c93ea5bb [Motion] Remove TransitionValues params from VisibilityAnimatorProvider interface methods
PiperOrigin-RevId: 309763088
2020-05-04 14:41:17 -04:00
dniz
ae7177d9de [Motion] Refactor MaterialVisibility to use constructor params for primary/secondary instead of abstract getDefault methods
Guarantees that the primary/secondary animator providers are initialized up front, which allows us to simplify the getters/setters to not have an initialization side-effect

PiperOrigin-RevId: 309435463
2020-05-01 15:08:35 -04:00
dniz
119954c881 Fix MaterialContainerTransform setScrimColor Javadoc error and getDrawingViewId/setDrawingViewId docs typo
PiperOrigin-RevId: 309404225
2020-05-01 15:06:33 -04:00