summaryrefslogtreecommitdiff
path: root/src/com
diff options
context:
space:
mode:
authorGeorge Lin <giolin@google.com>2023-11-20 14:39:37 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2023-11-20 14:39:37 +0000
commit93ddc7b5f21d6259dfc1f30b8cc27f6dc4ef3be4 (patch)
treeb6cf5c4b9d7c1b7c705e542f2cd0d6f1c59fd828 /src/com
parent2f68800a2ff2fe8e36430457af1c09a68e7cda73 (diff)
parenta643bee181d4bdc9eb2afb407dad31dde303e6c4 (diff)
downloadThemePicker-93ddc7b5f21d6259dfc1f30b8cc27f6dc4ef3be4.tar.gz
Merge "Fix multiple logs of THEMED_ICON_APPLIED" into main
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/customization/model/themedicon/ThemedIconSectionController.java1
-rw-r--r--src/com/android/customization/picker/themedicon/ThemedIconSectionView.java14
2 files changed, 7 insertions, 8 deletions
diff --git a/src/com/android/customization/model/themedicon/ThemedIconSectionController.java b/src/com/android/customization/model/themedicon/ThemedIconSectionController.java
index 6c738c70..be7da042 100644
--- a/src/com/android/customization/model/themedicon/ThemedIconSectionController.java
+++ b/src/com/android/customization/model/themedicon/ThemedIconSectionController.java
@@ -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> {
diff --git a/src/com/android/customization/picker/themedicon/ThemedIconSectionView.java b/src/com/android/customization/picker/themedicon/ThemedIconSectionView.java
index 3e03a41c..f83da8c1 100644
--- a/src/com/android/customization/picker/themedicon/ThemedIconSectionView.java
+++ b/src/com/android/customization/picker/themedicon/ThemedIconSectionView.java
@@ -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);
- }
- }
}