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


Java GestureDetector.setIsLongpressEnabled方法代码示例

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


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

示例1: initData

import android.view.GestureDetector; //导入方法依赖的package包/类
/**
 * Initializes class data
 * 
 * @param context
 *            the context
 */
private void initData(Context context) {
	gestureDetector = new GestureDetector(context, gestureListener);
	gestureDetector.setIsLongpressEnabled(false);

	scroller = new Scroller(context);
	mScale = getContext().getResources().getDisplayMetrics().density;
	TEXT_SIZE *= mScale;
}
 
开发者ID:ebridfighter,项目名称:GongXianSheng,代码行数:15,代码来源:WheelView.java

示例2: initData

import android.view.GestureDetector; //导入方法依赖的package包/类
/**
 * Initializes class data
 * 
 * @param context
 *            the context
 */
private void initData(Context context) {
	gestureDetector = new GestureDetector(context, gestureListener);
	gestureDetector.setIsLongpressEnabled(false);

	LABEL_OFFSET = DensityUtil.dip2px(context, LABEL_OFFSET_DIP);
	
	scroller = new Scroller(context);
}
 
开发者ID:xiaoshanlin000,项目名称:SLTableView,代码行数:15,代码来源:WheelView.java

示例3: WheelScroller

import android.view.GestureDetector; //导入方法依赖的package包/类
/**
 * Constructor
 * @param context the current context
 * @param listener the scrolling listener
 */
public WheelScroller(Context context, ScrollingListener listener) {
    gestureDetector = new GestureDetector(context, gestureListener);
    gestureDetector.setIsLongpressEnabled(false);

    scroller = new Scroller(context, new LinearInterpolator());

    this.listener = listener;
    this.context = context;
}
 
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:15,代码来源:WheelScroller.java

示例4: initLoopView

import android.view.GestureDetector; //导入方法依赖的package包/类
private void initLoopView(Context context) {
    this.context = context;
    handler = new MessageHandler(this);
    gestureDetector = new GestureDetector(context, new LoopViewGestureListener(this));
    gestureDetector.setIsLongpressEnabled(false);

    isLoop = true;

    totalScrollY = 0;
    initPosition = -1;

    initPaints();

}
 
开发者ID:wmuqing,项目名称:timePicker,代码行数:15,代码来源:WheelView.java

示例5: initData

import android.view.GestureDetector; //导入方法依赖的package包/类
/**
 * Initializes class data
 * 
 * @param context
 *            the context
 */
private void initData(Context context) {
	gestureDetector = new GestureDetector(context, gestureListener);
	gestureDetector.setIsLongpressEnabled(false);

	scroller = new Scroller(context);
}
 
开发者ID:yellowhai,项目名称:TimeSelector,代码行数:13,代码来源:WheelView.java

示例6: DragSortController

import android.view.GestureDetector; //导入方法依赖的package包/类
/**
 * By default, sorting is enabled, and removal is disabled.
 *
 * @param dslv The DSLV instance
 * @param dragHandleId The resource id of the View that represents
 * the drag handle in a list item.
 */
public DragSortController(DragSortListView dslv, int dragHandleId, int dragInitMode,
        int removeMode, int clickRemoveId, int flingHandleId) {
    super(dslv);
    mDslv = dslv;
    mDetector = new GestureDetector(dslv.getContext(), this);
    mFlingRemoveDetector = new GestureDetector(dslv.getContext(), mFlingRemoveListener);
    mFlingRemoveDetector.setIsLongpressEnabled(false);
    mTouchSlop = ViewConfiguration.get(dslv.getContext()).getScaledTouchSlop();
    mDragHandleId = dragHandleId;
    mClickRemoveId = clickRemoveId;
    mFlingHandleId = flingHandleId;
    setRemoveMode(removeMode);
    setDragInitMode(dragInitMode);
}
 
开发者ID:ultrasonic,项目名称:ultrasonic,代码行数:22,代码来源:DragSortController.java

示例7: initAssistantField

import android.view.GestureDetector; //导入方法依赖的package包/类
/**
 * 初始化 辅助字段
 */
private void initAssistantField() {
    mAppContext = getContext().getApplicationContext();

    // 获取屏幕宽高
    DisplayMetrics dm = getResources().getDisplayMetrics();
    screenWidth = dm.widthPixels;
    screenHeight = dm.heightPixels;
    Log.i(TAG, "initAssistantField: " + "screenWidth = " + screenWidth + ", screenHeight = " + screenHeight);

    // 创建手势识别器
    mGestureDetector = new GestureDetector(getContext(), this);
    mGestureDetector.setIsLongpressEnabled(true);
    mGestureDetector.setOnDoubleTapListener(this);
}
 
