當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。