本文整理匯總了Java中android.view.ViewConfiguration.getScaledOverflingDistance方法的典型用法代碼示例。如果您正苦於以下問題:Java ViewConfiguration.getScaledOverflingDistance方法的具體用法?Java ViewConfiguration.getScaledOverflingDistance怎麽用?Java ViewConfiguration.getScaledOverflingDistance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.view.ViewConfiguration
的用法示例。
在下文中一共展示了ViewConfiguration.getScaledOverflingDistance方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
import android.view.ViewConfiguration; //導入方法依賴的package包/類
private void init(Context context, AttributeSet attributeSet) {
final float density = context.getResources().getDisplayMetrics().density;
final ViewConfiguration configuration = ViewConfiguration.get(context);
mTouchSlop = configuration.getScaledTouchSlop();
mMinimumVelocity = (int) (350 * density);
mMinDistance = (int) (mTouchSlop * 1.2f);
mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
mOverFlingDistance = configuration.getScaledOverflingDistance() * 2;
setDescendantFocusability(FOCUS_AFTER_DESCENDANTS);
TypedArray attr = attributeSet == null ? null : context.obtainStyledAttributes(attributeSet, R.styleable.PageScrollView);
if (attr != null) {
mOrientation = attr.getInt(R.styleable.PageScrollView_android_orientation, mOrientation);
mMiddleMargin = attr.getDimensionPixelSize(R.styleable.PageScrollView_middleMargin, mMiddleMargin);
mSizeFixedPercent = attr.getFloat(R.styleable.PageScrollView_sizeFixedPercent, mSizeFixedPercent);
isViewPagerStyle = attr.getBoolean(R.styleable.PageScrollView_viewPagerStyle, isViewPagerStyle);
mFloatViewStart = attr.getInt(R.styleable.PageScrollView_floatViewStartIndex, mFloatViewStart);
mFloatViewEnd = attr.getInt(R.styleable.PageScrollView_floatViewEndIndex, mFloatViewEnd);
isChildCenter = attr.getBoolean(R.styleable.PageScrollView_childCenter, isChildCenter);
isChildFillParent = attr.getBoolean(R.styleable.PageScrollView_childFillParent, isChildFillParent);
mOverFlingDistance = attr.getDimensionPixelSize(R.styleable.PageScrollView_overFlingDistance, mOverFlingDistance);
}
}
示例2: initAbsListView
import android.view.ViewConfiguration; //導入方法依賴的package包/類
private void initAbsListView() {
setClickable(true);
setFocusableInTouchMode(true);
setWillNotDraw(false);
setAlwaysDrawnWithCacheEnabled(false);
setScrollingCacheEnabled(true);
final ViewConfiguration configuration = ViewConfiguration
.get(getContext());
mTouchSlop = configuration.getScaledTouchSlop();
mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
mOverscrollDistance = configuration.getScaledOverscrollDistance();
mOverflingDistance = configuration.getScaledOverflingDistance();
mViewHelper = ViewHelperFactory.create(this);
}
示例3: initAbsListView
import android.view.ViewConfiguration; //導入方法依賴的package包/類
private void initAbsListView() {
setClickable(true);
setFocusableInTouchMode(true);
setWillNotDraw(false);
setAlwaysDrawnWithCacheEnabled(false);
setScrollingCacheEnabled(true);
ViewConfiguration configuration = ViewConfiguration.get(getContext());
this.mTouchSlop = configuration.getScaledTouchSlop();
this.mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
this.mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
this.mOverscrollDistance = configuration.getScaledOverscrollDistance() + 200;
this.mOverflingDistance = configuration.getScaledOverflingDistance() + 100;
this.mViewHelper = ViewHelperFactory.create(this);
}
示例4: init
import android.view.ViewConfiguration; //導入方法依賴的package包/類
@Override
protected void init(Context context) {
viewpool = new ViewPool();
frames = new LinkedHashMap<Object, FreeFlowItem>();
ViewConfiguration configuration = ViewConfiguration.get(context);
maxFlingVelocity = configuration.getScaledMaximumFlingVelocity();
minFlingVelocity = configuration.getScaledMinimumFlingVelocity();
overflingDistance = configuration.getScaledOverflingDistance();
/*overscrollDistance = configuration.getScaledOverscrollDistance();*/
touchSlop = configuration.getScaledTouchSlop();
scroller = new OverScroller(context);
setEdgeEffectsEnabled(true);
}