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

Commit aebc33a4 authored by Nishith  Khanna's avatar Nishith Khanna
Browse files

Merge remote-tracking branch 'origin/lineage-19.1' into v1-s

parents d4911bf8 a66abdde
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);