diff options
| author | 2019-04-09 08:54:25 -0700 | |
|---|---|---|
| committer | 2019-05-31 10:45:18 -0700 | |
| commit | ea8b7fef7f047cb35badd6c85b464b3c871763d0 (patch) | |
| tree | b9ff241e876736a3a1ab3299d2066bad93198dba | |
| parent | ab160487d60ab6a20b7af43152729bebb338825f (diff) | |
Small fixes to CarSysUI Volume Dialog
Make background transparent and makes the volume items black background.
This is to deal with some UI jank where the background appears before
the item appears.
Separated the left and right padding so that they can be overlayed
separately.
Bug: 129402464
Test: manual
Change-Id: Icff89e0858e9b6b73696082ac2fe37fd5cbcaf1c
4 files changed, 16 insertions, 7 deletions
diff --git a/packages/CarSystemUI/res/layout/car_volume_item.xml b/packages/CarSystemUI/res/layout/car_volume_item.xml index 2275ca6329e2..0b429040fc86 100644 --- a/packages/CarSystemUI/res/layout/car_volume_item.xml +++ b/packages/CarSystemUI/res/layout/car_volume_item.xml @@ -19,16 +19,18 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" + android:background="@color/car_volume_dialog_background_color" + android:paddingStart="@dimen/car_volume_item_padding_start" + android:paddingEnd="@dimen/car_volume_item_padding_end" android:minHeight="@dimen/car_volume_item_height"> <!-- Primary Action. --> <ImageView android:id="@+id/primary_icon" - android:layout_width="@dimen/car_primary_icon_size" + android:layout_width="@dimen/car_volume_item_icon_size" android:layout_centerVertical="true" - android:layout_marginStart="@dimen/car_volume_item_margin_horizontal" android:layout_alignParentStart="true" - android:layout_height="@dimen/car_primary_icon_size"/> + android:layout_height="@dimen/car_volume_item_icon_size"/> <!-- Note: the horizontal padding and offset are set to 0 so that the track and thumb aligns with the proper keylines. --> @@ -61,11 +63,10 @@ android:background="@color/car_volume_item_divider_color"/> <ImageView android:id="@+id/supplemental_icon" - android:layout_width="@dimen/car_primary_icon_size" - android:layout_height="@dimen/car_primary_icon_size" + android:layout_width="@dimen/car_volume_item_icon_size" + android:layout_height="@dimen/car_volume_item_icon_size" android:background="?android:attr/selectableItemBackground" android:layout_centerVertical="true" android:layout_alignParentEnd="true" - android:layout_marginEnd="@dimen/car_volume_item_margin_horizontal" android:scaleType="fitCenter"/> </RelativeLayout> diff --git a/packages/CarSystemUI/res/values/colors.xml b/packages/CarSystemUI/res/values/colors.xml index 72914f7b1816..b81896283570 100644 --- a/packages/CarSystemUI/res/values/colors.xml +++ b/packages/CarSystemUI/res/values/colors.xml @@ -37,6 +37,9 @@ <!-- The background color of the notification shade --> <color name="notification_shade_background_color">#DD000000</color> + <!-- The background color of the car volume dialog --> + <color name="car_volume_dialog_background_color">@color/system_bar_background_opaque</color> + <!-- The color of the dividing line between grouped notifications. --> <color name="notification_divider_color">@*android:color/notification_action_list</color> diff --git a/packages/CarSystemUI/res/values/dimens.xml b/packages/CarSystemUI/res/values/dimens.xml index 0358357b9c1a..70174848df24 100644 --- a/packages/CarSystemUI/res/values/dimens.xml +++ b/packages/CarSystemUI/res/values/dimens.xml @@ -78,8 +78,10 @@ <dimen name="ongoing_appops_chip_bg_corner_radius">12dp</dimen> <!-- Car volume dimens. --> + <dimen name="car_volume_item_icon_size">@dimen/car_primary_icon_size</dimen> <dimen name="car_volume_item_height">@*android:dimen/car_single_line_list_item_height</dimen> - <dimen name="car_volume_item_margin_horizontal">@*android:dimen/car_keyline_1</dimen> + <dimen name="car_volume_item_padding_start">@*android:dimen/car_keyline_1</dimen> + <dimen name="car_volume_item_padding_end">@*android:dimen/car_keyline_1</dimen> <dimen name="car_volume_item_seekbar_margin_vertical">@*android:dimen/car_padding_1</dimen> <dimen name="car_volume_item_seekbar_margin_start">@*android:dimen/car_keyline_3</dimen> <dimen name="car_volume_item_seekbar_margin_end">@*android:dimen/car_padding_4</dimen> diff --git a/packages/CarSystemUI/src/com/android/systemui/volume/CarVolumeDialogImpl.java b/packages/CarSystemUI/src/com/android/systemui/volume/CarVolumeDialogImpl.java index 94962f7c1989..d0a63f058291 100644 --- a/packages/CarSystemUI/src/com/android/systemui/volume/CarVolumeDialogImpl.java +++ b/packages/CarSystemUI/src/com/android/systemui/volume/CarVolumeDialogImpl.java @@ -32,7 +32,9 @@ import android.content.DialogInterface; import android.content.ServiceConnection; import android.content.res.TypedArray; import android.content.res.XmlResourceParser; +import android.graphics.Color; import android.graphics.PixelFormat; +import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.media.AudioManager; import android.os.Debug; @@ -245,6 +247,7 @@ public class CarVolumeDialogImpl implements VolumeDialog { mExpanded = false; mWindow = mDialog.getWindow(); mWindow.requestFeature(Window.FEATURE_NO_TITLE); + mWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); mWindow.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR); mWindow.addFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE |