Search in sources :

Example 1 with OverScroller

use of com.android.launcher3.util.OverScroller in project Neo-Launcher by NeoApplications.

the class PagedView method init.

/**
 * Initializes various states for this workspace.
 */
protected void init() {
    mScroller = new OverScroller(getContext());
    setDefaultInterpolator(Interpolators.SCROLL);
    mCurrentPage = 0;
    final ViewConfiguration configuration = ViewConfiguration.get(getContext());
    mTouchSlop = configuration.getScaledPagingTouchSlop();
    mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
    float density = getResources().getDisplayMetrics().density;
    mFlingThresholdVelocity = (int) (FLING_THRESHOLD_VELOCITY * density);
    mMinFlingVelocity = (int) (MIN_FLING_VELOCITY * density);
    mMinSnapVelocity = (int) (MIN_SNAP_VELOCITY * density);
    if (Utilities.ATLEAST_OREO) {
        setDefaultFocusHighlightEnabled(false);
    }
}
Also used : ViewConfiguration(android.view.ViewConfiguration) OverScroller(com.android.launcher3.util.OverScroller)

Aggregations

ViewConfiguration (android.view.ViewConfiguration)1 OverScroller (com.android.launcher3.util.OverScroller)1