diff options
author | Jorim Jaggi <jjaggi@google.com> | 2014-05-02 17:29:56 +0200 |
---|---|---|
committer | Jorim Jaggi <jjaggi@google.com> | 2014-05-02 17:29:56 +0200 |
commit | 00ebdfe8ba98c05a767660de2ed7c9a19fb49d74 (patch) | |
tree | 8b710b2d57d31fd7b956be0a26a325f4ea90c0fd /packages | |
parent | 59b5a356b828fe60ea2874b0680a1bf7c84809a1 (diff) | |
download | frameworks_base-00ebdfe8ba98c05a767660de2ed7c9a19fb49d74.zip frameworks_base-00ebdfe8ba98c05a767660de2ed7c9a19fb49d74.tar.gz frameworks_base-00ebdfe8ba98c05a767660de2ed7c9a19fb49d74.tar.bz2 |
Filter touch events in ExpandableView.
Because the actual height is the different as the laid out one, we
need to filter the touch events here.
Change-Id: I6abd3fb0fffe275c2b83e7c48df1dd866499a28c
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java | 14 |
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. |