diff options
| author | 2024-02-16 16:08:09 -0800 | |
|---|---|---|
| committer | 2024-02-20 10:01:47 -0800 | |
| commit | dcf9b9d70085c5b28ea4f67258beecdbf9bc4beb (patch) | |
| tree | 4ee4998db988f0be975663ec98f0f99bc8565f76 /libs | |
| parent | 977dfc3eeedb8170f6b92f6a8305ca81262aef77 (diff) | |
Expanded view handle should be the size of the dots
Handle was using the width of the expanded view. Which meant the entire
width was clickable and draggable.
Reduce the size of the handle to the dots and some padding aronud it.
Bug: 283991264
Test: manual, tap on area close to the edge of bubble expanded view
Change-Id: Ib36e024ba1cd9dbd0ed31ce1c294f0ad9cf77359
Diffstat (limited to 'libs')
4 files changed, 9 insertions, 10 deletions
diff --git a/libs/WindowManager/Shell/res/layout/bubble_bar_expanded_view.xml b/libs/WindowManager/Shell/res/layout/bubble_bar_expanded_view.xml index e04ab817215c..34f03c2f226b 100644 --- a/libs/WindowManager/Shell/res/layout/bubble_bar_expanded_view.xml +++ b/libs/WindowManager/Shell/res/layout/bubble_bar_expanded_view.xml @@ -23,7 +23,8 @@ <com.android.wm.shell.bubbles.bar.BubbleBarHandleView android:id="@+id/bubble_bar_handle_view" - android:layout_height="wrap_content" - android:layout_width="wrap_content" /> + android:layout_height="@dimen/bubble_bar_expanded_view_caption_height" + android:layout_width="@dimen/bubble_bar_expanded_view_caption_width" + android:layout_gravity="top|center_horizontal" /> </com.android.wm.shell.bubbles.bar.BubbleBarExpandedView> diff --git a/libs/WindowManager/Shell/res/values/dimen.xml b/libs/WindowManager/Shell/res/values/dimen.xml index f73775becac9..3b0eb49158cb 100644 --- a/libs/WindowManager/Shell/res/values/dimen.xml +++ b/libs/WindowManager/Shell/res/values/dimen.xml @@ -244,6 +244,8 @@ <dimen name="bubble_popup_padding">24dp</dimen> <!-- The size of the caption bar inset at the top of bubble bar expanded view. --> <dimen name="bubble_bar_expanded_view_caption_height">32dp</dimen> + <!-- The width of the caption bar at the top of bubble bar expanded view. --> + <dimen name="bubble_bar_expanded_view_caption_width">128dp</dimen> <!-- The height of the dots shown for the caption menu in the bubble bar expanded view.. --> <dimen name="bubble_bar_expanded_view_caption_dot_size">4dp</dimen> <!-- The spacing between the dots for the caption menu in the bubble bar expanded view.. --> diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedView.java index eddd43f263d9..271fb9abce6a 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedView.java @@ -143,6 +143,8 @@ public class BubbleBarExpandedView extends FrameLayout implements BubbleTaskView outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), mCurrentCornerRadius); } }); + // Set a touch sink to ensure that clicks on the caption area do not propagate to the parent + setOnTouchListener((v, event) -> true); } @Override @@ -245,12 +247,8 @@ public class BubbleBarExpandedView extends FrameLayout implements BubbleTaskView @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); - int height = MeasureSpec.getSize(heightMeasureSpec); - int menuViewHeight = Math.min(mCaptionHeight, height); - measureChild(mHandleView, widthMeasureSpec, MeasureSpec.makeMeasureSpec(menuViewHeight, - MeasureSpec.getMode(heightMeasureSpec))); - if (mTaskView != null) { + int height = MeasureSpec.getSize(heightMeasureSpec); measureChild(mTaskView, widthMeasureSpec, MeasureSpec.makeMeasureSpec(height, MeasureSpec.getMode(heightMeasureSpec))); } @@ -259,14 +257,11 @@ public class BubbleBarExpandedView extends FrameLayout implements BubbleTaskView @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { super.onLayout(changed, l, t, r, b); - final int captionBottom = t + mCaptionHeight; if (mTaskView != null) { mTaskView.layout(l, t, r, t + mTaskView.getMeasuredHeight()); mTaskView.setCaptionInsets(Insets.of(0, mCaptionHeight, 0, 0)); } - // Handle draws on top of task view in the caption area. - mHandleView.layout(l, t, r, captionBottom); } @Override diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarLayerView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarLayerView.java index 62f2726ad9bd..78a41f759d96 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarLayerView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarLayerView.java @@ -231,6 +231,7 @@ public class BubbleBarLayerView extends FrameLayout // Touch delegate for the menu BubbleBarHandleView view = mExpandedView.getHandleView(); view.getBoundsOnScreen(mHandleTouchBounds); + // Move top value up to ensure touch target is large enough mHandleTouchBounds.top -= mPositioner.getBubblePaddingTop(); mHandleTouchDelegate = new TouchDelegate(mHandleTouchBounds, mExpandedView.getHandleView()); |