File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -732,9 +732,6 @@ public boolean onTouchEvent(MotionEvent ev) {
732
732
int initialVelocity = (int ) VelocityTrackerCompat .getXVelocity (
733
733
velocityTracker , mActivePointerId );
734
734
final int scrollX = getScrollX ();
735
- // final int widthWithMargin = getWidth();
736
- // final float pageOffset = (float) (scrollX % widthWithMargin) / widthWithMargin;
737
- // TODO test this. should get better flinging behavior
738
735
final float pageOffset = (float ) (scrollX - getDestScrollX (mCurItem )) / getBehindWidth ();
739
736
final int activePointerIndex = getPointerIndex (ev , mActivePointerId );
740
737
if (mActivePointerId != INVALID_POINTER ) {
@@ -780,7 +777,7 @@ public boolean onTouchEvent(MotionEvent ev) {
780
777
private void determineDrag (MotionEvent ev ) {
781
778
final int activePointerId = mActivePointerId ;
782
779
final int pointerIndex = getPointerIndex (ev , activePointerId );
783
- if (activePointerId == INVALID_POINTER )
780
+ if (activePointerId == INVALID_POINTER || pointerIndex == INVALID_POINTER )
784
781
return ;
785
782
final float x = MotionEventCompat .getX (ev , pointerIndex );
786
783
final float dx = x - mLastMotionX ;
Original file line number Diff line number Diff line change 31
31
32
32
public class SlidingMenu extends RelativeLayout {
33
33
34
- private static final String TAG = getClass () .getSimpleName ();
34
+ private static final String TAG = SlidingMenu . class .getSimpleName ();
35
35
36
36
public static final int SLIDING_WINDOW = 0 ;
37
37
public static final int SLIDING_CONTENT = 1 ;
@@ -997,8 +997,6 @@ protected boolean fitSystemWindows(Rect insets) {
997
997
}
998
998
return true ;
999
999
}
1000
-
1001
- private Handler mHandler = new Handler ();
1002
1000
1003
1001
@ TargetApi (Build .VERSION_CODES .HONEYCOMB )
1004
1002
public void manageLayers (float percentOpen ) {
@@ -1008,7 +1006,7 @@ public void manageLayers(float percentOpen) {
1008
1006
final int layerType = layer ? View .LAYER_TYPE_HARDWARE : View .LAYER_TYPE_NONE ;
1009
1007
1010
1008
if (layerType != getContent ().getLayerType ()) {
1011
- mHandler .post (new Runnable () {
1009
+ getHandler () .post (new Runnable () {
1012
1010
public void run () {
1013
1011
Log .v (TAG , "changing layerType. hardware? " + (layerType == View .LAYER_TYPE_HARDWARE ));
1014
1012
getContent ().setLayerType (layerType , null );
You can’t perform that action at this time.
0 commit comments