开发者ID:SethWen,项目名称:GestureVideoView,代码行数:18,代码来源:GestureVideoView.java

示例8: init

import android.view.GestureDetector; //导入方法依赖的package包/类
protected void init(Context context) {
       setLayoutParams(new LinearLayout.LayoutParams(
               ViewGroup.LayoutParams.MATCH_PARENT,
               ViewGroup.LayoutParams.MATCH_PARENT));
       setLayerType(View.LAYER_TYPE_SOFTWARE, null);
       setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_IME_MULTI_LINE
               | InputType.TYPE_TEXT_FLAG_MULTI_LINE);
       mGestureDetector = new GestureDetector(getContext(), this);
       mGestureDetector.setIsLongpressEnabled(true);
       mScroller = new Scroller(getContext(), null, false);
       mWindowManager = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);
       mRotation = mWindowManager.getDefaultDisplay().getRotation();
       mDrawingRect = new Rect();
       mLineBounds = new Rect();
       mScrollMax = new Point();
       mPaintNumbers = new Paint();
       mPaintNumbers.setAntiAlias(true);
       mPaintNumbers.setDither(false);
       mPaintHighlight = new Paint();
mPaintHighlight.setStyle(Style.FILL);
       mPadding = (int) (6.0f * context.getResources().getDisplayMetrics().density);
       mScrollDirection = 0;
       setHorizontallyScrolling(true);
       addTextChangedListener(new EditTextChangeListener());
       mUndoRedoHelper = new UndoRedoHelper(this);
       mUndoRedoHelper.setMaxHistorySize(MAX_HISTORY_SIZE);
       setOnKeyListener(this);
       postInvalidate();
       refreshDrawableState();
       invalidateCharHeight();
   }
 
开发者ID:Light-Team,项目名称:ModPE-IDE-Source,代码行数:32,代码来源:LModEditor.java

示例9: initData

import android.view.GestureDetector; //导入方法依赖的package包/类
/**
 * Initializes class data
 *
 * @param context the mContext
 */
private void initData(Context context) {
    mContext = context;
    gestureDetector = new GestureDetector(context, gestureListener);
    gestureDetector.setIsLongpressEnabled(false);

    scroller = new Scroller(context);
    TEXT_SIZE = ToolUtils.dip2px(context, TEXT_SIZE);
    ITEM_OFFSET = ToolUtils.dip2px(context, ITEM_OFFSET);
}
 
开发者ID:devzwy,项目名称:KUtils,代码行数:15,代码来源:WheelView.java

示例10: WheelScroller

import android.view.GestureDetector; //导入方法依赖的package包/类
/**
 * Constructor
 * @param context the current context
 * @param listener the scrolling listener
 */
public WheelScroller(Context context, ScrollingListener listener) {
    gestureDetector = new GestureDetector(context, gestureListener);
    gestureDetector.setIsLongpressEnabled(false);
    
    scroller = new Scroller(context);

    this.listener = listener;
    this.context = context;
}
 
开发者ID:mangestudio,项目名称:GCSApp,代码行数:15,代码来源:WheelScroller.java

示例11: WheelScroller

import android.view.GestureDetector; //导入方法依赖的package包/类
/**
 * Constructor
 * 
 * @param context
 *            the current context
 * @param listener
 *            the scrolling listener
 */
public WheelScroller(Context context, ScrollingListener listener) {
	gestureDetector = new GestureDetector(context, gestureListener);
	gestureDetector.setIsLongpressEnabled(false);

	scroller = new Scroller(context);

	this.listener = listener;
	this.context = context;
}
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:18,代码来源:WheelScroller.java

示例12: DragSortController

import android.view.GestureDetector; //导入方法依赖的package包/类
/**
 * By default, sorting is enabled, and removal is disabled.
 *
 * @param dslv         The DSLV instance
 * @param dragHandleId The resource id of the View that represents
 *                     the drag handle in a list item.
 */
