scaleMaskProgressT h resholds = MaterialContainerTransform.ProgressThresholds(0.75f, 1f) scaleProgressT h resholds = MaterialContainerTransform.ProgressThresholds(0f, 0.25f) shapeMaskProgressT h resholds = MaterialContainerTransform.ProgressThresholds(0.75f, 1f) / / Other options . . . } Controls when in the transition the contents will scale to the dimensions of the end (incoming) view. Scale Progress Threshold
shape of the start (outgoing) view will morph into the shape of the end (incoming) view. sharedElementEnterTransition = MaterialContainerTransform().apply { fadeProgressT h resholds = MaterialContainerTransform.ProgressThresholds(0.75f, 1f) scaleMaskProgressT h resholds = MaterialContainerTransform.ProgressThresholds(0.75f, 1f) scaleProgressT h resholds = MaterialContainerTransform.ProgressThresholds(0f, 1f) shapeMaskProgressT h resholds = MaterialContainerTransform.ProgressThresholds(0f, 0.75f) / / Other options . . . }
but we see that the incoming view completely overlaps the FAB around 60ms, which is 20% of the overall transition. sharedElementEnterTransition = MaterialContainerTransform().apply { fadeProgressT h resholds = MaterialContainerTransform.ProgressThresholds(0f, 0.2f) / / Other options and thresholds … }
but we see that the incoming view completely overlaps the FAB around 60ms, about 20% of the overall transition. sharedElementEnterTransition = MaterialContainerTransform().apply { fadeProgressT h resholds = MaterialContainerTransform.ProgressThresholds(0f, 0.2f) / / Other options and thresholds … }
fading but we see that the incoming view completely overlaps the FAB around 0.06s, which is 20% of the overall transition. This prototype uses a custom Path Interpolator. Since ProgressThresholds are dependent on interpolator, it’s better to set it now than later. sharedElementEnterTransition = MaterialContainerTransform().apply { interpolator = PathInterpolator(0.25f, 0.1f, 0.25f, 1f) / / Other options and thresholds … }
based on our custom interpolator, the fade animation completes at 60ms. sharedElementEnterTransition = MaterialContainerTransform().apply { interpolator = PathInterpolator(0.25f, 0.1f, 0.25f, 1f) fadeProgressT h resholds = MaterialContainerTransform.ProgressThresholds(0f, 0.295f) / / Other options and thresholds … }
based on our custom interpolator, the fade animation completes at 60ms. sharedElementEnterTransition = MaterialContainerTransform().apply { interpolator = PathInterpolator(0.25f, 0.1f, 0.25f, 1f) fadeProgressT h resholds = MaterialContainerTransform.ProgressThresholds(0f, 0.295f) / / Other options and thresholds … }
FAB so we infer when to start it. Around 40ms, about 13.33% of the overall transition. 0.154 according to our interpolator. sharedElementEnterTransition = MaterialContainerTransform().apply { interpolator = PathInterpolator(0.25f, 0.1f, 0.25f, 1f) fadeProgressT h resholds = MaterialContainerTransform.ProgressThresholds(0f, 0.295f) scaleMaskProgressT h resholds = MaterialContainerTransform.ProgressThresholds(0.154f, 1f) / / Other options and thresholds … }
the same time as scale mask so let’s use the same progress thresholds for it. sharedElementEnterTransition = MaterialContainerTransform().apply { interpolator = PathInterpolator(0.25f, 0.1f, 0.25f, 1f) fadeProgressT h resholds = MaterialContainerTransform.ProgressThresholds(0f, 0.295f) scaleMaskProgressT h resholds = MaterialContainerTransform.ProgressThresholds(0.154f, 1f) scaleProgressT h resholds = MaterialContainerTransform.ProgressThresholds(0.154f, 1f) / / Other options and thresholds … }
• Choosing the Right Transitions by the Material Design team • Animating your keyboard (part 1 ) by Chris Banes • Animating your keyboard (part 2 ) : reacting to WindowInset animations by Chris Banes • WindowInsetsAnimation Sample