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

Commit 8d50517b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Check for theme change after attaching to window."

parents 95335a50 d717b849
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -483,7 +483,9 @@ public class KeyguardStatusBarView extends RelativeLayout
                R.color.light_mode_icon_color_single_tone);
        float intensity = textColor == Color.WHITE ? 0 : 1;
        mCarrierLabel.setTextColor(iconColor);
        if (mIconManager != null) {
            mIconManager.setTint(iconColor);
        }

        applyDarkness(R.id.battery, mEmptyRect, intensity * (1f - mDarkAmount), iconColor);
        applyDarkness(R.id.clock, mEmptyRect, intensity, iconColor);
+18 −0
Original line number Diff line number Diff line
@@ -326,6 +326,14 @@ public class NotificationPanelView extends PanelView implements
            Dependency.get(ShadeController.class);
    private int mDisplayId;

    /**
     * Cache the resource id of the theme to avoid unnecessary work in onThemeChanged.
     *
     * onThemeChanged is forced when the theme might not have changed. So, to avoid unncessary
     * work, check the current id with the cached id.
     */
    private int mThemeResId;

    @Inject
    public NotificationPanelView(@Named(VIEW_CONTEXT) Context context, AttributeSet attrs,
            NotificationWakeUpCoordinator coordinator,
@@ -342,6 +350,7 @@ public class NotificationPanelView extends PanelView implements
        mCommandQueue = getComponent(context, CommandQueue.class);
        mDisplayId = context.getDisplayId();
        mPulseExpansionHandler = pulseExpansionHandler;
        mThemeResId = context.getThemeResId();
    }

    /**
@@ -390,6 +399,9 @@ public class NotificationPanelView extends PanelView implements
        Dependency.get(StatusBarStateController.class).addCallback(this);
        Dependency.get(ZenModeController.class).addCallback(this);
        Dependency.get(ConfigurationController.class).addCallback(this);
        // Theme might have changed between inflating this view and attaching it to the window, so
        // force a call to onThemeChanged
        onThemeChanged();
    }

    @Override
@@ -452,6 +464,12 @@ public class NotificationPanelView extends PanelView implements

    @Override
    public void onThemeChanged() {
        final int themeResId = getContext().getThemeResId();
        if (mThemeResId == themeResId) {
            return;
        }
        mThemeResId = themeResId;

        updateShowEmptyShadeView();

        // Re-inflate the status view group.