FileDocCategorySizeDatePackage
PlatformVelocityTracker.javaAPI DocAndroid 5.1 API2033Thu Mar 12 22:22:42 GMT 2015com.android.systemui.statusbar.phone

PlatformVelocityTracker

public class PlatformVelocityTracker extends Object implements VelocityTrackerInterface
An implementation of {@link VelocityTrackerInterface} using the platform-standard {@link VelocityTracker}.

Fields Summary
private static final Pools.SynchronizedPool
sPool
private android.view.VelocityTracker
mTracker
Constructors Summary
Methods Summary
public voidaddMovement(android.view.MotionEvent event)

        mTracker.addMovement(event);
    
public voidcomputeCurrentVelocity(int units)

        mTracker.computeCurrentVelocity(units);
    
public floatgetXVelocity()

        return mTracker.getXVelocity();
    
public floatgetYVelocity()

        return mTracker.getYVelocity();
    
public static com.android.systemui.statusbar.phone.PlatformVelocityTrackerobtain()


        
        PlatformVelocityTracker tracker = sPool.acquire();
        if (tracker == null) {
            tracker = new PlatformVelocityTracker();
        }
        tracker.setTracker(VelocityTracker.obtain());
        return tracker;
    
public voidrecycle()

        mTracker.recycle();
        sPool.release(this);
    
public voidsetTracker(android.view.VelocityTracker tracker)

        mTracker = tracker;