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

Commit 6c3cbb5f authored by Mady Mellor's avatar Mady Mellor
Browse files

Separate background & pointer alpha for the expanded view

These will be animated separately for the new animations.

This CL shouldn't cause any visual changes to existing animations.

Test: manual - observe collapse / expand / swipe up to collapse
Test: atest ExpandedViewAnimationControllerTest
Bug: 311450609
Change-Id: I050cdde1c1614c6ac97ad6abb27a427823770178
parent 5ed41c22
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ import androidx.annotation.Nullable;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.policy.ScreenDecorationsUtils;
import com.android.internal.protolog.common.ProtoLog;
import com.android.wm.shell.Flags;
import com.android.wm.shell.R;
import com.android.wm.shell.common.AlphaOptimizedButton;
import com.android.wm.shell.common.TriangleShape;
@@ -668,6 +669,11 @@ public class BubbleExpandedView extends LinearLayout {
        }
    }

    /** Sets the alpha for the pointer. */
    public void setPointerAlpha(float alpha) {
        mPointerView.setAlpha(alpha);
    }

    /**
     * Get alpha from underlying {@code TaskView} if this view is for a bubble.
     * Or get alpha for the overflow view if this view is for overflow.
@@ -698,13 +704,15 @@ public class BubbleExpandedView extends LinearLayout {
        }
    }

    /**
     * Sets the alpha of the background and the pointer view.
     */
    /** Sets the alpha of the background. */
    public void setBackgroundAlpha(float alpha) {
        if (Flags.enableNewBubbleAnimations()) {
            setAlpha(alpha);
        } else {
            mPointerView.setAlpha(alpha);
            setAlpha(alpha);
        }
    }

    /**
     * Set translation Y for the expanded view content.