Skip to content

Commit 57a8ebd

Browse files
committed
Fix Activity container transform unexpected flash and fade
PiperOrigin-RevId: 307090565
1 parent 9813cc5 commit 57a8ebd

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

lib/java/com/google/android/material/transition/MaterialContainerTransformSharedElementCallback.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,11 @@ public void onTransitionStart(Transition transition) {
217217
/**
218218
* Make the window background transparent during the container transform.
219219
*
220-
* This applies a color filter to the window background which clears the background's source
221-
* pixels. If the client has set a color filter on the window background manually, this will
222-
* be overridden and will not be restored after the transition. If you need to manipulate
223-
* the color of the window background and have that manipulation restored after the transition,
224-
* use {@link android.graphics.drawable.Drawable#setTint(int)} instead.
220+
* <p>This applies a color filter to the window background which clears the background's source
221+
* pixels. If the client has set a color filter on the window background manually, this will be
222+
* overridden and will not be restored after the transition. If you need to manipulate the color
223+
* of the window background and have that manipulation restored after the transition, use {@link
224+
* android.graphics.drawable.Drawable#setTint(int)} instead.
225225
*/
226226
private static void removeWindowBackground(Window window) {
227227
window
@@ -243,12 +243,11 @@ private static void restoreWindowBackground(Window window) {
243243
}
244244

245245
/**
246-
* When using a transparent window background, make sure that the background fade duration is at
247-
* least as long as the transform's duration. This will help to avoid a black background visual
248-
* artifact.
246+
* When using a transparent window background, make sure that the background fade duration is as
247+
* long as the transform's duration. This will help to avoid a black background visual artifact.
249248
*/
250249
private static void updateBackgroundFadeDuration(
251250
Window window, MaterialContainerTransform transform) {
252-
window.setTransitionBackgroundFadeDuration(transform.getDuration() * 2);
251+
window.setTransitionBackgroundFadeDuration(transform.getDuration());
253252
}
254253
}

0 commit comments

Comments
 (0)