diff options
author | Wei Huang <weih@google.com> | 2011-11-07 11:08:12 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-11-07 11:08:12 -0800 |
commit | 7cbd083b9491e488fb6190a54ad182efe6b923fe (patch) | |
tree | 276da0c8de5875a3d03b2129d2bf2dbcee497be0 /src | |
parent | 8a71639b8a106021327f9d03798e617609103d56 (diff) | |
parent | ef525b617650c1a6d5968e0ff5c539990705d67f (diff) | |
download | LegacyCamera-7cbd083b9491e488fb6190a54ad182efe6b923fe.zip LegacyCamera-7cbd083b9491e488fb6190a54ad182efe6b923fe.tar.gz LegacyCamera-7cbd083b9491e488fb6190a54ad182efe6b923fe.tar.bz2 |
Merge "Fix the unresposible close button." into ics-mr1
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/ui/SecondLevelIndicatorControlBar.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/com/android/camera/ui/SecondLevelIndicatorControlBar.java b/src/com/android/camera/ui/SecondLevelIndicatorControlBar.java index 1fb9a80..fbf1585 100644 --- a/src/com/android/camera/ui/SecondLevelIndicatorControlBar.java +++ b/src/com/android/camera/ui/SecondLevelIndicatorControlBar.java @@ -89,6 +89,12 @@ public class SecondLevelIndicatorControlBar extends IndicatorControl implements return (mNonIndicatorButtonCount + ((baselineX - x) / buttonRange)); } + private void dispatchRelativeTouchEvent(View view, MotionEvent event) { + event.offsetLocation(-view.getLeft(), -view.getTop()); + view.dispatchTouchEvent(event); + event.offsetLocation(view.getLeft(), view.getTop()); + } + @Override public boolean dispatchTouchEvent(MotionEvent event) { if (!onFilterTouchEventForSecurity(event)) return false; @@ -106,19 +112,19 @@ public class SecondLevelIndicatorControlBar extends IndicatorControl implements int index = getTouchViewIndex((int) x, width); if (index == -1) return true; View b = getChildAt(index); - b.dispatchTouchEvent(event); + dispatchRelativeTouchEvent(b, event); if ((mSelectedIndex != -1) && (index != mSelectedIndex)) { View v = getChildAt(mSelectedIndex); if (v instanceof AbstractIndicatorButton) { AbstractIndicatorButton c = (AbstractIndicatorButton) v; event.setAction(MotionEvent.ACTION_CANCEL); - c.dispatchTouchEvent(event); + dispatchRelativeTouchEvent(c, event); c.dismissPopup(); } if (action == MotionEvent.ACTION_MOVE) { event.setAction(MotionEvent.ACTION_DOWN); - b.dispatchTouchEvent(event); + dispatchRelativeTouchEvent(b, event); } } mSelectedIndex = index; |