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

Commit b4b5a0bc authored by Mady Mellor's avatar Mady Mellor Committed by Automerger Merge Worker
Browse files

Merge "Fix an issue where the pointer could be invisible" into tm-qpr-dev am:...

Merge "Fix an issue where the pointer could be invisible" into tm-qpr-dev am: 9f5ed9f3 am: 21138164

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18717983



Change-Id: I13a0bd1c4a4aa4eb8a5678971ac1e8b5a2ef1d4b
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents afaa11c1 21138164
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -106,6 +106,20 @@ public class BubbleExpandedView extends LinearLayout {
                }
            };

    /** {@link FloatProperty} for updating background and pointer alpha */
    public static final FloatProperty<BubbleExpandedView> BACKGROUND_ALPHA =
            new FloatProperty<BubbleExpandedView>("backgroundAlpha") {
                @Override
                public void setValue(BubbleExpandedView expandedView, float value) {
                    expandedView.setBackgroundAlpha(value);
                }

                @Override
                public Float get(BubbleExpandedView expandedView) {
                    return expandedView.getAlpha();
                }
            };

    /** {@link FloatProperty} for updating manage button alpha */
    public static final FloatProperty<BubbleExpandedView> MANAGE_BUTTON_ALPHA =
            new FloatProperty<BubbleExpandedView>("manageButtonAlpha") {
@@ -602,6 +616,14 @@ public class BubbleExpandedView extends LinearLayout {
        }
    }

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

    /**
     * Set translation Y for the expanded view content.
     * Excludes manage button and pointer.
+2 −2
Original line number Diff line number Diff line
@@ -1080,7 +1080,7 @@ public class BubbleStackView extends FrameLayout
            if (mExpandedBubble != null && mExpandedBubble.getExpandedView() != null) {
                float alpha = (float) valueAnimator.getAnimatedValue();
                mExpandedBubble.getExpandedView().setContentAlpha(alpha);
                mExpandedBubble.getExpandedView().setAlpha(alpha);
                mExpandedBubble.getExpandedView().setBackgroundAlpha(alpha);
            }
        });

@@ -2216,7 +2216,7 @@ public class BubbleStackView extends FrameLayout

        if (mExpandedBubble.getExpandedView() != null) {
            mExpandedBubble.getExpandedView().setContentAlpha(0f);
            mExpandedBubble.getExpandedView().setAlpha(0f);
            mExpandedBubble.getExpandedView().setBackgroundAlpha(0f);

            // We'll be starting the alpha animation after a slight delay, so set this flag early
            // here.
+3 −4
Original line number Diff line number Diff line
@@ -15,12 +15,11 @@
 */
package com.android.wm.shell.bubbles.animation;

import static android.view.View.ALPHA;

import static com.android.wm.shell.bubbles.BubbleDebugConfig.DEBUG_COLLAPSE_ANIMATOR;
import static com.android.wm.shell.bubbles.BubbleDebugConfig.DEBUG_EXPANDED_VIEW_DRAGGING;
import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_BUBBLES;
import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.wm.shell.bubbles.BubbleExpandedView.BACKGROUND_ALPHA;
import static com.android.wm.shell.bubbles.BubbleExpandedView.BOTTOM_CLIP_PROPERTY;
import static com.android.wm.shell.bubbles.BubbleExpandedView.CONTENT_ALPHA;
import static com.android.wm.shell.bubbles.BubbleExpandedView.MANAGE_BUTTON_ALPHA;
@@ -314,7 +313,7 @@ public class ExpandedViewAnimationControllerImpl implements ExpandedViewAnimatio
            mBackToExpandedAnimation.cancel();
        }
        mExpandedView.setContentAlpha(1);
        mExpandedView.setAlpha(1);
        mExpandedView.setBackgroundAlpha(1);
        mExpandedView.setManageButtonAlpha(1);
        setCollapsedAmount(0);
        mExpandedView.setBottomClip(0);
@@ -416,7 +415,7 @@ public class ExpandedViewAnimationControllerImpl implements ExpandedViewAnimatio
    }

    private ObjectAnimator createBackgroundAlphaAnimation() {
        ObjectAnimator animator = ObjectAnimator.ofFloat(mExpandedView, ALPHA, 0f);
        ObjectAnimator animator = ObjectAnimator.ofFloat(mExpandedView, BACKGROUND_ALPHA, 0f);
        animator.setDuration(BACKGROUND_OPACITY_ANIM_DURATION_MS);
        animator.setInterpolator(Interpolators.LINEAR);
        animator.setStartDelay(BACKGROUND_OPACITY_ANIM_DELAY_MS);
+1 −1
Original line number Diff line number Diff line
@@ -156,7 +156,7 @@ public class ExpandedViewAnimationControllerTest extends ShellTestCase {
        mController.reset();
        verify(mMockExpandedView, atLeastOnce()).setAnimating(false);
        verify(mMockExpandedView).setContentAlpha(1);
        verify(mMockExpandedView).setAlpha(1);
        verify(mMockExpandedView).setBackgroundAlpha(1);
        verify(mMockExpandedView).setManageButtonAlpha(1);
        verify(mMockExpandedView).setManageButtonAlpha(1);
        verify(mMockExpandedView).setTopClip(0);