Skip to content
Browse files

Invalid pointer fix and getClass fix

  • Loading branch information...
1 parent e9721f7 commit d929476bee721e295f7e73d7395e29ca090c122b @jfeinstein10 committed Dec 9, 2013
View
5 library/src/com/jeremyfeinstein/slidingmenu/lib/CustomViewAbove.java
@@ -732,9 +732,6 @@ public boolean onTouchEvent(MotionEvent ev) {
int initialVelocity = (int) VelocityTrackerCompat.getXVelocity(
velocityTracker, mActivePointerId);
final int scrollX = getScrollX();
- // final int widthWithMargin = getWidth();
- // final float pageOffset = (float) (scrollX % widthWithMargin) / widthWithMargin;
- // TODO test this. should get better flinging behavior
final float pageOffset = (float) (scrollX - getDestScrollX(mCurItem)) / getBehindWidth();
final int activePointerIndex = getPointerIndex(ev, mActivePointerId);
if (mActivePointerId != INVALID_POINTER) {
@@ -780,7 +777,7 @@ public boolean onTouchEvent(MotionEvent ev) {
private void determineDrag(MotionEvent ev) {
final int activePointerId = mActivePointerId;
final int pointerIndex = getPointerIndex(ev, activePointerId);
- if (activePointerId == INVALID_POINTER)
+ if (activePointerId == INVALID_POINTER || pointerIndex == INVALID_POINTER)
return;
final float x = MotionEventCompat.getX(ev, pointerIndex);
final float dx = x - mLastMotionX;
View
6 library/src/com/jeremyfeinstein/slidingmenu/lib/SlidingMenu.java
@@ -31,7 +31,7 @@
public class SlidingMenu extends RelativeLayout {
- private static final String TAG = getClass().getSimpleName();
+ private static final String TAG = SlidingMenu.class.getSimpleName();
public static final int SLIDING_WINDOW = 0;
public static final int SLIDING_CONTENT = 1;
@@ -997,8 +997,6 @@ protected boolean fitSystemWindows(Rect insets) {
}
return true;
}
-
- private Handler mHandler = new Handler();
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public void manageLayers(float percentOpen) {
@@ -1008,7 +1006,7 @@ public void manageLayers(float percentOpen) {
final int layerType = layer ? View.LAYER_TYPE_HARDWARE : View.LAYER_TYPE_NONE;
if (layerType != getContent().getLayerType()) {
- mHandler.post(new Runnable() {
+ getHandler().post(new Runnable() {
public void run() {
Log.v(TAG, "changing layerType. hardware? " + (layerType == View.LAYER_TYPE_HARDWARE));
getContent().setLayerType(layerType, null);

0 comments on commit d929476

Please sign in to comment.
Something went wrong with that request. Please try again.