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

Commit f425d300 authored by Mady Mellor's avatar Mady Mellor
Browse files

Fix gesture exclusion for bubbles

This was happening after the stack was dismissed & came
back. I think the onDrawListener should be added / removed
when BSV is attached/detached.

We reuse BubbleStackView in S so this is probably a
regression from those changes.

Fixes: 181083993
Test: 1 - have gesture nav enabled
      2 - add bubbles, dismiss them, add more
      3 - check that bubbles are easily moveable & don't
          trigger back
Change-Id: I1176efd2e41b3c9f1adb0d756e03bcfc5837eab6
parent 397e520f
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -912,9 +912,6 @@ public class BubbleStackView extends FrameLayout
                    removeOnLayoutChangeListener(mOrientationChangedListener);
                };

        // This must be a separate OnDrawListener since it should be called for every draw.
        getViewTreeObserver().addOnDrawListener(mSystemGestureExcludeUpdater);

        final ColorMatrix animatedMatrix = new ColorMatrix();
        final ColorMatrix darkenMatrix = new ColorMatrix();

@@ -1274,12 +1271,14 @@ public class BubbleStackView extends FrameLayout
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        getViewTreeObserver().addOnComputeInternalInsetsListener(this);
        getViewTreeObserver().addOnDrawListener(mSystemGestureExcludeUpdater);
    }

    @Override
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        getViewTreeObserver().removeOnPreDrawListener(mViewUpdater);
        getViewTreeObserver().removeOnDrawListener(mSystemGestureExcludeUpdater);
        getViewTreeObserver().removeOnComputeInternalInsetsListener(this);
        if (mBubbleOverflow != null) {
            mBubbleOverflow.cleanUpExpandedState();