当前位置: 首页>>代码示例>>Java>>正文


Java ViewConfiguration.getScaledOverflingDistance方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:rexyren,项目名称:PageScrollView,代码行数:23,代码来源:PageScrollView.java

示例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);
}
 
开发者ID:junchenChow,项目名称:exciting-app,代码行数:17,代码来源:AbsHListView.java

示例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);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:15,代码来源:AbsHListView.java

示例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);

}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:FreeFlowContainer.java


注:本文中的android.view.ViewConfiguration.getScaledOverflingDistance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。