Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f5a3855 authored by Jeremy Sim's avatar Jeremy Sim Committed by Android (Google) Code Review
Browse files

Merge "Fix bug where dim layers would disappear on taskbar tap" into main

parents 223352c4 8cb20afd
Loading
Loading
Loading
Loading
+2 −14
Original line number Diff line number Diff line
@@ -243,14 +243,6 @@ public class TransitionUtil {
            t.setLayer(leash, Integer.MAX_VALUE);
            return;
        }
        if (isDimLayer(change)) {
            // When a dim layer gets reparented onto the transition root, we need to zero out its
            // position so that it's in line with everything else on the transition root. Also,
            // we need to set a crop because we don't want it applying MATCH_PARENT on the whole
            // root surface.
            t.setPosition(leash, 0, 0);
            t.setCrop(leash, change.getEndAbsBounds());
        }

        // Put all the OPEN/SHOW on top
        if ((change.getFlags() & FLAG_IS_WALLPAPER) != 0) {
@@ -304,12 +296,8 @@ public class TransitionUtil {
        // Copied Transitions setup code (which expects bottom-to-top order, so we swap here)
        setupLeash(leashSurface, change, info.getChanges().size() - order, info, t);
        t.reparent(change.getLeash(), leashSurface);
        if (!isDimLayer(change)) {
            // Most leashes going onto the transition root should have their alpha set here to make
            // them visible. But dim layers should be left untouched (their alpha value is their
            // actual dim value).

        t.setAlpha(change.getLeash(), 1.0f);
        }
        if (!isDividerBar(change)) {
            // For divider, don't modify its inner leash position when creating the outer leash
            // for the transition. In case the position being wrong after the transition finished.
+2 −0
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@ public class SplitScreenConstants {
    public static final int FADE_DURATION = 133;
    /** Duration where we keep an app veiled to allow it to redraw itself behind the scenes. */
    public static final int VEIL_DELAY_DURATION = 300;
    /** The default amount to dim an app that is partially offscreen. */
    public static float DEFAULT_OFFSCREEN_DIM = 0.32f;

    /** Key for passing in widget intents when invoking split from launcher workspace. */
    public static final String KEY_EXTRA_WIDGET_INTENT = "key_extra_widget_intent";
+5 −3
Original line number Diff line number Diff line
@@ -22,14 +22,16 @@ import static android.view.WindowManager.DOCKED_LEFT;
import static android.view.WindowManager.DOCKED_RIGHT;
import static android.view.WindowManager.DOCKED_TOP;

import static com.android.wm.shell.common.split.ResizingEffectPolicy.DEFAULT_OFFSCREEN_DIM;
import static com.android.wm.shell.shared.animation.Interpolators.DIM_INTERPOLATOR;
import static com.android.wm.shell.shared.animation.Interpolators.FAST_DIM_INTERPOLATOR;
import static com.android.wm.shell.shared.split.SplitScreenConstants.ANIMATING_OFFSCREEN_TAP;
import static com.android.wm.shell.shared.split.SplitScreenConstants.DEFAULT_OFFSCREEN_DIM;

import android.graphics.Point;
import android.graphics.Rect;

import com.android.wm.shell.shared.split.SplitScreenConstants;

/**
 * Calculation class, used when
 * {@link com.android.wm.shell.common.split.SplitLayout#PARALLAX_FLEX_HYBRID} is the desired
@@ -106,7 +108,7 @@ public class FlexHybridParallaxSpec implements ParallaxSpec {
    /**
     * Used by {@link #getDimValue} to determine the amount to dim an app. Starts at zero and ramps
     * up to the default amount of dimming for an offscreen app,
     * {@link ResizingEffectPolicy#DEFAULT_OFFSCREEN_DIM}.
     * {@link SplitScreenConstants#DEFAULT_OFFSCREEN_DIM}.
     */
    private float slowDim(float progress) {
        return DIM_INTERPOLATOR.getInterpolation(progress) * DEFAULT_OFFSCREEN_DIM;
@@ -114,7 +116,7 @@ public class FlexHybridParallaxSpec implements ParallaxSpec {

    /**
     * Used by {@link #getDimValue} to determine the amount to dim an app. Starts at
     * {@link ResizingEffectPolicy#DEFAULT_OFFSCREEN_DIM} and ramps up to 100% dim (full black).
     * {@link SplitScreenConstants#DEFAULT_OFFSCREEN_DIM} and ramps up to 100% dim (full black).
     */
    private float fastDim(float progress) {
        return DEFAULT_OFFSCREEN_DIM + (FAST_DIM_INTERPOLATOR.getInterpolation(progress)
+5 −3
Original line number Diff line number Diff line
@@ -22,14 +22,16 @@ import static android.view.WindowManager.DOCKED_LEFT;
import static android.view.WindowManager.DOCKED_RIGHT;
import static android.view.WindowManager.DOCKED_TOP;

import static com.android.wm.shell.common.split.ResizingEffectPolicy.DEFAULT_OFFSCREEN_DIM;
import static com.android.wm.shell.shared.animation.Interpolators.DIM_INTERPOLATOR;
import static com.android.wm.shell.shared.animation.Interpolators.FAST_DIM_INTERPOLATOR;
import static com.android.wm.shell.shared.split.SplitScreenConstants.ANIMATING_OFFSCREEN_TAP;
import static com.android.wm.shell.shared.split.SplitScreenConstants.DEFAULT_OFFSCREEN_DIM;

import android.graphics.Point;
import android.graphics.Rect;

import com.android.wm.shell.shared.split.SplitScreenConstants;

/**
 * Calculation class, used when {@link com.android.wm.shell.common.split.SplitLayout#PARALLAX_FLEX}
 * is the desired parallax effect.
@@ -98,7 +100,7 @@ public class FlexParallaxSpec implements ParallaxSpec {
    /**
     * Used by {@link #getDimValue} to determine the amount to dim an app. Starts at zero and ramps
     * up to the default amount of dimming for an offscreen app,
     * {@link ResizingEffectPolicy#DEFAULT_OFFSCREEN_DIM}.
     * {@link SplitScreenConstants#DEFAULT_OFFSCREEN_DIM}.
     */
    private float slowDim(float progress) {
        return DIM_INTERPOLATOR.getInterpolation(progress) * DEFAULT_OFFSCREEN_DIM;
@@ -106,7 +108,7 @@ public class FlexParallaxSpec implements ParallaxSpec {

    /**
     * Used by {@link #getDimValue} to determine the amount to dim an app. Starts at
     * {@link ResizingEffectPolicy#DEFAULT_OFFSCREEN_DIM} and ramps up to 100% dim (full black).
     * {@link SplitScreenConstants#DEFAULT_OFFSCREEN_DIM} and ramps up to 100% dim (full black).
     */
    private float fastDim(float progress) {
        return DEFAULT_OFFSCREEN_DIM + (FAST_DIM_INTERPOLATOR.getInterpolation(progress)
+0 −3
Original line number Diff line number Diff line
@@ -37,9 +37,6 @@ import android.view.SurfaceControl;
 * usually when the divider is being moved around by the user (or during an animation).
 */
class ResizingEffectPolicy {
    /** The default amount to dim an app that is partially offscreen. */
    public static float DEFAULT_OFFSCREEN_DIM = 0.32f;

    private final SplitLayout mSplitLayout;
    /** The parallax algorithm we are currently using. */
    private final int mParallaxType;
Loading