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

Commit 5fce5967 authored by youngmac's avatar youngmac Committed by Mac Young
Browse files

Update Car Intent Resolver UI

Bug: 329451873 (Hudson)
Bug: 329452468 (CW)
Test: Manual

Updates the UI across both Hudson and CW, adding a blurred background
and new styling to match Design System 2.0. The changes were made with car theming in mind, using “car-ified” widgets and car styles/attributes as much as possible.

Topic includes changes to:
- CarActivityResolver app
- frameworks/…/res car_resolver_list layouts
- frameworks/…/res build time base RRO (Hudson)
- frameworks/…/res build time RRO (CW on top of Hudson)

HSVs:
Hudson unselected (before):  https://hsv.googleplex.com/6608441803014144
Hudson selected (before):    https://hsv.googleplex.com/6729418717265920
Hudson preselected (before): https://hsv.googleplex.com/5858668019974144
Hudson unselected (after):   https://hsv.googleplex.com/5842426366263296
Hudson selected (after):     https://hsv.googleplex.com/5364547064954880
Hudson preselected (after):  https://hsv.googleplex.com/6455601056972800
CW unselected (before):      https://hsv.googleplex.com/6539239947763712
CW selected (before):        https://hsv.googleplex.com/4713227354112000
CW preselected (before):     https://hsv.googleplex.com/6722643641237504
CW unselected (after):       https://hsv.googleplex.com/6490446971797504
CW selected (after):         https://hsv.googleplex.com/4735209802039296
CW preselected (after):      https://hsv.googleplex.com/5959860402257920

Change-Id: Iebf04b8e8d81e4784ed33444c4077a5950f34dbb
parent dc2a1e18
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2024 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="?attr/colorBackgroundFloating" />
    <corners android:radius="@dimen/car_activity_resolver_corner_radius" />
</shape>
 No newline at end of file
+101 −119
Original line number Diff line number Diff line
@@ -18,91 +18,55 @@
-->
<com.android.internal.widget.ResolverDrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_width="@dimen/car_activity_resolver_width"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:id="@id/contentPanel">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:weightSum="5"
        android:layout_alwaysShow="true"
        android:layout_height="wrap_content"
        android:weightSum="2"
        android:orientation="vertical" >

        <View android:id="@+id/empty_top"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="@android:color/transparent" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
        android:background="?attr/colorBackgroundFloating"
        android:elevation="8dp">
            android:background="@drawable/car_activity_resolver_list_background">

            <LinearLayout
            android:id="@+id/button_bar"
            android:visibility="gone"
            style="?attr/buttonBarStyle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
            android:layout_ignoreOffset="true"
            android:layout_alwaysShow="true"
            android:layout_hasNestedScrollIndicator="true"
            android:background="?attr/colorBackgroundFloating"
                android:background="@drawable/car_activity_resolver_list_background"
                android:orientation="horizontal"
            android:paddingTop="8dp"
            android:paddingStart="12dp"
            android:weightSum="4"
            android:paddingEnd="12dp"
            android:elevation="8dp">

                android:paddingVertical="@dimen/car_padding_4"
                android:paddingHorizontal="@dimen/car_padding_4" >
                <TextView
                    android:id="@+id/profile_button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                android:layout_marginEnd="8dp"
                android:paddingStart="8dp"
                android:paddingEnd="8dp"
                android:textSize="40sp"
                android:layout_weight="4"
                android:layout_gravity="left"
                android:visibility="gone"
                android:textColor="?attr/colorAccent"
                android:singleLine="true"/>
                    android:visibility="gone" />

                <TextView
                    android:id="@+id/title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                android:layout_gravity="left"
                android:layout_weight="3"
                android:paddingTop="8dp"
                android:layout_below="@id/profile_button"
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:paddingBottom="8dp"/>

            <Button
                android:id="@+id/button_once"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:enabled="false"
                android:layout_gravity="right"
                style="?attr/buttonBarButtonStyle"
                android:text="@string/activity_resolver_use_once"
                android:layout_weight="0.5"
                android:onClick="onButtonClick"/>

            <Button
                android:id="@+id/button_always"
                android:layout_marginLeft="2dp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:enabled="false"
                android:layout_gravity="right"
                style="?attr/buttonBarButtonStyle"
                android:text="@string/activity_resolver_use_always"
                android:layout_weight="0.5"
                android:onClick="onButtonClick"/>
                    android:layout_gravity="start"
                    android:textAppearance="@android:style/TextAppearance.DeviceDefault.DialogWindowTitle" />
            </LinearLayout>

            <FrameLayout
                android:id="@+id/stub"
                android:visibility="gone"
                android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="?attr/colorBackgroundFloating"/>
                android:layout_height="wrap_content"/>

            <TabHost
                android:id="@+id/profile_tabhost"
