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


Java ViewConfiguration.getTapTimeout方法代码示例

本文整理汇总了Java中android.view.ViewConfiguration.getTapTimeout方法的典型用法代码示例。如果您正苦于以下问题:Java ViewConfiguration.getTapTimeout方法的具体用法?Java ViewConfiguration.getTapTimeout怎么用?Java ViewConfiguration.getTapTimeout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.ViewConfiguration的用法示例。


在下文中一共展示了ViewConfiguration.getTapTimeout方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import android.view.ViewConfiguration; //导入方法依赖的package包/类
private void init(@NonNull Context context, @Nullable AttributeSet attrs, @AttrRes int defStyleAttr) {
    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.XGallery, defStyleAttr, 0);
    int itemWidth = a.getDimensionPixelOffset(R.styleable.XGallery_xGallery_itemWidth, LayoutParams.MATCH_PARENT);
    int itemHeight = a.getDimensionPixelOffset(R.styleable.XGallery_xGallery_itemHeight, LayoutParams.MATCH_PARENT);
    a.recycle();

    mViewPager = new ViewPager(context);
    mViewPager.setClipChildren(false);
    mViewPager.setOverScrollMode(OVER_SCROLL_NEVER);
    mViewPager.setHorizontalScrollBarEnabled(false);
    mViewPager.setOffscreenPageLimit(5);
    setPageTransformer(new BottomScalePageTransformer());

    LayoutParams params = new LayoutParams(itemWidth, itemHeight);
    params.gravity = Gravity.CENTER;
    addView(mViewPager, params);

    setClipChildren(false);
    setOnTouchListener(this);

    mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
    mTapTimeout = ViewConfiguration.getTapTimeout();
    mViewPagerWidth = itemWidth;
}
 
开发者ID:wuzhendev,项目名称:android-xgallery,代码行数:25,代码来源:XGallery.java

示例2: init

import android.view.ViewConfiguration; //导入方法依赖的package包/类
private void init(Context context, AttributeSet attrs)
{
    mAttrModel.parse(context, attrs);

    mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
    mClickTimeout = ViewConfiguration.getPressedStateDuration() + ViewConfiguration.getTapTimeout();

    initViewDragHelper();
    addDefaultViews();
    setDebug(mAttrModel.isDebug());
}
 
开发者ID:zj565061763,项目名称:switchbutton,代码行数:12,代码来源:FSwitchButton.java

示例3: initView

import android.view.ViewConfiguration; //导入方法依赖的package包/类
private void initView(Context context) {
    mPaint = new Paint();
    mPaint.setColor(Color.WHITE);
    Resources resources = context.getResources();

    // get viewConfiguration
    mClickTimeout = ViewConfiguration.getPressedStateDuration()
            + ViewConfiguration.getTapTimeout();
    mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();

    // get Bitmap
    mBottom = BitmapFactory.decodeResource(resources, R.drawable.bottom);
    mBtnPressed = BitmapFactory.decodeResource(resources, R.drawable.btn_pressed);
    mBtnNormal = BitmapFactory.decodeResource(resources, R.drawable.btn_unpressed);
    mFrame = BitmapFactory.decodeResource(resources, R.drawable.frame);
    mMask = BitmapFactory.decodeResource(resources, R.drawable.mask);
    mCurBtnPic = mBtnNormal;

    mBtnWidth = mBtnPressed.getWidth();
    mMaskWidth = mMask.getWidth();
    mMaskHeight = mMask.getHeight();

    mBtnOffPos = mBtnWidth / 2;
    mBtnOnPos = mMaskWidth - mBtnWidth / 2;

    mBtnPos = mChecked ? mBtnOnPos : mBtnOffPos;
    mRealPos = getRealPos(mBtnPos);

    final float density = getResources().getDisplayMetrics().density;
    mVelocity = (int) (VELOCITY * density + 0.5f);
    mExtendOffsetY = (int) (EXTENDED_OFFSET_Y * density + 0.5f);

    mSaveLayerRectF = new RectF(0, mExtendOffsetY, mMask.getWidth(), mMask.getHeight()
            + mExtendOffsetY);
    mXfermode = new PorterDuffXfermode(PorterDuff.Mode.SRC_IN);
}
 
