summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2014-05-02 20:05:58 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-02 20:05:58 +0000
commitf29d07cf8276b4cd5a51fb618ee2d2ecf1879c5a (patch)
tree31e7e84612dbf0d993720a238a249ca3c640f67d
parent900699756e9d1c8757f24d73b7e6d68c97c31ccf (diff)
parent9acfb48f6ee6fa44ccee3eb6d6ff5b2a10aac1a2 (diff)
downloadframeworks_base-f29d07cf8276b4cd5a51fb618ee2d2ecf1879c5a.zip
frameworks_base-f29d07cf8276b4cd5a51fb618ee2d2ecf1879c5a.tar.gz
frameworks_base-f29d07cf8276b4cd5a51fb618ee2d2ecf1879c5a.tar.bz2
am bf4ddbac: Merge "Filter touch events in ExpandableView."
* commit 'bf4ddbacc92f934193442dcf7c53f413533c3002': Filter touch events in ExpandableView.
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java
index 1664a32..33e9051 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java
@@ -23,6 +23,7 @@ import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.InsetDrawable;
import android.util.AttributeSet;
+import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;
@@ -49,6 +50,19 @@ public abstract class ExpandableView extends FrameLayout {
mActualHeightInitialized = true;
}
+ @Override
+ public boolean dispatchTouchEvent(MotionEvent ev) {
+ if (filterMotionEvent(ev)) {
+ return super.dispatchTouchEvent(ev);
+ }
+ return false;
+ }
+
+ private boolean filterMotionEvent(MotionEvent event) {
+ return event.getActionMasked() != MotionEvent.ACTION_DOWN
+ || event.getY() > mClipTopAmount && event.getY() < mActualHeight;
+ }
+
/**
* Sets the actual height of this notification. This is different than the laid out
* {@link View#getHeight()}, as we want to avoid layouting during scrolling and expanding.