From 1c62e1b83c2fdda82c726bf712324444136fdc5d Mon Sep 17 00:00:00 2001 From: Hung-ying Tyan Date: Wed, 1 Dec 2010 16:04:58 +0800 Subject: Disable IndicatorWheel when ControlPanel is disabled. Also removed "mEnabled" in ControlPanel as "enabled" is already a property in the parent class (i.e., View). Bug: 3242889 Change-Id: Ia035ed3eb068331f3d1b8184a51f2c1742710c12 --- src/com/android/camera/ui/ControlPanel.java | 8 ++++---- src/com/android/camera/ui/IndicatorWheel.java | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/com/android/camera/ui/ControlPanel.java b/src/com/android/camera/ui/ControlPanel.java index 5f20637..ed7d8fc 100644 --- a/src/com/android/camera/ui/ControlPanel.java +++ b/src/com/android/camera/ui/ControlPanel.java @@ -52,7 +52,6 @@ public class ControlPanel extends RelativeLayout private BasicSettingPopup[] mBasicSettingPopups; private OtherSettingsPopup mOtherSettingsPopup; private int mActiveIndicator = -1; - private boolean mEnabled = true; static public interface Listener { public void onSharedPreferenceChanged(); @@ -129,7 +128,7 @@ public class ControlPanel extends RelativeLayout } public void onIndicatorClicked(int index) { - if (!mEnabled) return; + if (!isEnabled()) return; if (index < mBasicSettingPopups.length) { if (mBasicSettingPopups[index] == null) { initializeSettingPopup(index); @@ -191,9 +190,10 @@ public class ControlPanel extends RelativeLayout return false; } + @Override public void setEnabled(boolean enabled) { - if (mEnabled == enabled) return; - mEnabled = enabled; + super.setEnabled(enabled); + mIndicatorWheel.setEnabled(enabled); } // Popup window is dismissed. diff --git a/src/com/android/camera/ui/IndicatorWheel.java b/src/com/android/camera/ui/IndicatorWheel.java index b80eea5..2dae7aa 100644 --- a/src/com/android/camera/ui/IndicatorWheel.java +++ b/src/com/android/camera/ui/IndicatorWheel.java @@ -88,6 +88,8 @@ public class IndicatorWheel extends ViewGroup { @Override public boolean onTouchEvent(MotionEvent event) { + if (!isEnabled()) return false; + int count = getChildCount(); if (mListener == null || count <= 1) return false; -- cgit v1.1