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

Commit 80309f15 authored by Santiago Etchebehere's avatar Santiago Etchebehere
Browse files

Address pending comments from ag/7447011

Bug: 132257073
Change-Id: I792c63ea0d23809f70750f61d719041956e3e753
parent 2a0b5c81
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@
package com.android.customization.model.theme.custom;

import android.content.Context;
import android.text.TextUtils;

import androidx.annotation.Nullable;

@@ -24,9 +23,7 @@ import com.android.customization.model.CustomizationManager;
import com.android.customization.model.theme.ThemeBundle.PreviewInfo;
import com.android.customization.model.theme.ThemeManager;
import com.android.customization.model.theme.custom.CustomTheme.Builder;
import com.android.wallpaper.R;

import java.util.HashMap;
import java.util.Map;

public class CustomThemeManager implements CustomizationManager<ThemeComponentOption> {
@@ -48,11 +45,6 @@ public class CustomThemeManager implements CustomizationManager<ThemeComponentOp

    @Override
    public void apply(ThemeComponentOption option, @Nullable Callback callback) {
//        option.getOverlayPackages().forEach((category, packageName) -> {
//            if (!TextUtils.isEmpty(packageName)) {
//                mBuilder.addOverlayPackage(category, packageName);
//            }
//        });
        option.buildStep(mBuilder);
        if (callback != null) {
            callback.onSuccess();
+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ import java.util.List;
 */
public class ShapeOptionsProvider extends ThemeComponentOptionProvider<ShapeOption> {

    private static final String TAG = "FontOptionsProvider";
    private static final String TAG = "ShapeOptionsProvider";
    private final String[] mShapePreviewIconPackages;
    private int mThumbSize;

+15 −15
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ abstract class ThemePreviewPage extends PreviewPage {
        private OnClickListener mEditClickListener;
        private final OnLayoutChangeListener mListener;
        private final int mCornerRadius;
        private final ColorStateList mTintList;

        public ThemeCoverPage(Context context, String title, int accentColor, List<Drawable> icons,
                Typeface headlineFont, int cornerRadius,
@@ -108,22 +109,9 @@ abstract class ThemePreviewPage extends PreviewPage {
            mColorTileIconIds = colorTileIconIds;
            mShapeIconIds = shapeIconIds;
            mListener = wallpaperListener;
        }

        @Override
        protected void bindBody(boolean forceRebind) {
            if (card == null) {
                return;
            }

            card.addOnLayoutChangeListener(mListener);
            if (forceRebind) {
                card.requestLayout();
            }

            // Color QS icons:
            int controlGreyColor = mRes.getColor(R.color.control_grey, null);
            ColorStateList tintList = new ColorStateList(
            mTintList = new ColorStateList(
                    new int[][]{
                            new int[]{android.R.attr.state_selected},
                            new int[]{android.R.attr.state_checked},
@@ -135,11 +123,23 @@ abstract class ThemePreviewPage extends PreviewPage {
                            controlGreyColor
                    }
            );
        }

        @Override
        protected void bindBody(boolean forceRebind) {
            if (card == null) {
                return;
            }

            card.addOnLayoutChangeListener(mListener);
            if (forceRebind) {
                card.requestLayout();
            }

            for (int i = 0; i < mColorButtonIds.length; i++) {
                CompoundButton button = card.findViewById(mColorButtonIds[i]);
                if (button != null) {
                    button.setButtonTintList(tintList);
                    button.setButtonTintList(mTintList);
                }
            }
            for (int i = 0; i < 3 && i < mIcons.size(); i++) {