Skip to content

Commit

Permalink
Fixed an NPE in continueSettling
Browse files Browse the repository at this point in the history
  • Loading branch information
tokudu committed Aug 27, 2014
1 parent d0565bd commit 3338d50
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions library/src/com/sothree/slidinguppanel/ViewDragHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

package com.sothree.slidinguppanel;

import java.util.Arrays;

import android.content.Context;
import android.support.v4.view.MotionEventCompat;
import android.support.v4.view.VelocityTrackerCompat;
Expand All @@ -31,6 +29,8 @@
import android.view.ViewGroup;
import android.view.animation.Interpolator;

import java.util.Arrays;

/**
* ViewDragHelper is a utility class for writing custom ViewGroups. It offers a number
* of useful operations and state tracking for allowing a user to drag and reposition
Expand Down Expand Up @@ -713,6 +713,10 @@ public void flingCapturedView(int minLeft, int minTop, int maxLeft, int maxTop)
* @return true if settle is still in progress
*/
public boolean continueSettling(boolean deferCallbacks) {
// Make sure, there is a captured view
if (mCapturedView == null) {
return false;
}
if (mDragState == STATE_SETTLING) {
boolean keepGoing = mScroller.computeScrollOffset();
final int x = mScroller.getCurrX();
Expand Down

0 comments on commit 3338d50

Please sign in to comment.