@@ -110,25 +74,22 @@
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                android:layout_centerHorizontal="true"
            android:background="?attr/colorBackgroundFloating">
                android:background="?android:attr/colorBackgroundFloating">
                <LinearLayout
                    android:orientation="vertical"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">
                    <TabWidget
                        android:id="@android:id/tabs"
                        android:visibility="gone"
                        android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:visibility="gone">
                        android:layout_height="wrap_content">
                    </TabWidget>
                    <View
                        android:id="@+id/resolver_tab_divider"
                        android:visibility="gone"
                        android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="?attr/colorBackgroundFloating"
                    android:foreground="?attr/dividerVertical"
                    android:layout_marginBottom="8dp"/>
                        android:layout_height="wrap_content" />
                    <FrameLayout
                        android:id="@android:id/tabcontent"
                        android:layout_width="match_parent"
@@ -141,23 +102,44 @@
                </LinearLayout>
            </TabHost>

        <View
            android:layout_alwaysShow="true"
            <LinearLayout
                android:id="@+id/button_bar"
                android:visibility="gone"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginVertical="@dimen/car_padding_4"
                android:layout_marginHorizontal="@dimen/car_padding_4"
                android:padding="0dp"
                android:gravity="center"
                android:background="@drawable/car_activity_resolver_list_background"
                android:orientation="vertical">

                <Button
                    android:id="@+id/button_once"
                    android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="?attr/colorBackgroundFloating"
            android:foreground="?attr/dividerVertical"/>
                    android:layout_height="@dimen/car_button_height"
                    android:enabled="false"
                    android:layout_gravity="center"
                    android:layout_marginBottom="@dimen/car_padding_2"
                    android:text="@string/activity_resolver_use_once"
                    android:onClick="onButtonClick"/>

        <TextView android:id="@+id/empty"
                <Button
                    android:id="@+id/button_always"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/car_button_height"
                    android:enabled="false"
                    android:layout_gravity="center"
                    android:text="@string/activity_resolver_use_always"
                    android:onClick="onButtonClick"/>
            </LinearLayout>
        </LinearLayout>

        <View android:id="@+id/empty_bottom"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
                  android:background="?attr/colorBackgroundFloating"
                  android:elevation="8dp"
                  android:layout_alwaysShow="true"
                  android:text="@string/noApplications"
                  android:padding="32dp"
                  android:gravity="center"
                  android:visibility="gone"/>
            android:layout_weight="1"
            android:background="@android:color/transparent" />

    </LinearLayout>

+126 −143
Original line number Diff line number Diff line
@@ -18,138 +18,90 @@
-->
<com.android.internal.widget.ResolverDrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:maxCollapsedHeight="200dp"
    android:layout_width="@dimen/car_activity_resolver_width"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:id="@id/contentPanel">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:weightSum="5"
        android:layout_alwaysShow="true"
        android:layout_height="wrap_content"
        android:weightSum="2"
        android:orientation="vertical" >

        <View android:id="@+id/empty_top"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="@android:color/transparent" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
        android:background="?attr/colorBackgroundFloating"
        android:elevation="8dp">
            android:layout_gravity="center"
            android:background="@drawable/car_activity_resolver_list_background">

            <FrameLayout
                android:id="@+id/stub"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@drawable/car_activity_resolver_list_background"/>


            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
            android:layout_weight="0.5"
                android:minHeight="@dimen/car_activity_resolver_list_item_height"
                android:orientation="horizontal">

                <RadioButton
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:focusable="false"
                    android:clickable="false"
                    android:layout_marginStart="?attr/listPreferredItemPaddingStart"
                    android:layout_gravity="start|center_vertical"
                    android:checked="true"/>

                <ImageView
                    android:id="@+id/icon"
                android:layout_width="60dp"
                android:layout_height="60dp"
                android:layout_gravity="start|top"
                android:layout_marginStart="10dp"
                android:layout_marginEnd="5dp"
                android:layout_marginTop="10dp"
                    android:layout_width="@dimen/car_icon_size"
                    android:layout_height="@dimen/car_icon_size"
                    android:layout_gravity="start|center_vertical"
                    android:layout_marginStart="@dimen/car_padding_4"
                    android:src="@drawable/resolver_icon_placeholder"
                    android:scaleType="fitCenter"/>

                <TextView
                    android:id="@+id/title"
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="?attr/listPreferredItemHeight"
                android:layout_marginStart="16dp"
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:gravity="start|center_vertical"
                android:paddingEnd="16dp"/>
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginHorizontal="?attr/listPreferredItemPaddingStart"
                    style="?android:attr/textAppearanceListItem"
                    android:layout_gravity="start|center_vertical" />

                <LinearLayout
                    android:id="@+id/profile_button"
                android:layout_width="wrap_content"
                android:layout_height="48dp"
                android:layout_marginTop="4dp"
                android:layout_marginEnd="4dp"
                android:paddingStart="8dp"
                android:paddingEnd="8dp"
                android:paddingTop="4dp"
                android:paddingBottom="4dp"
                android:focusable="true"
                    android:visibility="gone"
                style="?attr/borderlessButtonStyle">
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content">

                    <ImageView
                        android:id="@+id/icon"
                    android:layout_width="24dp"
                    android:layout_height="24dp"
                    android:layout_gravity="start|center_vertical"
                    android:layout_marginEnd="?attr/listPreferredItemPaddingEnd"
                    android:layout_marginTop="12dp"
                    android:layout_marginBottom="12dp"
                    android:scaleType="fitCenter"/>
                        android:visibility="gone"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content" />

                    <TextView
                        android:id="@id/text1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="start|center_vertical"
                    android:layout_marginEnd="?attr/listPreferredItemPaddingEnd"
                    android:textAppearance="?attr/textAppearanceButton"
                    android:textColor="?attr/textColorPrimary"
                    android:minLines="1"
                    android:maxLines="1"
                    android:ellipsize="marquee"/>
            </LinearLayout>
        </LinearLayout>

        <LinearLayout
            android:id="@+id/button_bar"
                        android:visibility="gone"
            style="?attr/buttonBarStyle"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alwaysShow="true"
            android:gravity="end|center_vertical"
            android:layout_weight="0.5"
            android:orientation="horizontal"
            android:layoutDirection="locale"
            android:measureWithLargestChild="true"
            android:paddingTop="8dp"
            android:paddingBottom="8dp"
            android:paddingStart="12dp"
            android:paddingEnd="12dp"
            android:elevation="8dp">

            <Button
                android:id="@+id/button_once"
                        android:layout_width="wrap_content"
                android:layout_gravity="start"
                android:maxLines="2"
                style="?attr/buttonBarButtonStyle"
                android:minHeight="@dimen/alert_dialog_button_bar_height"
                android:layout_height="wrap_content"
                android:enabled="false"
                android:text="@string/activity_resolver_use_once"
                android:onClick="onButtonClick"/>

            <Button
                android:id="@+id/button_always"
                android:layout_width="wrap_content"
                android:layout_gravity="end"
                android:maxLines="2"
                android:minHeight="@dimen/alert_dialog_button_bar_height"
                style="?attr/buttonBarButtonStyle"
                android:layout_height="wrap_content"
                android:enabled="false"
                android:text="@string/activity_resolver_use_always"
                android:onClick="onButtonClick"/>
                        android:layout_height="wrap_content" />
                </LinearLayout>
            </LinearLayout>

        <FrameLayout
            android:id="@+id/stub"
            android:layout_alwaysShow="true"
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="?attr/colorBackgroundFloating"/>

            <TabHost
            android:layout_alwaysShow="true"
                android:id="@+id/profile_tabhost"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
