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

Commit 51672a18 authored by Shen Lin's avatar Shen Lin
Browse files

[Status Bar] Fix carrier and userSwitchName text style flaw

These textview style has been polished in 2019, but not sync with java
 code. When users change theme, it will be going to recreate with wrong
 style.

Design: https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/packages/SystemUI/res/layout/keyguard_status_bar.xml;l=79
Design: https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/packages/SystemUI/res/layout/status_bar_user_chip_container.xml;l=38
Bug: b/328588489
Test: manual, atest
Change-Id: I850b2c9b56920b5cd565c96670148ea453e02fb7
parent 448a9ffa
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -428,13 +428,14 @@ public class KeyguardStatusBarView extends RelativeLayout {


    /** Should only be called from {@link KeyguardStatusBarViewController}. */
    /** Should only be called from {@link KeyguardStatusBarViewController}. */
    void onOverlayChanged() {
    void onOverlayChanged() {
        int theme = Utils.getThemeAttr(mContext, com.android.internal.R.attr.textAppearanceSmall);
        final int carrierTheme = R.style.TextAppearance_StatusBar_Clock;
        mCarrierLabel.setTextAppearance(theme);
        mCarrierLabel.setTextAppearance(carrierTheme);
        mBatteryView.updatePercentView();
        mBatteryView.updatePercentView();


        final int userSwitcherTheme = R.style.TextAppearance_StatusBar_UserChip;
        TextView userSwitcherName = mUserSwitcherContainer.findViewById(R.id.current_user_name);
        TextView userSwitcherName = mUserSwitcherContainer.findViewById(R.id.current_user_name);
        if (userSwitcherName != null) {
        if (userSwitcherName != null) {
            userSwitcherName.setTextAppearance(theme);
            userSwitcherName.setTextAppearance(userSwitcherTheme);
        }
        }
    }
    }