public DragSortController(DragSortListView dslv, int dragHandleId, int dragInitMode,
                          int removeMode, int clickRemoveId, int flingHandleId) {
    super(dslv);
    mDslv = dslv;
    mDetector = new GestureDetector(dslv.getContext(), this);
    mFlingRemoveDetector = new GestureDetector(dslv.getContext(), mFlingRemoveListener);
    mFlingRemoveDetector.setIsLongpressEnabled(false);
    mTouchSlop = ViewConfiguration.get(dslv.getContext()).getScaledTouchSlop();
    mDragHandleId = dragHandleId;
    mClickRemoveId = clickRemoveId;
    mFlingHandleId = flingHandleId;
    setRemoveMode(removeMode);
    setDragInitMode(dragInitMode);
}
 
开发者ID:bunnyblue,项目名称:NoticeDog,代码行数:22,代码来源:DragSortController.java

示例13: generateGestureDetector

import android.view.GestureDetector; //导入方法依赖的package包/类
@Override
public GestureDetector generateGestureDetector(Context context, IPlayer player, IPlayerControlView controlView) {
    GestureDetector gestureDetector = new GestureDetector(context.getApplicationContext(),
            new TestOnDefaultGestureListener(player, controlView));
    //解决长按屏幕后无法拖动的现象
    gestureDetector.setIsLongpressEnabled(false);
    return gestureDetector;
}
 
开发者ID:xinpianchang,项目名称:NSMPlayer-Android,代码行数:9,代码来源:TestOnGenerateGestureDetectorListener.java

示例14: EdgeSwipeEventFilter

import android.view.GestureDetector; //导入方法依赖的package包/类
/**
 * Creates a {@link EdgeSwipeEventFilter} captures event either in edge swipe gestures or
 * propagate them.
 * @param context          A {@link Context} instance.
 * @param host             The {@link EventFilterHost} where the event is coming from.
 * @param edgeSwipeHandler The {@link EdgeSwipeHandler} that is going to get notified.
 */
public EdgeSwipeEventFilter(
        Context context, EventFilterHost host, EdgeSwipeHandler edgeSwipeHandler) {
    super(context, host, false);
    mEnableTabSwiping = TAB_SWIPING_ENABLED;
    mScrollDirection = ScrollDirection.UNKNOWN;

    mSwipeTimeConstantPx = SWIPE_TIME_CONSTANT_DP / mPxToDp;

    mGestureDetector = new GestureDetector(context, new ViewScrollerGestureDetector());
    mGestureDetector.setIsLongpressEnabled(true);

    mEdgeSwipeHandler = edgeSwipeHandler;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:21,代码来源:EdgeSwipeEventFilter.java

示例15: initView

import android.view.GestureDetector; //导入方法依赖的package包/类
private void initView(Context context,AttributeSet attrs) {
    TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.LoopView);
    if (array != null) {
        mTopBottomTextColor = array.getColor(R.styleable.LoopView_topBottomTextColor, 0xffafafaf);
        mCenterTextColor = array.getColor(R.styleable.LoopView_centerTextColor, 0xff313131);
        mCenterLineColor = array.getColor(R.styleable.LoopView_lineColor, 0xffc5c5c5);
        mCanLoop = array.getBoolean(R.styleable.LoopView_canLoop, true);
        mInitPosition = array.getInt(R.styleable.LoopView_initPosition, -1);
        mTextSize = array.getDimensionPixelSize(R.styleable.LoopView_textSize, sp2px(context, 16));
        //mDrawItemsCount只能为奇数 才能正确显示
        mDrawItemsCount = array.getInt(R.styleable.LoopView_drawItemCount, 7);
        if(mDrawItemsCount % 2  == 0){
            if(mDrawItemsCount>=10){
                mDrawItemsCount -= 1;
            }else{
                mDrawItemsCount += 1;
            }
        }
        //确保绘制显示的item >= 1
        if(mDrawItemsCount<3){
            mDrawItemsCount = 3;
        }
        array.recycle();
    }

    lineSpacingMultiplier = 2.0F;//控制item高度

    this.mContext = context;
    mTextPaddingLeftRight = ConvertUtils.toDp(context,mTextPaddingLeftRight);
    mOnGestureListener = new LoopViewGestureListener();

    mCenterTopBottomTextPaint = new Paint();
    mTopBottomTextPaint = new Paint();
    mCenterTextPaint = new Paint();
    mCenterLinePaint = new Paint();

    if (Build.VERSION.SDK_INT >= 11) {
        setLayerType(LAYER_TYPE_SOFTWARE, null);
    }

    mGestureDetector = new GestureDetector(context, mOnGestureListener);
    mGestureDetector.setIsLongpressEnabled(false);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:44,代码来源:LoopView.java


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