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

Commit a66abdde authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊 Committed by Mohammed Althaf T
Browse files

SystemUI: QSCustomizer: Fix QS tile reset text color

- Fixes https://gitlab.com/LineageOS/issues/android/-/issues/4873

Change-Id: I49a599f10f68c0c576ec863b919936a3b171f2c6
parent e1f5dc7e
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -20,6 +20,9 @@ import android.animation.Animator.AnimatorListener;
import android.animation.AnimatorListenerAdapter;
import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Color;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.LayoutInflater;
@@ -73,8 +76,11 @@ public class QSCustomizer extends LinearLayout {
        toolbar.setNavigationIcon(
                getResources().getDrawable(value.resourceId, mContext.getTheme()));

        toolbar.getMenu().add(Menu.NONE, MENU_RESET, 0,
        SpannableString resetText = new SpannableString(
                mContext.getString(com.android.internal.R.string.reset));
        resetText.setSpan(new ForegroundColorSpan(isNightMode() ?
                Color.WHITE : Color.BLACK), 0, resetText.length(), 0);
        toolbar.getMenu().add(Menu.NONE, MENU_RESET, 0, resetText);
        toolbar.setTitle(R.string.qs_edit);
        mRecyclerView = findViewById(android.R.id.list);
        mTransparentView = findViewById(R.id.customizer_transparent_view);
@@ -83,6 +89,11 @@ public class QSCustomizer extends LinearLayout {
        mRecyclerView.setItemAnimator(animator);
    }

    private boolean isNightMode() {
        return (mContext.getResources().getConfiguration().uiMode
                & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES;
    }

    void updateResources() {
        LayoutParams lp = (LayoutParams) mTransparentView.getLayoutParams();
        lp.height = Utils.getQsHeaderSystemIconsAreaHeight(mContext);