Loading libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/JetpackTaskFragmentOrganizer.java +16 −5 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package androidx.window.extensions.embedding; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import static android.window.TaskFragmentAnimationParams.DEFAULT_ANIMATION_BACKGROUND_COLOR; import static android.window.TaskFragmentOperation.OP_TYPE_REORDER_TO_FRONT; import static android.window.TaskFragmentOperation.OP_TYPE_SET_ANIMATION_PARAMS; import static android.window.TaskFragmentOperation.OP_TYPE_SET_DIM_ON_TASK; Loading @@ -29,6 +30,7 @@ import static androidx.window.extensions.embedding.SplitContainer.shouldFinishAs import static androidx.window.extensions.embedding.SplitContainer.shouldFinishPrimaryWithSecondary; import static androidx.window.extensions.embedding.SplitContainer.shouldFinishSecondaryWithPrimary; import android.annotation.ColorInt; import android.app.Activity; import android.app.WindowConfiguration.WindowingMode; import android.content.Intent; Loading Loading @@ -391,13 +393,22 @@ class JetpackTaskFragmentOrganizer extends TaskFragmentOrganizer { if (splitAttributes == null) { return TaskFragmentAnimationParams.DEFAULT; } final int animationBackgroundColor = getAnimationBackgroundColor(splitAttributes); TaskFragmentAnimationParams.Builder builder = new TaskFragmentAnimationParams.Builder(); if (animationBackgroundColor != DEFAULT_ANIMATION_BACKGROUND_COLOR) { builder.setAnimationBackgroundColor(animationBackgroundColor); } // TODO(b/293658614): Allow setting custom open/close/changeAnimationResId. return builder.build(); } @ColorInt private static int getAnimationBackgroundColor(@NonNull SplitAttributes splitAttributes) { int animationBackgroundColor = DEFAULT_ANIMATION_BACKGROUND_COLOR; final AnimationBackground animationBackground = splitAttributes.getAnimationBackground(); if (animationBackground instanceof AnimationBackground.ColorBackground colorBackground) { return new TaskFragmentAnimationParams.Builder() .setAnimationBackgroundColor(colorBackground.getColor()) .build(); } else { return TaskFragmentAnimationParams.DEFAULT; animationBackgroundColor = colorBackground.getColor(); } return animationBackgroundColor; } } Loading
libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/JetpackTaskFragmentOrganizer.java +16 −5 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package androidx.window.extensions.embedding; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import static android.window.TaskFragmentAnimationParams.DEFAULT_ANIMATION_BACKGROUND_COLOR; import static android.window.TaskFragmentOperation.OP_TYPE_REORDER_TO_FRONT; import static android.window.TaskFragmentOperation.OP_TYPE_SET_ANIMATION_PARAMS; import static android.window.TaskFragmentOperation.OP_TYPE_SET_DIM_ON_TASK; Loading @@ -29,6 +30,7 @@ import static androidx.window.extensions.embedding.SplitContainer.shouldFinishAs import static androidx.window.extensions.embedding.SplitContainer.shouldFinishPrimaryWithSecondary; import static androidx.window.extensions.embedding.SplitContainer.shouldFinishSecondaryWithPrimary; import android.annotation.ColorInt; import android.app.Activity; import android.app.WindowConfiguration.WindowingMode; import android.content.Intent; Loading Loading @@ -391,13 +393,22 @@ class JetpackTaskFragmentOrganizer extends TaskFragmentOrganizer { if (splitAttributes == null) { return TaskFragmentAnimationParams.DEFAULT; } final int animationBackgroundColor = getAnimationBackgroundColor(splitAttributes); TaskFragmentAnimationParams.Builder builder = new TaskFragmentAnimationParams.Builder(); if (animationBackgroundColor != DEFAULT_ANIMATION_BACKGROUND_COLOR) { builder.setAnimationBackgroundColor(animationBackgroundColor); } // TODO(b/293658614): Allow setting custom open/close/changeAnimationResId. return builder.build(); } @ColorInt private static int getAnimationBackgroundColor(@NonNull SplitAttributes splitAttributes) { int animationBackgroundColor = DEFAULT_ANIMATION_BACKGROUND_COLOR; final AnimationBackground animationBackground = splitAttributes.getAnimationBackground(); if (animationBackground instanceof AnimationBackground.ColorBackground colorBackground) { return new TaskFragmentAnimationParams.Builder() .setAnimationBackgroundColor(colorBackground.getColor()) .build(); } else { return TaskFragmentAnimationParams.DEFAULT; animationBackgroundColor = colorBackground.getColor(); } return animationBackgroundColor; } }