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


Java ViewConfiguration.getPressedStateDuration方法代码示例

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


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

示例1: 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

示例2: 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

示例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.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


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