@@ -170,10 +122,7 @@
                        android:id="@+id/resolver_tab_divider"
                        android:visibility="gone"
                        android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="?attr/colorBackgroundFloating"
                    android:foreground="?attr/dividerVertical"
                    android:layout_marginBottom="8dp"/>
                        android:layout_height="wrap_content" />
                    <FrameLayout
                        android:id="@android:id/tabcontent"
                        android:layout_width="match_parent"
@@ -187,10 +136,44 @@
                </LinearLayout>
            </TabHost>

        <View
            <LinearLayout
                android:id="@+id/button_bar"
                android:visibility="gone"
                android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="?attr/dividerVertical"/>
                android:layout_height="wrap_content"
                android:layout_marginVertical="@dimen/car_padding_4"
                android:layout_marginHorizontal="@dimen/car_padding_4"
                android:gravity="center"
                android:background="@drawable/car_activity_resolver_list_background"
                android:orientation="vertical">

                <Button
                    android:id="@+id/button_once"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/car_button_height"
                    android:enabled="false"
                    android:layout_gravity="center"
                    android:layout_marginBottom="@dimen/car_padding_2"
                    android:text="@string/activity_resolver_use_once"
                    android:onClick="onButtonClick"/>

                <Button
                    android:id="@+id/button_always"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/car_button_height"
                    android:enabled="false"
                    android:layout_gravity="center"
                    android:text="@string/activity_resolver_use_always"
                    android:onClick="onButtonClick"/>
            </LinearLayout>
        </LinearLayout>

        <View android:id="@+id/empty_bottom"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="@android:color/transparent" />

    </LinearLayout>

</com.android.internal.widget.ResolverDrawerLayout>
+6 −0
Original line number Diff line number Diff line
@@ -151,4 +151,10 @@
    <dimen name="action_bar_button_margin">@*android:dimen/car_padding_4</dimen>
    <dimen name="action_bar_button_max_width">268dp</dimen>
    <dimen name="action_bar_toggle_internal_padding">@*android:dimen/car_padding_3</dimen>

    <!-- Intent Resolver -->
    <dimen name="car_activity_resolver_width">706dp</dimen>
    <dimen name="car_activity_resolver_list_item_height">96dp</dimen>
    <dimen name="car_activity_resolver_list_max_height">256dp</dimen>
    <dimen name="car_activity_resolver_corner_radius">24dp</dimen>
</resources>