Example usage for android.view ViewConfiguration getMaximumFlingVelocity

List of usage examples for android.view ViewConfiguration getMaximumFlingVelocity

Introduction

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

Prototype

@Deprecated
public static int getMaximumFlingVelocity() 

Source Link

Usage

From source file:Main.java

/**
 * initialize method, called inside the Chart.init() method.
 *
 * @param context/*from  w  ww .j  av  a  2  s  . co  m*/
 */
@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//from   w w  w .  ja 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();
}