예제 #1
0
 private void init(Context context, AttributeSet attributeset, int i)
 {
     ViewConfiguration viewconfiguration = ViewConfiguration.get(context);
     mScaledDensity = context.getResources().getDisplayMetrics().density / 2.0F;
     attributeset = context.getTheme().obtainStyledAttributes(attributeset, com.aviary.android.feather.sdk.R.styleable.AviaryWheel, i, 0);
     mShadowBottom = attributeset.getDrawable(com.aviary.android.feather.sdk.R.styleable.AviaryWheel_aviaryWheelShadowTop);
     mLinesSingle = attributeset.getDrawable(com.aviary.android.feather.sdk.R.styleable.AviaryWheel_aviaryWheelLine);
     mLinesIndicator = attributeset.getDrawable(com.aviary.android.feather.sdk.R.styleable.AviaryWheel_aviaryWheelIndicator);
     mEdgeStyle = attributeset.getResourceId(com.aviary.android.feather.sdk.R.styleable.AviaryWheel_aviary_edgeStyle, 0);
     attributeset.recycle();
     mEdgeOffset = (float)(20D * (double)mScaledDensity);
     mLineWidth = mLinesSingle.getIntrinsicWidth();
     mLinesPaint = new Paint(7);
     if (!isInEditMode())
     {
         mGestureDetector = new GestureDetector(context, this);
         mGestureDetector.setIsLongpressEnabled(false);
     }
     mScroller = new ScrollerRunnable(this, 200, viewconfiguration.getScaledOverflingDistance(), null);
     mVibrationHelper = new VibrationHelper(context, true);
     mEdgeLeft = new AviaryEdgeEffect(getContext(), mEdgeStyle);
     mEdgeRight = new AviaryEdgeEffect(getContext(), mEdgeStyle);
     mEdgeLeft.setEdgeMaxAlpha(100);
     mEdgeRight.setEdgeMaxAlpha(100);
     mNextValue = -1;
     mCurrentValue = 0.0D;
 }
 @SuppressLint("NewApi")
 private void initScrollView() {
   mScroller = new OverScroller(getContext());
   setFocusable(true);
   setDescendantFocusability(FOCUS_AFTER_DESCENDANTS);
   setWillNotDraw(false);
   final ViewConfiguration configuration = ViewConfiguration.get(getContext());
   mTouchSlop = configuration.getScaledTouchSlop();
   mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
   mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
   mOverscrollDistance = configuration.getScaledOverscrollDistance();
   mOverflingDistance = configuration.getScaledOverflingDistance();
 }
  /** Inits the scroll view. */
  private void initScrollView() {

    mScroller = new OverScroller(getContext(), new DecelerateInterpolator());
    setFocusable(true);
    setDescendantFocusability(FOCUS_AFTER_DESCENDANTS);
    setWillNotDraw(false);
    final ViewConfiguration configuration = ViewConfiguration.get(getContext());
    mTouchSlop = configuration.getScaledTouchSlop();
    mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
    mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
    mOverscrollDistance = configuration.getScaledOverscrollDistance();
    mOverflingDistance = configuration.getScaledOverflingDistance();
    mScrollMarginTop = getResources().getDimensionPixelSize(R.dimen.gn_recent_info_zone_height);
  }
예제 #4
0
 public ViewScrollerHelper(Context context) {
   mScroller = new OverScroller(context);
   ViewConfiguration configuration = ViewConfiguration.get(context);
   mOverflingDistance = configuration.getScaledOverflingDistance();
 }