/** * 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. * * @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(); } }
assertEquals(16, ViewConfiguration.getTouchSlop()); assertEquals(16, ViewConfiguration.getWindowTouchSlop()); assertEquals(50, ViewConfiguration.getMinimumFlingVelocity()); assertEquals(4000, ViewConfiguration.getMaximumFlingVelocity()); assertEquals(320 * 480 * 4, ViewConfiguration.getMaximumDrawingCacheSize());
/** * 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. * * @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(); } }
/** * 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; // Fallback to support pre-donuts releases int touchSlop, doubleTapSlop, doubleTapTouchSlop; if (context == null) { //noinspection deprecation touchSlop = ViewConfiguration.getTouchSlop(); doubleTapTouchSlop = touchSlop; // Hack rather than adding a hiden method for this // doubleTapSlop = ViewConfiguration.getDoubleTapSlop(); //noinspection deprecation mMinimumFlingVelocity = ViewConfiguration.getMinimumFlingVelocity(); mMaximumFlingVelocity = ViewConfiguration.getMaximumFlingVelocity(); } else { final ViewConfiguration configuration = ViewConfiguration.get(context); touchSlop = configuration.getScaledTouchSlop(); // doubleTapTouchSlop = configuration.getScaledDoubleTapTouchSlop(); doubleTapSlop = configuration.getScaledDoubleTapSlop(); mMinimumFlingVelocity = configuration.getScaledMinimumFlingVelocity(); mMaximumFlingVelocity = configuration.getScaledMaximumFlingVelocity(); } mTouchSlopSquare = touchSlop * touchSlop; // mDoubleTapTouchSlopSquare = doubleTapTouchSlop * doubleTapTouchSlop; // mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop; }