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

Commit ea8b7fef authored by Heemin Seog's avatar Heemin Seog
Browse files

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
parent ab160487
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -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>
+3 −0
Original line number Diff line number Diff line
@@ -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>

+3 −1
Original line number Diff line number Diff line
@@ -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>
+3 −0
Original line number Diff line number Diff line
@@ -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