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

Commit 91d9ba67 authored by Heemin Seog's avatar Heemin Seog
Browse files

Theme roles to look like Car Settings

Requires some changes to existing code to special case with
DeviceUtils.isAuto(). At the activity level, this is consistent with how
the permissions screens are set up.

Bug: 130348508
Test: manual
Change-Id: I323ed0cd2fdf8f7c7c5fd279b13ddb76f8de2697
parent 0d3ea56d
Loading
Loading
Loading
Loading
+55 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright 2019 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.
-->

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="@dimen/car_action_bar_height"
        android:gravity="center_vertical"
        android:orientation="horizontal">
        <FrameLayout
            android:id="@+id/back_button"
            android:layout_width="@dimen/car_margin"
            android:layout_height="match_parent">
            <ImageView
                android:layout_width="@dimen/car_icon_size"
                android:layout_height="@dimen/car_icon_size"
                android:layout_gravity="center"
                android:scaleType="fitCenter"
                android:src="@drawable/ic_arrow_back"
                android:tint="?android:attr/textColorPrimary"/>
        </FrameLayout>

        <TextView
            android:id="@+id/label"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:singleLine="true"
            android:textAppearance="?android:attr/textAppearanceLarge"/>
    </LinearLayout>

    <FrameLayout
        android:id="@android:id/list_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingEnd="@dimen/car_margin"
        android:paddingStart="@dimen/car_margin"/>
</LinearLayout>
+4 −0
Original line number Diff line number Diff line
@@ -32,4 +32,8 @@
        <attr name="circle_radius_pressed_percent" format="fraction" />
    </declare-styleable>
    <!-- END: Ported from WearableSupport -->

    <!-- START: Car Settings Preferences -->
    <attr name="carDividerColor" format="color"/>
    <!-- END: Car Settings Preferences -->
</resources>
+5 −0
Original line number Diff line number Diff line
@@ -54,4 +54,9 @@
    <dimen name="incident_image_width">150dp</dimen>
    <dimen name="incident_image_height">200dp</dimen>

    <!-- Auto related dimensions -->
    <dimen name="car_action_bar_height">@*android:dimen/car_app_bar_height</dimen>
    <dimen name="car_margin">@*android:dimen/car_margin</dimen>
    <dimen name="car_icon_size">@*android:dimen/car_primary_icon_size</dimen>

</resources>
+17 −0
Original line number Diff line number Diff line
@@ -858,4 +858,21 @@

    <!-- END ACCESSIBILITY SERVICE DIALOG ITEM -->

    <!-- START CAR SETTINGS PREFERENCE STYLES -->

    <style name="CarPreferenceFragment">
        <item name="android:layout">@layout/car_default_app_frame</item>
    </style>

    <style name="CarPreferenceFragmentList">
        <item name="android:paddingTop">0dp</item>
        <item name="android:paddingBottom">0dp</item>
        <item name="android:paddingStart">0dp</item>
        <item name="android:paddingEnd">0dp</item>
        <item name="android:paddingLeft">0dp</item>
        <item name="android:paddingRight">0dp</item>
    </style>

    <!-- END CAR SETTINGS PREFERENCE STYLES -->

</resources>
+16 −0
Original line number Diff line number Diff line
@@ -22,6 +22,12 @@
        <item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
        <item name="preferenceCategoryTitleTextAppearance">@style/TextAppearance.CategoryTitle</item>
    </style>

    <style name="Settings.NoActionBar" parent="Settings">
        <item name="android:windowActionBar">false</item>
        <item name="android:windowNoTitle">true</item>
    </style>

    <style name="TextAppearance.CategoryTitle"
           parent="@android:style/TextAppearance.DeviceDefault.Medium">
        <item name="android:textAllCaps">true</item>
@@ -78,4 +84,14 @@
           parent="@android:style/Theme.DeviceDefault.Light.Dialog.NoActionBar">
    </style>

    <style name="CarSettings" parent="Settings.NoActionBar">
        <item name="preferenceTheme">@style/CarPreferenceTheme</item>
        <item name="carDividerColor">@*android:color/car_list_divider</item>
    </style>

    <style name="CarPreferenceTheme">
        <item name="preferenceFragmentCompatStyle">@style/CarPreferenceFragment</item>
        <item name="preferenceFragmentListStyle">@style/CarPreferenceFragmentList</item>
    </style>

</resources>
Loading