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


Java ViewConfiguration.getScaledMinimumFlingVelocity方法代码示例

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

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

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

示例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);
}
 
开发者ID:eventtus,项目名称:photo-editor-android,代码行数:29,代码来源:ViewDragHelper.java

示例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);
}
 
开发者ID:Kaufland,项目名称:andswipeframework,代码行数:29,代码来源:KDragViewHelper.java

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

示例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();
}
 
开发者ID:jeasinlee,项目名称:AndroidBasicLibs,代码行数:16,代码来源:LargeImageView.java

示例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);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:31,代码来源:RecyclerView.java

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

示例10: CupcakeDetector

import android.view.ViewConfiguration; //导入方法依赖的package包/类
public CupcakeDetector(Context context) {
	final ViewConfiguration configuration = ViewConfiguration.get(context);
	mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
	mTouchSlop = configuration.getScaledTouchSlop();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:VersionedGestureDetector.java

示例11: CupcakeGestureDetector

import android.view.ViewConfiguration; //导入方法依赖的package包/类
public CupcakeGestureDetector(Context context) {
    final ViewConfiguration configuration = ViewConfiguration.get(context);
    mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
    mTouchSlop = configuration.getScaledTouchSlop();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:CupcakeGestureDetector.java

示例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();
}
 
开发者ID:yzzslow0,项目名称:Ec2m,代码行数:68,代码来源:WheelPicker_New.java

示例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();
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:7,代码来源:VerticalFlingDetector.java

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

}
 
开发者ID:penghuanliang,项目名称:Rxjava2.0Demo,代码行数:68,代码来源:SmartRefreshLayout.java

示例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();
}
 
开发者ID:anmingyu11,项目名称:OverScrollableRecyclerView-Method1,代码行数:7,代码来源:AViewParams.java


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