diff options
| author | 2021-05-12 15:15:34 -0700 | |
|---|---|---|
| committer | 2021-05-18 10:01:43 -0700 | |
| commit | 7376a67ad05ecb39a85dcad2a6f81b592302b93f (patch) | |
| tree | e0f54c76dea4fb172855714bb1bfde51d1d7794e | |
| parent | 367d8ea45f4dc5a089c36c43dbc56a00367054f2 (diff) | |
Update the manage button to the new style
Also fixes a bug where the overflow view would still leave space
for the manage button even though we don't show something there.
Bug: 183658858
Test: manual - open a bubble and observe the manage button, should
be on a dark background with light text regardless
of light / dark theme.
Change-Id: Ie3f67ccd26ad4d75a3ed21a3dee43e2f74d07022
3 files changed, 38 insertions, 4 deletions
diff --git a/libs/WindowManager/Shell/res/drawable/bubble_manage_btn_bg.xml b/libs/WindowManager/Shell/res/drawable/bubble_manage_btn_bg.xml new file mode 100644 index 000000000000..8710fb8ac69b --- /dev/null +++ b/libs/WindowManager/Shell/res/drawable/bubble_manage_btn_bg.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2021 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <solid + android:color="@android:color/system_neutral1_900" + /> + <corners android:radius="20dp" /> + + <padding + android:left="20dp" + android:right="20dp"> + </padding> + +</shape>
\ No newline at end of file diff --git a/libs/WindowManager/Shell/res/layout/bubble_expanded_view.xml b/libs/WindowManager/Shell/res/layout/bubble_expanded_view.xml index 33e009efd371..cd15f25877fd 100644 --- a/libs/WindowManager/Shell/res/layout/bubble_expanded_view.xml +++ b/libs/WindowManager/Shell/res/layout/bubble_expanded_view.xml @@ -28,15 +28,18 @@ /> <com.android.wm.shell.common.AlphaOptimizedButton - style="@android:style/Widget.Material.Button.Borderless" + style="@android:style/Widget.DeviceDefault.Button.Borderless" android:id="@+id/settings_button" android:layout_gravity="start" android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_height="40dp" + android:layout_marginTop="8dp" + android:layout_marginLeft="8dp" android:focusable="true" android:text="@string/manage_bubbles_text" android:textSize="@*android:dimen/text_size_body_2_material" - android:textColor="?android:attr/textColorPrimary" + android:background="@drawable/bubble_manage_btn_bg" + android:textColor="@*android:color/system_neutral1_50" /> </com.android.wm.shell.bubbles.BubbleExpandedView> diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java index 7755cc0e6aed..53a47b70b0c1 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java @@ -651,11 +651,12 @@ public class BubbleExpandedView extends LinearLayout { // Remove top insets back here because availableRect.height would account for that ? mExpandedViewContainerLocation[1] - mPositioner.getInsets().top : 0; + int settingsHeight = mIsOverflow ? 0 : mSettingsIconHeight; return mPositioner.getAvailableRect().height() - expandedContainerY - getPaddingTop() - getPaddingBottom() - - mSettingsIconHeight + - settingsHeight - mPointerHeight - mPointerMargin; } |