Loading src/com/android/customization/model/themedicon/ThemedIconSectionController.java +1 −0 Original line number Diff line number Diff line Loading @@ -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> { Loading src/com/android/customization/picker/themedicon/ThemedIconSectionView.java +6 −8 Original line number Diff line number Diff line Loading @@ -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); } } } Loading
src/com/android/customization/model/themedicon/ThemedIconSectionController.java +1 −0 Original line number Diff line number Diff line Loading @@ -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> { Loading
src/com/android/customization/picker/themedicon/ThemedIconSectionView.java +6 −8 Original line number Diff line number Diff line Loading @@ -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); } } }