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

Commit c23811e9 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Intercept overflow button touch"

parents 8c11ac1b 99e457f6
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -533,10 +533,6 @@ public class BubbleStackView extends FrameLayout {
        mBubbleContainer.addView(mOverflowBtn, 0,
                new FrameLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT));

        mOverflowBtn.setOnClickListener(v -> {
            setSelectedBubble(null);
        });

        TypedArray ta = mContext.obtainStyledAttributes(
                new int[]{android.R.attr.colorBackgroundFloating});
        int bgColor = ta.getColor(0, Color.WHITE /* default */);
@@ -856,6 +852,10 @@ public class BubbleStackView extends FrameLayout {
        updateBubbleZOrdersAndDotPosition(false /* animate */);
    }

    void showOverflow() {
        setSelectedBubble(null);
    }

    /**
     * Changes the currently selected bubble. If the stack is already expanded, the newly selected
     * bubble will be shown immediately. This does not change the expanded state or change the
@@ -950,6 +950,10 @@ public class BubbleStackView extends FrameLayout {
        }
        if (mIsExpanded) {
            if (isIntersecting(mBubbleContainer, x, y)) {
                if (BubbleExperimentConfig.allowBubbleOverflow(mContext)
                        && isIntersecting(mOverflowBtn, x, y)) {
                    return mOverflowBtn;
                }
                // Could be tapping or dragging a bubble while expanded
                for (int i = 0; i < getBubbleCount(); i++) {
                    BadgedImageView view = (BadgedImageView) mBubbleContainer.getChildAt(i);
+5 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.view.View;
import android.view.ViewConfiguration;

import com.android.systemui.Dependency;
import com.android.systemui.R;

/**
 * Handles interpreting touches on a {@link BubbleStackView}. This includes expanding, collapsing,
@@ -109,6 +110,10 @@ class BubbleTouchHandler implements View.OnTouchListener {
        if (!(mTouchedView instanceof BadgedImageView)
                && !(mTouchedView instanceof BubbleStackView)
                && !(mTouchedView instanceof BubbleFlyoutView)) {

            if (mTouchedView.getId() == R.id.bubble_overflow_button) {
                mStack.showOverflow();
            }
            // Not touching anything touchable, but we shouldn't collapse (e.g. touching edge
            // of expanded view).
            mStack.hideBubbleMenu();