diff options
author | Chung-yih Wang <cywang@google.com> | 2011-09-23 15:34:08 +0800 |
---|---|---|
committer | Chung-yih Wang <cywang@google.com> | 2011-09-23 16:33:19 +0800 |
commit | c4f4c3da52404870b0b559b7bf88896a4f41b7de (patch) | |
tree | d0e90ad15bb4a1fe96d777e73adee0b62425ee2f /src/com | |
parent | 3c5ee7fa680b4fa7bf2ec1d20d3de774b245c097 (diff) | |
download | packages_apps_LegacyCamera-c4f4c3da52404870b0b559b7bf88896a4f41b7de.zip packages_apps_LegacyCamera-c4f4c3da52404870b0b559b7bf88896a4f41b7de.tar.gz packages_apps_LegacyCamera-c4f4c3da52404870b0b559b7bf88896a4f41b7de.tar.bz2 |
Fix the current mode hightlight of ModePicker.
bug:5363212
The hightlight was incorrect as the initial value of ModePicker is
MODE_CAMERA and the old code just return right away without update its
current highlight.
Change-Id: I2ae8e2c614be75836ad49abe0c735f01f37f5e12
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/camera/ModePicker.java | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/com/android/camera/ModePicker.java b/src/com/android/camera/ModePicker.java index cc17f9b..468882a 100644 --- a/src/com/android/camera/ModePicker.java +++ b/src/com/android/camera/ModePicker.java @@ -152,31 +152,22 @@ public class ModePicker extends RelativeLayout implements View.OnClickListener { } } - private void setMode(int mode) { - for (int i = 0; i < MODE_NUM; ++i) { - mModeSelectionIcon[i].setSelected(mode == i); - } - } - public void setOnModeChangeListener(OnModeChangeListener listener) { mListener = listener; } public void setCurrentMode(int mode) { - if (mCurrentMode == mode) return; - setMode(mode); tryToSetMode(mode); + updateModeState(); } private void tryToSetMode(int mode) { if (mListener != null) { if (!mListener.onModeChanged(mode)) { - setMode(mCurrentMode); return; } } mCurrentMode = mode; - updateModeState(); } public boolean onModeChanged(int mode) { |