當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。