use of android.widget.Scroller in project Android-SlidingUpPanel by zzhouj.
the class SlidingUpPanel method initSlidingUpPanel.
private void initSlidingUpPanel() {
setWillNotDraw(false);
setDescendantFocusability(FOCUS_AFTER_DESCENDANTS);
setFocusable(true);
final Context context = getContext();
final ViewConfiguration configuration = ViewConfiguration.get(context);
final float density = context.getResources().getDisplayMetrics().density;
mScroller = new Scroller(context, new BounceInterpolator());
mMinimumVelocity = (int) (MIN_FLING_VELOCITY * density);
mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
mFlingDistance = (int) (MIN_DISTANCE_FOR_FLING * density);
mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(configuration);
}
use of android.widget.Scroller in project ZXVerticalViewPager by zhaoxin1943.
the class VerticalViewPager method initViewPager.
void initViewPager() {
setWillNotDraw(false);
setDescendantFocusability(FOCUS_AFTER_DESCENDANTS);
setFocusable(true);
final Context context = getContext();
mScroller = new Scroller(context, sInterpolator);
final ViewConfiguration configuration = ViewConfiguration.get(context);
final float density = context.getResources().getDisplayMetrics().density;
mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(configuration);
mMinimumVelocity = (int) (MIN_FLING_VELOCITY * density);
mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
mTopEdge = new EdgeEffectCompat(context);
mBottomEdge = new EdgeEffectCompat(context);
mFlingDistance = (int) (MIN_DISTANCE_FOR_FLING * density);
mCloseEnough = (int) (CLOSE_ENOUGH * density);
mDefaultGutterSize = (int) (DEFAULT_GUTTER_SIZE * density);
ViewCompat.setAccessibilityDelegate(this, new MyAccessibilityDelegate());
if (ViewCompat.getImportantForAccessibility(this) == ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_AUTO) {
ViewCompat.setImportantForAccessibility(this, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES);
}
}
use of android.widget.Scroller in project ABPlayer by winkstu.
the class XListView method initWithContext.
protected void initWithContext(Context context) {
mScroller = new Scroller(context, new DecelerateInterpolator());
// XListView need the scroll event, and it will dispatch the event to
// user's listener (as a proxy).
super.setOnScrollListener(this);
// init header view
mHeaderView = new XListViewHeader(context);
mHeaderViewContent = (RelativeLayout) mHeaderView.findViewById(R.id.xlistview_header_content);
mHeaderTimeView = (TextView) mHeaderView.findViewById(R.id.xlistview_header_time);
addHeaderView(mHeaderView, null, false);
// init footer view
mFooterView = new XListViewFooter(context);
// init header height
mHeaderView.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
mHeaderViewHeight = mHeaderViewContent.getHeight();
System.out.println("GetmHeadViewHeight = " + mHeaderViewHeight);
getViewTreeObserver().removeGlobalOnLayoutListener(this);
}
});
// 琛ュ厖淇敼
disablePullLoad();
disablePullRefreash();
}
use of android.widget.Scroller in project MagicCamera by wuhaoyu1990.
the class TwoLineSeekBar method init.
private void init() {
mScroller = new Scroller(getContext());
mGestureListener = new SeekBarGestureListener();
mGestureDetector = new GestureDetector(getContext(), mGestureListener);
mNailPaint = new Paint();
mNailPaint.setAntiAlias(true);
mNailPaint.setColor(Color.parseColor("#ffd600"));
mNailPaint.setStrokeWidth(mNailStrokeWidth);
mNailPaint.setStyle(Paint.Style.STROKE);
mThumbPaint = new Paint();
mThumbPaint.setAntiAlias(true);
mThumbPaint.setColor(Color.parseColor("#ffffff"));
mThumbPaint.setStyle(Paint.Style.FILL);
mLinePaint1 = new Paint();
mLinePaint1.setAntiAlias(true);
mLinePaint1.setColor(Color.parseColor("#ffffff"));
mLinePaint1.setAlpha(0xc8);
mLinePaint2 = new Paint();
mLinePaint2.setAntiAlias(true);
mLinePaint2.setColor(Color.parseColor("#ffffff"));
mLinePaint2.setAlpha(0xc8);
mHighLightLinePaint = new Paint();
mHighLightLinePaint.setAntiAlias(true);
mHighLightLinePaint.setColor(Color.parseColor("#ffd600"));
mHighLightLinePaint.setAlpha(0xc8);
mSupportSingleTap = true;
}
use of android.widget.Scroller in project UltimateAndroid by cymcsg.
the class ViewPager method initViewPager.
void initViewPager() {
setWillNotDraw(false);
setDescendantFocusability(FOCUS_AFTER_DESCENDANTS);
setFocusable(true);
final Context context = getContext();
mScroller = new Scroller(context, sInterpolator);
final ViewConfiguration configuration = ViewConfiguration.get(context);
final float density = context.getResources().getDisplayMetrics().density;
mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(configuration);
mMinimumVelocity = (int) (MIN_FLING_VELOCITY * density);
mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
mLeftEdge = new EdgeEffectCompat(context);
mRightEdge = new EdgeEffectCompat(context);
mFlingDistance = (int) (MIN_DISTANCE_FOR_FLING * density);
mCloseEnough = (int) (CLOSE_ENOUGH * density);
mDefaultGutterSize = (int) (DEFAULT_GUTTER_SIZE * density);
ViewCompat.setAccessibilityDelegate(this, new MyAccessibilityDelegate());
if (ViewCompat.getImportantForAccessibility(this) == ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_AUTO) {
ViewCompat.setImportantForAccessibility(this, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES);
}
}
Aggregations