43 Commits

Author SHA1 Message Date
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
hunterstich
d3ec2d82de [Motion] Update container transform invalid scrim color logic
PiperOrigin-RevId: 308802757
2020-04-28 06:58:00 -07:00
hunterstich
d025a3b2c3 [Motion] Replace MaterialVisibility subclass static constructors for standard constructors
PiperOrigin-RevId: 308793749
2020-04-28 06:52:44 -07:00
hunterstich
dc7d3a5d4d [Motion] Make public transition classes final which are not meant to be subclassed.
PiperOrigin-RevId: 308711224
2020-04-27 18:52:51 -04:00
hunterstich
407193625b [Motion] Add getters and setters to MaterialContainerTransform.ProgressThresholds
PiperOrigin-RevId: 308694078
2020-04-27 18:12:15 -04:00
hunterstich
e63cae59fb [Motion] Update MaterialVisibility to not need initialize method
- Add initialization check for secondary animator provider in MaterialVisibility so subclasses no longer need to explicitly call MaterialVisibility#initialize.

PiperOrigin-RevId: 308687877
2020-04-27 18:05:51 -04:00
dniz
cd36c2f5e7 [Motion] Update transitions to be based on androidx and add transitions platform subpackage to support Activities, Windows, etc.
PiperOrigin-RevId: 308651633
2020-04-27 17:32:30 -04:00
Nicklas Ansman Giertz
48a6f2892b [Motion] Use a private ID resource for the tag ID in MaterialContainerTransform
Resolves https://github.com/material-components/material-components-android/issues/1230
Resolves https://github.com/material-components/material-components-android/pull/1231

GIT_ORIGIN_REV_ID=df1fe9abcd9910302ef0ab97f34153e83a548467
PiperOrigin-RevId: 307895262
2020-04-22 17:45:40 -04:00
dniz
b8c0496584 Fix nullability annotations in MaterialContainerTransformSharedElementCallback
PiperOrigin-RevId: 307661071
2020-04-22 15:08:21 -04:00
dniz
57a8ebdcdd Fix Activity container transform unexpected flash and fade
PiperOrigin-RevId: 307090565
2020-04-17 15:21:26 -04:00
SatoShun
9813cc5666 [MaterialSharedAxis] fix javadoc
Resolves https://github.com/material-components/material-components-android/pull/1210

GIT_ORIGIN_REV_ID=04314d6ef1150fc41e125ea6e49a3636413a7282
PiperOrigin-RevId: 307059021
2020-04-17 15:18:58 -04:00
hunterstich
2a2792d4fb [Motion] Remove context parameter from MaterialContainerTransform.
PiperOrigin-RevId: 304389543
2020-04-03 09:57:54 -07:00
hunterstich
148938ca84 [Motion] Update MaterialFadeThrough and MaterialFade to use MaterialVisibility and remove context param.
This updaes the remaining transitions to compose themselves of two animators instead of two visibility transitions. This also removes the context parameter from MaterialFadeThrough, MaterialFade and MaterialSharedAxis' constructors.

PiperOrigin-RevId: 303332658
2020-03-27 11:40:38 -04:00
hunterstich
5b07d02c8e Refactor MaterialSharedAxis to be composed of two animators.
Resolves https://github.com/material-components/material-components-android/issues/1047#issuecomment-594966218

PiperOrigin-RevId: 301619025
2020-03-18 17:37:50 -04:00
hunterstich
fe1651939c Fix motion java doc lint errors
PiperOrigin-RevId: 300415917
2020-03-13 10:52:20 -04:00
hunterstich
0f0942bdfd Fix container transform flashing on API 22.
Resolves https://github.com/material-components/material-components-android/issues/1061

PiperOrigin-RevId: 298752245
2020-03-05 13:05:24 -08:00
hunterstich
05804ddade Improve error message when container transform is unable to find an ancestor for the drawing view id.
PiperOrigin-RevId: 296884487
2020-02-24 18:28:14 -05:00
hunterstich
70f447d77e Fix gradle build and lint errors for transition package.
PiperOrigin-RevId: 294971841
2020-02-13 13:55:08 -08:00
hunterstich
a3a9793fb1 Fix container transform crash on API 21 and 22 due to path unioning.
PiperOrigin-RevId: 294924927
2020-02-13 13:49:21 -08:00