本文整理汇总了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);
}