开发者ID:mainh,项目名称:MainCalendar,代码行数:37,代码来源:SwitchButton.java

示例4: AppMenuDragHelper

import android.view.ViewConfiguration; //导入方法依赖的package包/类
AppMenuDragHelper(Activity activity, AppMenu appMenu, int itemRowHeight) {
    mActivity = activity;
    mAppMenu = appMenu;
    mItemRowHeight = itemRowHeight;
    Resources res = mActivity.getResources();
    mAutoScrollFullVelocity = res.getDimensionPixelSize(R.dimen.auto_scroll_full_velocity);
    // If user is dragging and the popup ListView is too big to display at once,
    // mDragScrolling animator scrolls mPopup.getListView() automatically depending on
    // the user's touch position.
    mDragScrolling.setTimeListener(new TimeAnimator.TimeListener() {
        @Override
        public void onTimeUpdate(TimeAnimator animation, long totalTime, long deltaTime) {
            ListPopupWindow popup = mAppMenu.getPopup();
            if (popup == null || popup.getListView() == null) return;

            // We keep both mDragScrollOffset and mDragScrollOffsetRounded because
            // the actual scrolling is by the rounded value but at the same time we also
            // want to keep the precise scroll value in float.
            mDragScrollOffset += (deltaTime * 0.001f) * mDragScrollingVelocity;
            int diff = Math.round(mDragScrollOffset - mDragScrollOffsetRounded);
            mDragScrollOffsetRounded += diff;
            popup.getListView().smoothScrollBy(diff, 0);

            // Force touch move event to highlight items correctly for the scrolled position.
            if (!Float.isNaN(mLastTouchX) && !Float.isNaN(mLastTouchY)) {
                menuItemAction(Math.round(mLastTouchX), Math.round(mLastTouchY),
                        ITEM_ACTION_HIGHLIGHT);
            }
        }
    });

    // We use medium timeout, the average of tap and long press timeouts. This is consistent
    // with ListPopupWindow#ForwardingListener implementation.
    mTapTimeout =
            (ViewConfiguration.getTapTimeout() + ViewConfiguration.getLongPressTimeout()) / 2;
    mScaledTouchSlop = ViewConfiguration.get(activity).getScaledTouchSlop();
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:38,代码来源:AppMenuDragHelper.java

示例5: RadialPickerLayout

import android.view.ViewConfiguration; //导入方法依赖的package包/类
public RadialPickerLayout(Context context, AttributeSet attrs) {
    super(context, attrs);
    setOnTouchListener(this);
    this.TOUCH_SLOP = ViewConfiguration.get(context).getScaledTouchSlop();
    this.TAP_TIMEOUT = ViewConfiguration.getTapTimeout();
    this.mDoingMove = false;
    this.mCircleView = new CircleView(context);
    addView(this.mCircleView);
    this.mAmPmCirclesView = new AmPmCirclesView(context);
    addView(this.mAmPmCirclesView);
    this.mHourRadialSelectorView = new RadialSelectorView(context);
    addView(this.mHourRadialSelectorView);
    this.mMinuteRadialSelectorView = new RadialSelectorView(context);
    addView(this.mMinuteRadialSelectorView);
    this.mHourRadialTextsView = new RadialTextsView(context);
    addView(this.mHourRadialTextsView);
    this.mMinuteRadialTextsView = new RadialTextsView(context);
    addView(this.mMinuteRadialTextsView);
    preparePrefer30sMap();
    this.mLastValueSelected = -1;
    this.mInputEnabled = true;
    this.mGrayBox = new View(context);
    this.mGrayBox.setLayoutParams(new LayoutParams(-1, -1));
    this.mGrayBox.setBackgroundColor(getResources().getColor(R.color.mdtp_transparent_black));
    this.mGrayBox.setVisibility(4);
    addView(this.mGrayBox);
    this.mAccessibilityManager = (AccessibilityManager) context.getSystemService
            ("accessibility");
    this.mTimeInitialized = false;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:31,代码来源:RadialPickerLayout.java

示例6: initView

import android.view.ViewConfiguration; //导入方法依赖的package包/类
private void initView(Context context) {
    mPaint = new Paint();
    mPaint.setColor(Color.WHITE);
    Resources resources = context.getResources();

    // get viewConfiguration
    mClickTimeout = ViewConfiguration.getPressedStateDuration()
            + ViewConfiguration.getTapTimeout();
    mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();

    // get Bitmap
    mBottom = BitmapFactory.decodeResource(resources, R.drawable.switchbg);
    mBtnPressed = BitmapFactory.decodeResource(resources, R.drawable.btn_pressed);
    mBtnNormal = BitmapFactory.decodeResource(resources, R.drawable.btn_unpressed);
    mFrame = BitmapFactory.decodeResource(resources, R.drawable.frame);
    mMask = BitmapFactory.decodeResource(resources, R.drawable.mask);
    mCurBtnPic = mBtnNormal;

    mBtnWidth = mBtnPressed.getWidth();
    mMaskWidth = mMask.getWidth();
    mMaskHeight = mMask.getHeight();

    mBtnOffPos = mBtnWidth / 2;
    mBtnOnPos = mMaskWidth - mBtnWidth / 2;

    mBtnPos = mChecked ? mBtnOnPos : mBtnOffPos;
    mRealPos = getRealPos(mBtnPos);

    final float density = getResources().getDisplayMetrics().density;
    mVelocity = (int) (VELOCITY * density + 0.5f);
    mExtendOffsetY = (int) (EXTENDED_OFFSET_Y * density + 0.5f);

    mSaveLayerRectF = new RectF(0, mExtendOffsetY, mMask.getWidth(), mMask.getHeight()
            + mExtendOffsetY);
    mXfermode = new PorterDuffXfermode(PorterDuff.Mode.SRC_IN);
}
 
开发者ID:dufangyu1990,项目名称:JKApp,代码行数:37,代码来源:SwitchButton.java

示例7: RadialPickerLayout

import android.view.ViewConfiguration; //导入方法依赖的package包/类
public RadialPickerLayout(Context context, AttributeSet attrs) {
    super(context, attrs);

    setOnTouchListener(this);
    ViewConfiguration vc = ViewConfiguration.get(context);
    TOUCH_SLOP = vc.getScaledTouchSlop();
    TAP_TIMEOUT = ViewConfiguration.getTapTimeout();
    mDoingMove = false;

    mCircleView = new CircleView(context);
    addView(mCircleView);

    mAmPmCirclesView = new AmPmCirclesView(context);
    addView(mAmPmCirclesView);

    mHourRadialTextsView = new RadialTextsView(context);
    addView(mHourRadialTextsView);
    mMinuteRadialTextsView = new RadialTextsView(context);
    addView(mMinuteRadialTextsView);

    mHourRadialSelectorView = new RadialSelectorView(context);
    addView(mHourRadialSelectorView);
    mMinuteRadialSelectorView = new RadialSelectorView(context);
    addView(mMinuteRadialSelectorView);

    // Prepare mapping to snap touchable degrees to selectable degrees.
    preparePrefer30sMap();

    mLastValueSelected = -1;

    mInputEnabled = true;
    mGrayBox = new View(context);
    mGrayBox.setLayoutParams(new ViewGroup.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    final ResourceLoader res = new ResourceLoader(context);
    mGrayBox.setBackgroundColor(res.getColor(R.color.transparent_black));
    mGrayBox.setVisibility(View.INVISIBLE);
    addView(mGrayBox);

    mAccessibilityManager = (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);

    mTimeInitialized = false;
}
 
开发者ID:ttpho,项目名称:TimePicker,代码行数:44,代码来源:RadialPickerLayout.java

示例8: RadialPickerLayout

import android.view.ViewConfiguration; //导入方法依赖的package包/类
public RadialPickerLayout(Context context, AttributeSet attrs) {
    super(context, attrs);

    setOnTouchListener(this);
    ViewConfiguration vc = ViewConfiguration.get(context);
    TOUCH_SLOP = vc.getScaledTouchSlop();
    TAP_TIMEOUT = ViewConfiguration.getTapTimeout();
    mDoingMove = false;

    mCircleView = new CircleView(context);
    addView(mCircleView);

    mAmPmCirclesView = new AmPmCirclesView(context);
    addView(mAmPmCirclesView);

    mHourRadialTextsView = new RadialTextsView(context);
    addView(mHourRadialTextsView);
    mMinuteRadialTextsView = new RadialTextsView(context);
    addView(mMinuteRadialTextsView);

    mHourRadialSelectorView = new RadialSelectorView(context);
    addView(mHourRadialSelectorView);
    mMinuteRadialSelectorView = new RadialSelectorView(context);
    addView(mMinuteRadialSelectorView);

    // Prepare mapping to snap touchable degrees to selectable degrees.
    preparePrefer30sMap();

    mVibrator = (Vibrator) context.getSystemService(Service.VIBRATOR_SERVICE);
    mLastVibrate = 0;
    mLastValueSelected = -1;

    mInputEnabled = true;
    mGrayBox = new View(context);
    mGrayBox.setLayoutParams(new ViewGroup.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    mGrayBox.setBackgroundColor(getResources().getColor(R.color.transparent_black));
    mGrayBox.setVisibility(View.INVISIBLE);
    addView(mGrayBox);

    mAccessibilityManager = (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);

    mTimeInitialized = false;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:45,代码来源:RadialPickerLayout.java

示例9: RadialPickerLayout

import android.view.ViewConfiguration; //导入方法依赖的package包/类
public RadialPickerLayout(Context context, AttributeSet attrs) {
    super(context, attrs);

    setOnTouchListener(this);
    ViewConfiguration vc = ViewConfiguration.get(context);
    TOUCH_SLOP = vc.getScaledTouchSlop();
    TAP_TIMEOUT = ViewConfiguration.getTapTimeout();
    mDoingMove = false;

    mCircleView = new CircleView(context);
    addView(mCircleView);

    mAmPmCirclesView = new AmPmCirclesView(context);
    addView(mAmPmCirclesView);

    mHourRadialSelectorView = new RadialSelectorView(context);
    addView(mHourRadialSelectorView);
    mMinuteRadialSelectorView = new RadialSelectorView(context);
    addView(mMinuteRadialSelectorView);
    mSecondRadialSelectorView = new RadialSelectorView(context);
    addView(mSecondRadialSelectorView);

    mHourRadialTextsView = new RadialTextsView(context);
    addView(mHourRadialTextsView);
    mMinuteRadialTextsView = new RadialTextsView(context);
    addView(mMinuteRadialTextsView);
    mSecondRadialTextsView = new RadialTextsView(context);
    addView(mSecondRadialTextsView);

    // Prepare mapping to snap touchable degrees to selectable degrees.
    preparePrefer30sMap();

    mLastValueSelected = null;

    mInputEnabled = true;

    mGrayBox = new View(context);
    mGrayBox.setLayoutParams(new ViewGroup.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    mGrayBox.setBackgroundColor(getResources().getColor( R.color.mdtp_transparent_black));
    mGrayBox.setVisibility(View.INVISIBLE);
    addView(mGrayBox);

    mAccessibilityManager = (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);

    mTimeInitialized = false;
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:48,代码来源:RadialPickerLayout.java

示例10: ForwardingListener

import android.view.ViewConfiguration; //导入方法依赖的package包/类
public ForwardingListener(View src) {
    this.mSrc = src;
    this.mScaledTouchSlop = (float) ViewConfiguration.get(src.getContext()).getScaledTouchSlop();
    this.mTapTimeout = ViewConfiguration.getTapTimeout();
    this.mLongPressTimeout = (this.mTapTimeout + ViewConfiguration.getLongPressTimeout()) / 2;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:7,代码来源:ListPopupWindow.java


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