下面列出了android.view.ViewConfiguration#getMaximumFlingVelocity ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* initialize method, called inside the Chart.init() method.
*
* @param context
*/
@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();
}
}
/**
* initialize method, called inside the Chart.init() method.
*
* @param context
*/
@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();
}
}
public PageView(Context context) {
super(context);
mCurPos = 0;
mAutoSwitchHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
if (MSG_AUTO_SWITCH == msg.what) {
autoSwitch();
}
}
};
mMaxVelocity = ViewConfiguration.getMaximumFlingVelocity();
}
/**
* initialize method, called inside the Chart.init() method.
*
* @param context
*/
@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();
}
}
/**
* initialize method, called inside the Chart.init() method.
*
* @param res
*/
@SuppressWarnings("deprecation")
public static void init(Context context) {
if (context == null) {
// noinspection deprecation
mMinimumFlingVelocity = ViewConfiguration.getMinimumFlingVelocity();
// noinspection deprecation
mMaximumFlingVelocity = ViewConfiguration.getMaximumFlingVelocity();
Log.e("MPAndroidChart, 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();
}
}
/**
* initialize method, called inside the Chart.init() method.
*
* @param context
*/
@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();
}
}
/**
* initialize method, called inside the Chart.init() method.
*
* @param context
*/
@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();
}
}
/**
* initialize method, called inside the Chart.init() method.
*
* @param context
*/
@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();
}
}
private void init(Context context) {
if (mListener == null) {
throw new NullPointerException("OnGestureListener must not be null");
}
mIsLongpressEnabled = true;
int touchSlop, doubleTapSlop, doubleTapTouchSlop;
if (context == null) {
touchSlop = ViewConfiguration.getTouchSlop();
doubleTapTouchSlop = touchSlop;
doubleTapSlop = 100;
mMinimumFlingVelocity = ViewConfiguration.getMinimumFlingVelocity();
mMaximumFlingVelocity = ViewConfiguration.getMaximumFlingVelocity();
} else {
final ViewConfiguration configuration = ViewConfiguration.get(context);
touchSlop = configuration.getScaledTouchSlop();
doubleTapTouchSlop = configuration.getScaledTouchSlop();
doubleTapSlop = configuration.getScaledDoubleTapSlop();
mMinimumFlingVelocity = configuration.getScaledMinimumFlingVelocity();
mMaximumFlingVelocity = configuration.getScaledMaximumFlingVelocity();
}
mTouchSlopSquare = touchSlop * touchSlop;
mDoubleTapTouchSlopSquare = doubleTapTouchSlop * doubleTapTouchSlop;
mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop;
}
private void init(Context context) {
if (mListener == null) {
throw new NullPointerException("OnGestureListener must not be null");
}
mIsLongpressEnabled = true;
int touchSlop, doubleTapSlop, doubleTapTouchSlop;
if (context == null) {
touchSlop = ViewConfiguration.getTouchSlop();
doubleTapTouchSlop = touchSlop;
doubleTapSlop = 100;
mMinimumFlingVelocity = ViewConfiguration.getMinimumFlingVelocity();
mMaximumFlingVelocity = ViewConfiguration.getMaximumFlingVelocity();
} else {
final ViewConfiguration configuration = ViewConfiguration.get(context);
touchSlop = configuration.getScaledTouchSlop();
doubleTapTouchSlop = configuration.getScaledTouchSlop();
doubleTapSlop = configuration.getScaledDoubleTapSlop();
mMinimumFlingVelocity = configuration.getScaledMinimumFlingVelocity();
mMaximumFlingVelocity = configuration.getScaledMaximumFlingVelocity();
}
mTouchSlopSquare = touchSlop * touchSlop;
mDoubleTapTouchSlopSquare = doubleTapTouchSlop * doubleTapTouchSlop;
mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop;
}
/**
* initialize method, called inside the Chart.init() method. backwards
* compatibility - to not break existing code
*
* @param res
*/
@Deprecated
public static void init(Resources res) {
mMetrics = res.getDisplayMetrics();
// noinspection deprecation
mMinimumFlingVelocity = ViewConfiguration.getMinimumFlingVelocity();
// noinspection deprecation
mMaximumFlingVelocity = ViewConfiguration.getMaximumFlingVelocity();
}
public GestureDetector(Context context, GestureHandler gestureHandler) {
this.gestureHandler = gestureHandler;
DisplayMetrics metrics = context.getResources().getDisplayMetrics();
pixelScaling = metrics.density;
minimumFlingVelocity = ViewConfiguration.getMinimumFlingVelocity();
maximumFlingVelocity = ViewConfiguration.getMaximumFlingVelocity();
}
/**
* initialize method, called inside the Chart.init() method. backwards
* compatibility - to not break existing code
*
* @param res
*/
@Deprecated
public static void init(Resources res) {
mMetrics = res.getDisplayMetrics();
// noinspection deprecation
mMinimumFlingVelocity = ViewConfiguration.getMinimumFlingVelocity();
// noinspection deprecation
mMaximumFlingVelocity = ViewConfiguration.getMaximumFlingVelocity();
}
/**
* initialize method, called inside the Chart.init() method. backwards
* compatibility - to not break existing code
*
* @param res
*/
@Deprecated
public static void init(Resources res) {
mMetrics = res.getDisplayMetrics();
// noinspection deprecation
mMinimumFlingVelocity = ViewConfiguration.getMinimumFlingVelocity();
// noinspection deprecation
mMaximumFlingVelocity = ViewConfiguration.getMaximumFlingVelocity();
}
/**
* initialize method, called inside the Chart.init() method. backwards
* compatibility - to not break existing code
*
* @param res
*/
@Deprecated
public static void init(Resources res) {
mMetrics = res.getDisplayMetrics();
// noinspection deprecation
mMinimumFlingVelocity = ViewConfiguration.getMinimumFlingVelocity();
// noinspection deprecation
mMaximumFlingVelocity = ViewConfiguration.getMaximumFlingVelocity();
}
/**
* initialize method, called inside the Chart.init() method. backwards
* compatibility - to not break existing code
*
* @param res
*/
@Deprecated
public static void init(Resources res) {
mMetrics = res.getDisplayMetrics();
// noinspection deprecation
mMinimumFlingVelocity = ViewConfiguration.getMinimumFlingVelocity();
// noinspection deprecation
mMaximumFlingVelocity = ViewConfiguration.getMaximumFlingVelocity();
}
/**
* initialize method, called inside the Chart.init() method. backwards
* compatibility - to not break existing code
*
* @param res
*/
@Deprecated
public static void init(Resources res) {
mMetrics = res.getDisplayMetrics();
// noinspection deprecation
mMinimumFlingVelocity = ViewConfiguration.getMinimumFlingVelocity();
// noinspection deprecation
mMaximumFlingVelocity = ViewConfiguration.getMaximumFlingVelocity();
}
/**
* initialize method, called inside the Chart.init() method. backwards
* compatibility - to not break existing code
*
* @param res
*/
@Deprecated
public static void init(Resources res) {
mMetrics = res.getDisplayMetrics();
// noinspection deprecation
mMinimumFlingVelocity = ViewConfiguration.getMinimumFlingVelocity();
// noinspection deprecation
mMaximumFlingVelocity = ViewConfiguration.getMaximumFlingVelocity();
}
public GestureDetector(Context context, GestureHandler gestureHandler) {
this.gestureHandler = gestureHandler;
DisplayMetrics metrics = context.getResources().getDisplayMetrics();
pixelScaling = metrics.density;
minimumFlingVelocity = ViewConfiguration.getMinimumFlingVelocity();
maximumFlingVelocity = ViewConfiguration.getMaximumFlingVelocity();
}
public SliderView(Context context) {
super(context);
mMaxVelocity = ViewConfiguration.getMaximumFlingVelocity();
}