summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChung-yih Wang <cywang@google.com>2011-11-07 15:54:37 +0800
committerChung-yih Wang <cywang@google.com>2011-11-07 16:44:25 +0800
commitef525b617650c1a6d5968e0ff5c539990705d67f (patch)
tree2614167224e2231de9e56b5a5a154ab0adae75db /src
parent781528e1c86aa16d72694510898325d65e32c35b (diff)
downloadLegacyCamera-ef525b617650c1a6d5968e0ff5c539990705d67f.zip
LegacyCamera-ef525b617650c1a6d5968e0ff5c539990705d67f.tar.gz
LegacyCamera-ef525b617650c1a6d5968e0ff5c539990705d67f.tar.bz2
Fix the unresposible close button.
bug:5575807 Change-Id: Ief2f51b363a5300989ae0fe7b047436b923a0386
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/ui/SecondLevelIndicatorControlBar.java12
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;