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

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

Increase touch target size of bubbles

Also removes some unused code

Test: manual - fling bubble around on launcher, shouldn't be difficult
      to grab, shouldn't accidentally trigger other gestures (e.g. shade,
      -1 space)
Fixes: 134514210
Change-Id: Iaebfe19ee043477f76c0dc5041601237576ad542
parent d3388d71
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1113,6 +1113,8 @@
    <dimen name="individual_bubble_size">60dp</dimen>
    <!-- Size of bubble icon bitmap. -->
    <dimen name="bubble_icon_bitmap_size">52dp</dimen>
    <!-- Extra padding added to the touchable rect for bubbles so they are easier to grab. -->
    <dimen name="bubble_touch_padding">12dp</dimen>
    <!-- Size of the circle around the bubbles when they're in the dismiss target. -->
    <dimen name="bubble_dismiss_encircle_size">52dp</dimen>
    <!-- How much to inset the icon in the circle -->
@@ -1157,6 +1159,7 @@
         snap to the dismiss target. -->
    <dimen name="bubble_dismiss_target_padding_x">40dp</dimen>
    <dimen name="bubble_dismiss_target_padding_y">20dp</dimen>

    <!-- Size of the RAT type for CellularTile -->
    <dimen name="celltile_rat_type_size">10sp</dimen>
</resources>
+7 −8
Original line number Diff line number Diff line
@@ -182,6 +182,7 @@ public class BubbleStackView extends FrameLayout {

    private int mBubbleSize;
    private int mBubblePaddingTop;
    private int mBubbleTouchPadding;
    private int mExpandedViewPadding;
    private int mExpandedAnimateXDistance;
    private int mExpandedAnimateYDistance;
@@ -326,6 +327,7 @@ public class BubbleStackView extends FrameLayout {
        Resources res = getResources();
        mBubbleSize = res.getDimensionPixelSize(R.dimen.individual_bubble_size);
        mBubblePaddingTop = res.getDimensionPixelSize(R.dimen.bubble_padding_top);
        mBubbleTouchPadding = res.getDimensionPixelSize(R.dimen.bubble_touch_padding);
        mExpandedAnimateXDistance =
                res.getDimensionPixelSize(R.dimen.bubble_expanded_animate_x_distance);
        mExpandedAnimateYDistance =
@@ -1453,6 +1455,11 @@ public class BubbleStackView extends FrameLayout {
            if (mBubbleContainer.getChildCount() > 0) {
                mBubbleContainer.getChildAt(0).getBoundsOnScreen(outRect);
            }
            // Increase the touch target size of the bubble
            outRect.top -= mBubbleTouchPadding;
            outRect.left -= mBubbleTouchPadding;
            outRect.right += mBubbleTouchPadding;
            outRect.bottom += mBubbleTouchPadding;
        } else {
            mBubbleContainer.getBoundsOnScreen(outRect);
        }
@@ -1477,14 +1484,6 @@ public class BubbleStackView extends FrameLayout {
        return 0;
    }

    private int getBottomInset() {
        if (getRootWindowInsets() != null) {
            WindowInsets insets = getRootWindowInsets();
            return insets.getSystemWindowInsetBottom();
        }
        return 0;
    }

    private boolean isIntersecting(View view, float x, float y) {
        mTempLoc = view.getLocationOnScreen();
        mTempRect.set(mTempLoc[0], mTempLoc[1], mTempLoc[0] + view.getWidth(),
+2 −4
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.systemui.bubbles;

import android.content.Context;
import android.graphics.PointF;
import android.os.Handler;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
@@ -65,11 +64,10 @@ class BubbleTouchHandler implements View.OnTouchListener {
    private int mTouchSlopSquared;
    private VelocityTracker mVelocityTracker;

    private boolean mInDismissTarget;
    private Handler mHandler = new Handler();

    /** View that was initially touched, when we received the first ACTION_DOWN event. */
    private View mTouchedView;
    /** Whether the current touched view is in the dismiss target. */
    private boolean mInDismissTarget;

    BubbleTouchHandler(BubbleStackView stackView,
            BubbleData bubbleData, Context context) {
+0 −1
Original line number Diff line number Diff line
@@ -333,7 +333,6 @@ public class BubbleControllerTest extends SysuiTestCase {
        assertFalse(mBubbleController.isBubbleNotificationSuppressedFromShade(mRow.getEntry().key));

        // Expand
        BubbleStackView stackView = mBubbleController.getStackView();
        mBubbleController.expandStack();
        assertTrue(mBubbleController.isStackExpanded());
        verify(mBubbleExpandListener).onBubbleExpandChanged(true, mRow.getEntry().key);