本文整理汇总了Java中android.view.ViewConfiguration.getScaledMinimumFlingVelocity方法的典型用法代码示例。如果您正苦于以下问题:Java ViewConfiguration.getScaledMinimumFlingVelocity方法的具体用法?Java ViewConfiguration.getScaledMinimumFlingVelocity怎么用?Java ViewConfiguration.getScaledMinimumFlingVelocity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.ViewConfiguration
的用法示例。
在下文中一共展示了ViewConfiguration.getScaledMinimumFlingVelocity方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ViewDragHelper
import android.view.ViewConfiguration; //导入方法依赖的package包/类
/**
* Apps should use ViewDragHelper.create() to get a new instance.
* This will allow VDH to use internal compatibility implementations for different
* platform versions.
*
* @param context Context to initialize config-dependent params from
* @param forParent Parent view to monitor
*/
private ViewDragHelper(Context context, ViewGroup forParent, Callback cb) {
if (forParent == null) {
throw new IllegalArgumentException("Parent view may not be null");
}
if (cb == null) {
throw new IllegalArgumentException("Callback may not be null");
}
mParentView = forParent;
mCallback = cb;
final ViewConfiguration vc = ViewConfiguration.get(context);
final float density = context.getResources().getDisplayMetrics().density;
mEdgeSize = (int) (EDGE_SIZE * density + 0.5f);
mTouchSlop = vc.getScaledTouchSlop();
mMaxVelocity = vc.getScaledMaximumFlingVelocity();
mMinVelocity = vc.getScaledMinimumFlingVelocity();
mScroller = ScrollerCompat.create(context, sInterpolator);
}
示例2: init
import android.view.ViewConfiguration; //导入方法依赖的package包/类
private void init(Context context) {
if (context == null) {
throw new IllegalArgumentException("Context must not be null");
} else if (this.mListener == null) {
throw new IllegalArgumentException("OnGestureListener must not be null");
} else {
this.mIsLongpressEnabled = true;
ViewConfiguration configuration = ViewConfiguration.get(context);
int touchSlop = configuration.getScaledTouchSlop();
int doubleTapSlop = configuration.getScaledDoubleTapSlop();
this.mMinimumFlingVelocity = configuration.getScaledMinimumFlingVelocity();
this.mMaximumFlingVelocity = configuration.getScaledMaximumFlingVelocity();
this.mTouchSlopSquare = touchSlop * touchSlop;
this.mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop;
}
}
示例3: ViewDragHelper
import android.view.ViewConfiguration; //导入方法依赖的package包/类
private ViewDragHelper(Context context, ViewGroup forParent, Callback cb) {
if (forParent == null) {
throw new IllegalArgumentException("Parent view may not be null");
} else if (cb == null) {
throw new IllegalArgumentException("Callback may not be null");
} else {
this.mParentView = forParent;
this.mCallback = cb;
ViewConfiguration vc = ViewConfiguration.get(context);
this.mEdgeSize = (int) ((20.0f * context.getResources().getDisplayMetrics().density)
+ 0.5f);
this.mTouchSlop = vc.getScaledTouchSlop();
this.mMaxVelocity = (float) vc.getScaledMaximumFlingVelocity();
this.mMinVelocity = (float) vc.getScaledMinimumFlingVelocity();
this.mScroller = ScrollerCompat.create(context, sInterpolator);
}
}
示例4: ViewDragHelper
import android.view.ViewConfiguration; //导入方法依赖的package包/类
/**
* Apps should use ViewDragHelper.create() to get a new instance.
* This will allow VDH to use internal compatibility implementations for different
* platform versions.
*
* @param context Context to initialize config-dependent params from
* @param forParent Parent view to monitor
*/
private ViewDragHelper(Context context, ViewGroup forParent, Callback cb) {
if (forParent == null) {
throw new IllegalArgumentException("Parent view may not be null");
}
if (cb == null) {
throw new IllegalArgumentException("Callback may not be null");
}
mParentView = forParent;
mCallback = cb;
final ViewConfiguration vc = ViewConfiguration.get(context);
final float density = context.getResources().getDisplayMetrics().density;
mEdgeSize = (int) (EDGE_SIZE * density + 0.5f);
mTouchSlop = vc.getScaledTouchSlop();
mMaxVelocity = vc.getScaledMaximumFlingVelocity();
mMinVelocity = vc.getScaledMinimumFlingVelocity();
mScroller = ScrollerCompat.create(context, sInterpolator);
}
示例5: KDragViewHelper
import android.view.ViewConfiguration; //导入方法依赖的package包/类
/**
* Apps should use ViewDragHelper.create() to get a new instance.
* This will allow VDH to use internal compatibility implementations for different
* platform versions.
*
* @param context Context to initialize config-dependent params from
* @param forParent Parent view to monitor
*/
private KDragViewHelper(Context context, ViewGroup forParent, android.support.v4.widget.ViewDragHelper.Callback cb) {
if (forParent == null) {
throw new IllegalArgumentException("Parent view may not be null");
}
if (cb == null) {
throw new IllegalArgumentException("Callback may not be null");
}
mParentView = forParent;
mCallback = cb;
final ViewConfiguration vc = ViewConfiguration.get(context);
final float density = context.getResources().getDisplayMetrics().density;
mEdgeSize = (int) (EDGE_SIZE * density + 0.5f);
mTouchSlop = vc.getScaledTouchSlop();
mMaxVelocity = vc.getScaledMaximumFlingVelocity();
mMinVelocity = vc.getScaledMinimumFlingVelocity();
mScroller = ScrollerCompat.create(context, sInterpolator);
}
示例6: 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);
}
示例7: LargeImageView
import android.view.ViewConfiguration; //导入方法依赖的package包/类
public LargeImageView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
mScroller = ScrollerCompat.create(getContext(), null);
scaleHelper = new ScaleHelper();
setFocusable(true);
setWillNotDraw(false);
gestureDetector = new GestureDetector(context, simpleOnGestureListener);
scaleGestureDetector = new ScaleGestureDetector(context, onScaleGestureListener);
imageBlockLoader = new BlockImageLoader(context);
imageBlockLoader.setOnImageLoadListener(this);
final ViewConfiguration configuration = ViewConfiguration.get(getContext());
mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
}
示例8: RecyclerView
import android.view.ViewConfiguration; //导入方法依赖的package包/类
public RecyclerView(Context context, @Nullable AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
setScrollContainer(true);
setFocusableInTouchMode(true);
final int version = Build.VERSION.SDK_INT;
mPostUpdatesOnAnimation = version >= 16;
final ViewConfiguration vc = ViewConfiguration.get(context);
mTouchSlop = vc.getScaledTouchSlop();
mMinFlingVelocity = vc.getScaledMinimumFlingVelocity();
mMaxFlingVelocity = vc.getScaledMaximumFlingVelocity();
setWillNotDraw(ViewCompat.getOverScrollMode(this) == ViewCompat.OVER_SCROLL_NEVER);
mItemAnimator.setListener(mItemAnimatorListener);
initAdapterManager();
initChildrenHelper();
// If not explicitly specified this view is important for accessibility.
if (ViewCompat.getImportantForAccessibility(this)
== ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_AUTO) {
ViewCompat.setImportantForAccessibility(this,
ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES);
}
mAccessibilityManager = (AccessibilityManager) getContext()
.getSystemService(Context.ACCESSIBILITY_SERVICE);
setAccessibilityDelegateCompat(new RecyclerViewAccessibilityDelegate(this));
// Create the layoutManager if specified.
// Re-set whether nested scrolling is enabled so that it is set on all API levels
setNestedScrollingEnabled(true);
}
示例9: CupcakeGestureDetector
import android.view.ViewConfiguration; //导入方法依赖的package包/类
public CupcakeGestureDetector(Context context) {
ViewConfiguration configuration = ViewConfiguration.get(context);
this.mMinimumVelocity = (float) configuration.getScaledMinimumFlingVelocity();
this.mTouchSlop = (float) configuration.getScaledTouchSlop();
}
示例10: CupcakeDetector
import android.view.ViewConfiguration; //导入方法依赖的package包/类
public CupcakeDetector(Context context) {
final ViewConfiguration configuration = ViewConfiguration.get(context);
mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
mTouchSlop = configuration.getScaledTouchSlop();
}
示例11: CupcakeGestureDetector
import android.view.ViewConfiguration; //导入方法依赖的package包/类
public CupcakeGestureDetector(Context context) {
final ViewConfiguration configuration = ViewConfiguration.get(context);
mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
mTouchSlop = configuration.getScaledTouchSlop();
}
示例12: WheelPicker_New
import android.view.ViewConfiguration; //导入方法依赖的package包/类
public WheelPicker_New(Context context, AttributeSet attrs) {
super(context, attrs);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.WheelPicker);
int idData = a.getResourceId(R.styleable.WheelPicker_wheel_data, 0);
mData = Arrays.asList(getResources()
.getStringArray(idData == 0 ? R.array.WheelArrayDefault : idData));
mItemTextSize = a.getDimensionPixelSize(R.styleable.WheelPicker_wheel_item_text_size,
getResources().getDimensionPixelSize(R.dimen.WheelItemTextSize));
mVisibleItemCount = a.getInt(R.styleable.WheelPicker_wheel_visible_item_count, 7);
mSelectedItemPosition = a.getInt(R.styleable.WheelPicker_wheel_selected_item_position, 0);
hasSameWidth = a.getBoolean(R.styleable.WheelPicker_wheel_same_width, false);
mTextMaxWidthPosition =
a.getInt(R.styleable.WheelPicker_wheel_maximum_width_text_position, -1);
mMaxWidthText = a.getString(R.styleable.WheelPicker_wheel_maximum_width_text);
mSelectedItemTextColor = a.getColor
(R.styleable.WheelPicker_wheel_selected_item_text_color, -1);
mItemTextColor = a.getColor(R.styleable.WheelPicker_wheel_item_text_color, 0xFF888888);
mItemSpace = a.getDimensionPixelSize(R.styleable.WheelPicker_wheel_item_space,
getResources().getDimensionPixelSize(R.dimen.WheelItemSpace));
isCyclic = a.getBoolean(R.styleable.WheelPicker_wheel_cyclic, false);
hasIndicator = a.getBoolean(R.styleable.WheelPicker_wheel_indicator, false);
mIndicatorColor = a.getColor(R.styleable.WheelPicker_wheel_indicator_color, 0xFFEE3333);
mIndicatorSize = a.getDimensionPixelSize(R.styleable.WheelPicker_wheel_indicator_size,
getResources().getDimensionPixelSize(R.dimen.WheelIndicatorSize));
hasCurtain = a.getBoolean(R.styleable.WheelPicker_wheel_curtain, false);
mCurtainColor = a.getColor(R.styleable.WheelPicker_wheel_curtain_color, 0x88FFFFFF);
hasAtmospheric = a.getBoolean(R.styleable.WheelPicker_wheel_atmospheric, false);
isCurved = a.getBoolean(R.styleable.WheelPicker_wheel_curved, false);
mItemAlign = a.getInt(R.styleable.WheelPicker_wheel_item_align, ALIGN_CENTER);
a.recycle();
// 可见数据项改变后更新与之相关的参数
// Update relevant parameters when the count of visible item changed
updateVisibleItemCount();
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG | Paint.LINEAR_TEXT_FLAG);
mPaint.setTextSize(mItemTextSize);
// 更新文本对齐方式
// Update alignment of text
updateItemTextAlign();
// 计算文本尺寸
// Correct sizes of text
computeTextSize();
mScroller = new Scroller(getContext());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.DONUT) {
ViewConfiguration conf = ViewConfiguration.get(getContext());
mMinimumVelocity = conf.getScaledMinimumFlingVelocity();
mMaximumVelocity = conf.getScaledMaximumFlingVelocity();
mTouchSlop = conf.getScaledTouchSlop();
}
mRectDrawn = new Rect();
mRectIndicatorHead = new Rect();
mRectIndicatorFoot = new Rect();
mRectCurrentItem = new Rect();
mCamera = new Camera();
mMatrixRotate = new Matrix();
mMatrixDepth = new Matrix();
}
示例13: VerticalFlingDetector
import android.view.ViewConfiguration; //导入方法依赖的package包/类
public VerticalFlingDetector(Context context) {
ViewConfiguration vc = ViewConfiguration.get(context);
mMinimumFlingVelocity = vc.getScaledMinimumFlingVelocity();
mMaximumFlingVelocity = vc.getScaledMaximumFlingVelocity();
mCustomTouchSlop = CUSTOM_SLOP_MULTIPLIER * vc.getScaledTouchSlop();
}
示例14: initView
import android.view.ViewConfiguration; //导入方法依赖的package包/类
private void initView(Context context, AttributeSet attrs) {
setClipToPadding(false);
DensityUtil density = new DensityUtil();
ViewConfiguration configuration = ViewConfiguration.get(context);
mKernel = new RefreshKernelImpl();
mScroller = new Scroller(context);
mVelocityTracker = VelocityTracker.obtain();
mScreenHeightPixels = context.getResources().getDisplayMetrics().heightPixels;
mReboundInterpolator = new ViscousFluidInterpolator();
mTouchSlop = configuration.getScaledTouchSlop();
mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
mNestedScrollingParentHelper = new NestedScrollingParentHelper(this);
mNestedScrollingChildHelper = new NestedScrollingChildHelper(this);
TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.SmartRefreshLayout);
ViewCompat.setNestedScrollingEnabled(this, ta.getBoolean(R.styleable.SmartRefreshLayout_srlEnableNestedScrolling, false));
mDragRate = ta.getFloat(R.styleable.SmartRefreshLayout_srlDragRate, mDragRate);
mHeaderMaxDragRate = ta.getFloat(R.styleable.SmartRefreshLayout_srlHeaderMaxDragRate, mHeaderMaxDragRate);
mFooterMaxDragRate = ta.getFloat(R.styleable.SmartRefreshLayout_srlFooterMaxDragRate, mFooterMaxDragRate);
mHeaderTriggerRate = ta.getFloat(R.styleable.SmartRefreshLayout_srlHeaderTriggerRate, mHeaderTriggerRate);
mFooterTriggerRate = ta.getFloat(R.styleable.SmartRefreshLayout_srlFooterTriggerRate, mFooterTriggerRate);
mEnableRefresh = ta.getBoolean(R.styleable.SmartRefreshLayout_srlEnableRefresh, mEnableRefresh);
mReboundDuration = ta.getInt(R.styleable.SmartRefreshLayout_srlReboundDuration, mReboundDuration);
mEnableLoadmore = ta.getBoolean(R.styleable.SmartRefreshLayout_srlEnableLoadmore, mEnableLoadmore);
mHeaderHeight = ta.getDimensionPixelOffset(R.styleable.SmartRefreshLayout_srlHeaderHeight, density.dip2px(100));
mFooterHeight = ta.getDimensionPixelOffset(R.styleable.SmartRefreshLayout_srlFooterHeight, density.dip2px(60));
mDisableContentWhenRefresh = ta.getBoolean(R.styleable.SmartRefreshLayout_srlDisableContentWhenRefresh, mDisableContentWhenRefresh);
mDisableContentWhenLoading = ta.getBoolean(R.styleable.SmartRefreshLayout_srlDisableContentWhenLoading, mDisableContentWhenLoading);
mEnableHeaderTranslationContent = ta.getBoolean(R.styleable.SmartRefreshLayout_srlEnableHeaderTranslationContent, mEnableHeaderTranslationContent);
mEnableFooterTranslationContent = ta.getBoolean(R.styleable.SmartRefreshLayout_srlEnableFooterTranslationContent, mEnableFooterTranslationContent);
mEnablePreviewInEditMode = ta.getBoolean(R.styleable.SmartRefreshLayout_srlEnablePreviewInEditMode, mEnablePreviewInEditMode);
mEnableAutoLoadmore = ta.getBoolean(R.styleable.SmartRefreshLayout_srlEnableAutoLoadmore, mEnableAutoLoadmore);
mEnableOverScrollBounce = ta.getBoolean(R.styleable.SmartRefreshLayout_srlEnableOverScrollBounce, mEnableOverScrollBounce);
mEnablePureScrollMode = ta.getBoolean(R.styleable.SmartRefreshLayout_srlEnablePureScrollMode, mEnablePureScrollMode);
mEnableScrollContentWhenLoaded = ta.getBoolean(R.styleable.SmartRefreshLayout_srlEnableScrollContentWhenLoaded, mEnableScrollContentWhenLoaded);
mEnableLoadmoreWhenContentNotFull = ta.getBoolean(R.styleable.SmartRefreshLayout_srlEnableLoadmoreWhenContentNotFull, mEnableLoadmoreWhenContentNotFull);
mEnableFooterFollowWhenLoadFinished = ta.getBoolean(R.styleable.SmartRefreshLayout_srlEnableFooterFollowWhenLoadFinished, mEnableFooterFollowWhenLoadFinished);
mEnableOverScrollDrag = ta.getBoolean(R.styleable.SmartRefreshLayout_srlEnableOverScrollDrag, mEnableOverScrollDrag);
mFixedHeaderViewId = ta.getResourceId(R.styleable.SmartRefreshLayout_srlFixedHeaderViewId, View.NO_ID);
mFixedFooterViewId = ta.getResourceId(R.styleable.SmartRefreshLayout_srlFixedFooterViewId, View.NO_ID);
mManualLoadmore = ta.hasValue(R.styleable.SmartRefreshLayout_srlEnableLoadmore);
mManualNestedScrolling = ta.hasValue(R.styleable.SmartRefreshLayout_srlEnableNestedScrolling);
mHeaderHeightStatus = ta.hasValue(R.styleable.SmartRefreshLayout_srlHeaderHeight) ? DimensionStatus.XmlLayoutUnNotify : mHeaderHeightStatus;
mFooterHeightStatus = ta.hasValue(R.styleable.SmartRefreshLayout_srlFooterHeight) ? DimensionStatus.XmlLayoutUnNotify : mFooterHeightStatus;
mHeaderExtendHeight = (int) Math.max((mHeaderHeight * (mHeaderMaxDragRate - 1)), 0);
mFooterExtendHeight = (int) Math.max((mFooterHeight * (mFooterMaxDragRate - 1)), 0);
int accentColor = ta.getColor(R.styleable.SmartRefreshLayout_srlAccentColor, 0);
int primaryColor = ta.getColor(R.styleable.SmartRefreshLayout_srlPrimaryColor, 0);
if (primaryColor != 0) {
if (accentColor != 0) {
mPrimaryColors = new int[]{primaryColor, accentColor};
} else {
mPrimaryColors = new int[]{primaryColor};
}
}
ta.recycle();
}
示例15: AViewParams
import android.view.ViewConfiguration; //导入方法依赖的package包/类
public AViewParams(Context context) {
mContext = context;
final ViewConfiguration configuration = ViewConfiguration.get(mContext);
maxVelocity = configuration.getScaledMaximumFlingVelocity();
minVelocity = configuration.getScaledMinimumFlingVelocity();
}