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

Commit 90789491 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11124398 from 30ad6968 to 24Q1-release

Change-Id: Idfa671078f65a22dc8b324a1873a85ffa879c336
parents adea005c 30ad6968
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import com.android.customization.picker.themedicon.ThemedIconSectionView;
import com.android.wallpaper.R;
import com.android.wallpaper.model.CustomizationSectionController;

// TODO (b/311712452): Refactor CustomizationSectionController to use recommended arch UI components
/** The {@link CustomizationSectionController} for themed icon section. */
public class ThemedIconSectionController implements
        CustomizationSectionController<ThemedIconSectionView> {
+1 −0
Original line number Diff line number Diff line
@@ -141,6 +141,7 @@ object ClockSettingsBinder {

                launch {
                    viewModel.colorOptions.collect { colorOptions ->
                        colorOptionContainerListView.removeAllViews()
                        colorOptions.forEachIndexed { index, colorOption ->
                            colorOption.payload?.let { payload ->
                                val item =
+6 −8
Original line number Diff line number Diff line
@@ -40,18 +40,16 @@ public class ThemedIconSectionView extends SectionView {
    protected void onFinishInflate() {
        super.onFinishInflate();
        mSwitchView = findViewById(R.id.themed_icon_toggle);
        setOnClickListener(v -> mSwitchView.toggle());
        mSwitchView.setOnCheckedChangeListener((buttonView, isChecked) -> viewActivated(isChecked));
        setOnClickListener(v -> {
            mSwitchView.toggle();
            if (mSectionViewListener != null) {
                mSectionViewListener.onViewActivated(getContext(), mSwitchView.isChecked());
            }
        });
    }

    /** Gets the switch view. */
    public Switch getSwitch() {
        return mSwitchView;
    }

    private void viewActivated(boolean isChecked) {
        if (mSectionViewListener != null) {
            mSectionViewListener.onViewActivated(getContext(), isChecked);
        }
    }
}