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

Commit 9cdcaefe authored by Edgar Wang's avatar Edgar Wang Committed by Android (Google) Code Review
Browse files

Merge "[Expressive] Apply correct theme to homepage." into main

parents 0f217ed3 915991bf
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
@@ -64,8 +63,7 @@
            android:textAlignment="viewStart"
            android:singleLine="true"
            android:textAppearance="?android:attr/textAppearanceListItem"
            android:hyphenationFrequency="normalFast"
            android:lineBreakWordStyle="phrase"
            android:textColor="@color/settingslib_text_color_primary"
            android:ellipsize="marquee"/>

        <TextView
@@ -77,10 +75,8 @@
            android:layout_gravity="start"
            android:textAlignment="viewStart"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textColor="@androidprv:color/materialColorOnSurfaceVariant"
            android:textColor="@color/settingslib_text_color_secondary"
            android:maxLines="4"
            android:hyphenationFrequency="normalFast"
            android:lineBreakWordStyle="phrase"
            style="@style/PreferenceSummaryTextStyle"/>
    </RelativeLayout>

+4 −2
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@
        <item name="colorSurface">@color/settingslib_colorSurface</item>
    </style>

    <style name="Theme.SubSettings.Expressive.Base" parent="Theme.Settings.Expressive.NoActionBar">
    <style name="Theme.SubSettings.Expressive" parent="Theme.Settings.Expressive.NoActionBar">
        <!-- Redefine the ActionBar style for contentInsetStart -->
        <item name="android:actionBarStyle">@style/Widget.ActionBar.SubSettings</item>

@@ -93,5 +93,7 @@
        <item name="android:statusBarColor">@android:color/transparent</item>
    </style>

    <style name="Theme.SubSettings.Expressive" parent="Theme.SubSettings.Expressive.Base"/>
    <style name="Theme.Settings.Home.Expressive" parent="Theme.Settings.Expressive.NoActionBar">
        <item name="android:colorBackground">@color/settingslib_materialColorSurfaceContainerLow</item>
    </style>
</resources>
+5 −0
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ import com.android.settings.overlay.FeatureFactory;
import com.android.settings.safetycenter.SafetyCenterManagerWrapper;
import com.android.settingslib.Utils;
import com.android.settingslib.core.lifecycle.HideNonSystemOverlayMixin;
import com.android.settingslib.widget.SettingsThemeHelper;

import com.google.android.setupcompat.util.WizardManagerHelper;

@@ -194,6 +195,10 @@ public class SettingsHomepageActivity extends FragmentActivity implements
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        if (SettingsThemeHelper.isExpressiveTheme(this)) {
            setTheme(R.style.Theme_Settings_Home_Expressive);
        }

        // Ensure device is provisioned in order to access Settings home
        // TODO(b/331254029): This should later be replaced in favor of an allowlist
        boolean unprovisioned = android.provider.Settings.Global.getInt(getContentResolver(),
+5 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.settings.widget;

import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
@@ -248,8 +249,10 @@ public class HighlightableTopLevelPreferenceAdapter extends RoundCornerPreferenc
            if (SettingsThemeHelper.isExpressiveTheme(context)) {
                TextView title = v.findViewById(android.R.id.title);
                if (title != null) {
                    ColorStateList currentColor = title.getTextColors();
                    title.setTextAppearance(context, com.android.settingslib.widget.theme.R.style
                            .TextAppearance_SettingsLib_TitleMedium_Emphasized);
                    title.setTextColor(currentColor);
                }
            }
        } else {
@@ -272,8 +275,10 @@ public class HighlightableTopLevelPreferenceAdapter extends RoundCornerPreferenc
            if (SettingsThemeHelper.isExpressiveTheme(context)) {
                TextView title = v.findViewById(android.R.id.title);
                if (title != null) {
                    ColorStateList currentColor = title.getTextColors();
                    title.setTextAppearance(context, com.android.settingslib.widget.theme.R.style
                            .TextAppearance_SettingsLib_TitleMedium);
                    title.setTextColor(currentColor);
                }
            }
        } else {