Example usage for android.view ViewConfiguration getMinimumFlingVelocity

List of usage examples for android.view ViewConfiguration getMinimumFlingVelocity

Introduction

In this page you can find the example usage for android.view ViewConfiguration getMinimumFlingVelocity.

Prototype

@Deprecated
public static int getMinimumFlingVelocity() 

Source Link

Usage

From source file:Main.java

/**
 * initialize method, called inside the Chart.init() method.
 *
 * @param context/*from w  ww. j  a va2 s .  com*/
 */
@SuppressWarnings("deprecation")
public static void init(Context context) {

    if (context == null) {
        // noinspection deprecation
        mMinimumFlingVelocity = ViewConfiguration.getMinimumFlingVelocity();
        // noinspection deprecation
        mMaximumFlingVelocity = ViewConfiguration.getMaximumFlingVelocity();

        Log.e("MPChartLib-Utils", "Utils.init(...) PROVIDED CONTEXT OBJECT IS NULL");

    } else {
        ViewConfiguration viewConfiguration = ViewConfiguration.get(context);
        mMinimumFlingVelocity = viewConfiguration.getScaledMinimumFlingVelocity();
        mMaximumFlingVelocity = viewConfiguration.getScaledMaximumFlingVelocity();

        Resources res = context.getResources();
        mMetrics = res.getDisplayMetrics();
    }
}

From source file:Main.java

/**
 * initialize method, called inside the Chart.init() method. backwards
 * compatibility - to not break existing code
 *
 * @param res// w ww  .j a  va 2  s .  c  om
 */
@Deprecated
public static void init(Resources res) {

    mMetrics = res.getDisplayMetrics();

    // noinspection deprecation
    mMinimumFlingVelocity = ViewConfiguration.getMinimumFlingVelocity();
    // noinspection deprecation
    mMaximumFlingVelocity = ViewConfiguration.getMaximumFlingVelocity();
}