Obsolete
Status Update
Comments
an...@gmail.com <an...@gmail.com> #2
Oh, I forgot my expected behavior: the onTouchEvent() function should return false if the listener's appropriate onScale*() function returns false and if it is not a valid scaling (like taps, moves, etc.) event at all.
Actually the observed behavior is different from the usual onTouchEvent() behavior and that function's documentation suggests that it returns false sometimes.
Actually the observed behavior is different from the usual onTouchEvent() behavior and that function's documentation suggests that it returns false sometimes.
se...@gmail.com <se...@gmail.com> #3
[Comment deleted]
bb...@gmail.com <bb...@gmail.com> #4
i concur, very annyoing problem, it took me now 2 days to search for a bug in the implementation instead of in my code, BTW the IMHO the scaleGesture stuff should be inheristing from (simple) GestureDetector, since if i use multi-touch, it seems evident to me that i use single touch also.... the need to separate them and chain them (which in this case doesn't even work as advertised) is cumbersome.....
en...@google.com <en...@google.com>
ch...@sngular.com <ch...@sngular.com> #6
Great customer service uh!?
No info about why won't fix even when it's there on this days
Claps
No info about why won't fix even when it's there on this days
Claps
be...@gmail.com <be...@gmail.com> #7
Any workarounds to this?
Description
class MyScaleGestureListener implements ScaleGestureDetector.OnScaleGestureListener
{
@Override
public boolean onScale(ScaleGestureDetector detector)
{
// some irrelevant code
return false;
}
@Override
public boolean onScaleBegin(ScaleGestureDetector detector)
{
// more irrelevant code
return false;
}
@Override
public void onScaleEnd(ScaleGestureDetector detector)
{
}
}
I am skipping most of the custom View class because it s basically a View with a MyScaleGestureListener member. Here is the view's onTouchEvent():
@Override
public boolean onTouchEvent(MotionEvent event)
{
boolean result = mScaleGestureDetector.onTouchEvent(event);
// result is always true here, so I need another way to check for a detected scaling gesture
boolean isScaling = result = mScaleGestureDetector.isInProgress();
if (!isScaling)
{
// if no scaling is performed check for other gestures (fling, long tab, etc.)
result = mCommonGestureDetector.onTouchEvent(event);
}
// some irrelevant checks...
return result ? result : super.onTouchEvent(event);
}
As I mentioned in the comments, mScaleGestureDetector.onTouchEvent(event); always returns true. Irrelevant what is returned in the listener's onScale*() functions, it even returns true for non-scale MotionEvents like single taps or move actions.
This problem occurred on my Galaxy Tab (honeycomb/3.2) and on the emulator. I check the web and found other people having the same problem. Then I finally looked into the android 4.2.1 source file for the ScaleGestureDetector (here:
Cheers!
Anselm