From f52ba2c680eb1642ef6093a9211bd6e3e5837c9a Mon Sep 17 00:00:00 2001 From: Ivan Gavran Date: Thu, 28 Mar 2013 08:07:32 +0100 Subject: [PATCH] =?UTF-8?q?Minor=20fix=20for=20handling=20touch=20events?= =?UTF-8?q?=20on=20WheelView=20On=20some=20devices=20WheelView=20has=20bee?= =?UTF-8?q?n=20unresponsive=20and=20very=20hard=20to=20use.=20The=20proble?= =?UTF-8?q?m=20has=20been=20identified=20on=20Samsung=20S3=20Mini=20-=20th?= =?UTF-8?q?e=20wheel=20was=20unresponsive=20unless=20you=20have=20pressed?= =?UTF-8?q?=20wheel=20for=20a=20while=20and=20start=20scrolling=20after=20?= =?UTF-8?q?that.=20The=20problem=20was=20also=20reproducable=20on=20Samsun?= =?UTF-8?q?g=20S3=20but=20only=20if=20user=20scrolled=20the=20wheel=20very?= =?UTF-8?q?=20very=20fast=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After connecting both phones to ADB and quick investigation of LogCat I have found out that MotionEvent.ACTION_MOVE has never been processed by WheelView. The reason was that MotionEvent.ACTION_CANCELED has been received immediately after MotionEvent.ACTION_DOWN. So I updated onTouchEvent method to call getParent().requestDisallowInterceptTouchEvent(true) immediately after ACTION_DOWN event has been detected. --- wheel/src/kankan/wheel/widget/WheelView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wheel/src/kankan/wheel/widget/WheelView.java b/wheel/src/kankan/wheel/widget/WheelView.java index adc5fec..86ad33f 100644 --- a/wheel/src/kankan/wheel/widget/WheelView.java +++ b/wheel/src/kankan/wheel/widget/WheelView.java @@ -662,7 +662,7 @@ public boolean onTouchEvent(MotionEvent event) { } switch (event.getAction()) { - case MotionEvent.ACTION_MOVE: + case MotionEvent.ACTION_DOWN: if (getParent() != null) { getParent().requestDisallowInterceptTouchEvent(true); }