Search in sources :

Example 6 with ReflectionException

use of com.aviary.android.feather.library.utils.ReflectionUtils.ReflectionException in project mobile-android by photo.

the class HorizontalVariableListView method initView.

/**
	 * Inits the view.
	 */
private synchronized void initView() {
    if (Build.VERSION.SDK_INT > 8) {
        try {
            mFlingRunnable = (IFlingRunnable) ReflectionUtils.newInstance("com.aviary.android.feather.widget.Fling9Runnable", new Class<?>[] { FlingRunnableView.class, int.class }, this, mAnimationDuration);
        } catch (ReflectionException e) {
            mFlingRunnable = new Fling8Runnable(this, mAnimationDuration);
        }
    } else {
        mFlingRunnable = new Fling8Runnable(this, mAnimationDuration);
    }
    mLeftViewIndex = -1;
    mRightViewIndex = 0;
    mMaxX = Integer.MAX_VALUE;
    mMinX = 0;
    mChildHeight = 0;
    mRightEdge = 0;
    mLeftEdge = 0;
    mGesture = new GestureDetector(getContext(), mGestureListener);
    mGesture.setIsLongpressEnabled(false);
    setFocusable(true);
    setFocusableInTouchMode(true);
    ViewConfiguration configuration = ViewConfiguration.get(getContext());
    mTouchSlop = configuration.getScaledTouchSlop();
    mDragTolerance = mTouchSlop;
    mOverscrollDistance = 10;
    mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
    mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
}
Also used : ReflectionException(com.aviary.android.feather.library.utils.ReflectionUtils.ReflectionException) ViewConfiguration(android.view.ViewConfiguration) GestureDetector(android.view.GestureDetector)

Aggregations

ReflectionException (com.aviary.android.feather.library.utils.ReflectionUtils.ReflectionException)6 BlurMaskFilter (android.graphics.BlurMaskFilter)3 Matrix (android.graphics.Matrix)3 Paint (android.graphics.Paint)3 GestureDetector (android.view.GestureDetector)3 Context (android.content.Context)2 Resources (android.content.res.Resources)2 ViewConfiguration (android.view.ViewConfiguration)2 SuppressLint (android.annotation.SuppressLint)1 TypedArray (android.content.res.TypedArray)1 PaintFlagsDrawFilter (android.graphics.PaintFlagsDrawFilter)1 RectF (android.graphics.RectF)1 DisplayMetrics (android.util.DisplayMetrics)1 LinearGradientDrawable (com.aviary.android.feather.graphics.LinearGradientDrawable)1