Skip to content

Commit

Permalink
Merge pull request #5241 from ayeung/timob-16204-3_2_X
Browse files Browse the repository at this point in the history
TIMOB-16204-3_2_X: Null check on gestureDetector when touch is not enabled.
  • Loading branch information
pingwang2011 committed Jan 21, 2014
2 parents 4d85b63 + 68ab81a commit 6f7e098
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
package ti.modules.titanium.ui.widget;

import java.util.HashMap;
import java.util.List;

import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollProxy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,14 @@ public boolean onTouchEvent(MotionEvent ev)
handled = proxy.fireEvent(TiC.EVENT_CLICK, dictFromEvent(ev));
}
}

boolean swipeHandled = detector.onTouchEvent(ev);


boolean swipeHandled = false;

// detect will be null when touch is disabled
if (detector != null) {
swipeHandled = detector.onTouchEvent(ev);
}

// Don't return here -- must call super.onTouchEvent()

boolean superHandled = super.onTouchEvent(ev);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
import org.appcelerator.titanium.view.TiUIView;

import android.app.Activity;
import android.graphics.Matrix;
import android.graphics.RectF;
import android.os.Build;
import android.os.Handler;
import android.os.Message;
Expand Down

0 comments on commit 6f7e098

Please sign in to comment.