diff options
author | Chih-Chung Chang <chihchung@google.com> | 2011-10-27 13:17:48 +0800 |
---|---|---|
committer | Chih-Chung Chang <chihchung@google.com> | 2011-10-28 10:24:05 +0800 |
commit | 15402eff4f819bd0984ca8f2f6ea76ea0b92b326 (patch) | |
tree | 22bc58e1851338bb5e5cc887434c1f33c46d85e5 /src | |
parent | e19bfcf0b8518d599c2224b03ce39053ad70010c (diff) | |
download | LegacyCamera-15402eff4f819bd0984ca8f2f6ea76ea0b92b326.zip LegacyCamera-15402eff4f819bd0984ca8f2f6ea76ea0b92b326.tar.gz LegacyCamera-15402eff4f819bd0984ca8f2f6ea76ea0b92b326.tar.bz2 |
Fix 5520606: Should be able to deselect the effect selected to clear effects.
Change-Id: I41ea0d23b4ec83f5205fbe1324fb997a1d0971f3
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/ui/EffectSettingPopup.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/com/android/camera/ui/EffectSettingPopup.java b/src/com/android/camera/ui/EffectSettingPopup.java index c4a4d49..a0f9be0 100644 --- a/src/com/android/camera/ui/EffectSettingPopup.java +++ b/src/com/android/camera/ui/EffectSettingPopup.java @@ -180,11 +180,19 @@ public class EffectSettingPopup extends AbstractSettingPopup implements @Override public void onItemClick(AdapterView<?> parent, View view, int index, long id) { + String value; if (parent == mSillyFacesGrid) { - String value = (String) mSillyFacesItem.get(index).get("value"); - mPreference.setValue(value); + value = (String) mSillyFacesItem.get(index).get("value"); } else if (parent == mBackgroundGrid) { - String value = (String) mBackgroundItem.get(index).get("value"); + value = (String) mBackgroundItem.get(index).get("value"); + } else { + return; + } + + // Tapping the selected effect will deselect it (clear effects). + if (value.equals(mPreference.getValue())) { + mPreference.setValue(mNoEffect); + } else { mPreference.setValue(value); } reloadPreference(); |