當前位置: 首頁>>代碼示例>>Java>>正文


Java MotionEvent.ACTION_OUTSIDE屬性代碼示例

本文整理匯總了Java中android.view.MotionEvent.ACTION_OUTSIDE屬性的典型用法代碼示例。如果您正苦於以下問題:Java MotionEvent.ACTION_OUTSIDE屬性的具體用法?Java MotionEvent.ACTION_OUTSIDE怎麽用?Java MotionEvent.ACTION_OUTSIDE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.view.MotionEvent的用法示例。


在下文中一共展示了MotionEvent.ACTION_OUTSIDE屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onTouchEvent

@Override
public boolean onTouchEvent(MotionEvent event) {
	if(click){
		switch (event.getAction()) {
			case MotionEvent.ACTION_DOWN:
				onDown(event);
				break;
			case MotionEvent.ACTION_MOVE:
				onMove(event);
				break;
			case MotionEvent.ACTION_OUTSIDE:
				onOut(event);
			case MotionEvent.ACTION_UP:
				rect = null;
				onUp(event);
				break;
			default:
				onleave(event);
		}
		if(!clickLisner){
			return true;
		}
	}
	return super.onTouchEvent(event);
}
 
開發者ID:KishanV,項目名稱:Android-Music-Player,代碼行數:25,代碼來源:FMView.java

示例2: onTouchEvent

/**
 * Analyzes the given motion event and if applicable triggers the
 * appropriate callbacks on the {@link OnGestureListener} supplied.
 *
 * @param e The current motion event.
 * @return true if the {@link OnGestureListener} consumed the event,
 *              else false.
 */
public boolean onTouchEvent(@NonNull final MotionEvent e) {
    switch (e.getAction()) {
        case MotionEvent.ACTION_UP:
        case MotionEvent.ACTION_CANCEL:
        case MotionEvent.ACTION_OUTSIDE:
            mScrollInProgress = false;
            final boolean handled = mGestureDetector.onTouchEvent(e);
            mListener.onHidePress();
            if (!handled) {
                mListener.onUp(e);
            }
            return handled;

        default:
            return mGestureDetector.onTouchEvent(e);
    }
}
 
開發者ID:GlobusLTD,項目名稱:recyclerview-android,代碼行數:25,代碼來源:EnchancedGestureDetector.java

示例3: dispatchTouchEvent

public boolean dispatchTouchEvent(MotionEvent event) {

        switch (event.getAction()) {
            case MotionEvent.ACTION_DOWN:
                ONDown(event);
                break;
            case MotionEvent.ACTION_MOVE:
                 ONMove(event);
                break;
            case MotionEvent.ACTION_OUTSIDE:
                //onOut(event);
                break;
            case MotionEvent.ACTION_UP:
                ONUp(event);
                break;
            default:
                //onleave(event);
        }
        if(moved){
            return  false;
        }
        return super.dispatchTouchEvent(event);
    }
 
開發者ID:KishanV,項目名稱:Android-Music-Player,代碼行數:23,代碼來源:libraryHome.java

示例4: onTouch

@Override
@SuppressLint("ClickableViewAccessibility")
public boolean onTouch(final View view, final MotionEvent motionEvent) {
    switch (motionEvent.getAction()) {
        case MotionEvent.ACTION_DOWN:
            handler.removeCallbacks(handlerRunnable);
            handler.postAtTime(handlerRunnable, downView, SystemClock.uptimeMillis() + initialInterval);
            downView = view;
            downView.setPressed(true);
            clickListener.onClick(view);
            return true;
        case MotionEvent.ACTION_UP:
        case MotionEvent.ACTION_CANCEL:
        case MotionEvent.ACTION_OUTSIDE:
            handler.removeCallbacksAndMessages(downView);
            downView.setPressed(false);
            downView = null;
            return true;
        default:
            break;
    }

    return false;
}
 
開發者ID:apradanas,項目名稱:prismoji-android,代碼行數:24,代碼來源:RepeatListener.java

示例5: dispatchTouchEvent

@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
    if (mAutoPlayAble && !mIsOneImg) {
        switch (ev.getAction()) {
            case MotionEvent.ACTION_DOWN:
                stopAutoPlay();
                break;
            case MotionEvent.ACTION_UP:
            case MotionEvent.ACTION_CANCEL:
            case MotionEvent.ACTION_OUTSIDE:
                startAutoPlay();
                break;
        }
    }
    return super.dispatchTouchEvent(ev);
}
 
開發者ID:Jay-Ping,項目名稱:newIPlay,代碼行數:16,代碼來源:FlyBanner.java

示例6: onTouchEvent

@Override
public boolean onTouchEvent(@NotNull MotionEvent event) {
    int action = MotionEventCompat.getActionMasked(event);

    switch(action) {
        case (MotionEvent.ACTION_DOWN):
        case (MotionEvent.ACTION_MOVE):
        case (MotionEvent.ACTION_UP):
            int band = Math.max(0, Math.min(mSourcePathPoints.length - 1, (int)(mSourcePathPoints.length * event.getX() / getWidth())));
            float value = 30 * (getHeight() - event.getY()) / getHeight();
            if (listener != null)
                listener.OnBandUpdated(band, value);
            return true;
        case (MotionEvent.ACTION_CANCEL):
            return true;
        case (MotionEvent.ACTION_OUTSIDE):
            return true;
        default :
            return super.onTouchEvent(event);
    }
}
 
開發者ID:dmllr,項目名稱:IdealMedia,代碼行數:21,代碼來源:Wave.java

示例7: dispatchTouchEvent

@Override
public boolean dispatchTouchEvent(MotionEvent event) {
    // Check for clickable state and do nothing if disabled
    if (!this.isClickable()) {
        this.isSelected = false;
        return super.onTouchEvent(event);
    }

    // Set selected state based on Motion Event
    switch (event.getAction()) {
        case MotionEvent.ACTION_DOWN:
            this.isSelected = true;
            break;
        case MotionEvent.ACTION_UP:
        case MotionEvent.ACTION_SCROLL:
        case MotionEvent.ACTION_OUTSIDE:
        case MotionEvent.ACTION_CANCEL:
            this.isSelected = false;
            break;
    }

    // Redraw image and return super type
    this.invalidate();
    return super.dispatchTouchEvent(event);
}
 
開發者ID:TaRGroup,項目名稱:CoolApk-Console,代碼行數:25,代碼來源:BezelImageView.java

示例8: onTouchEvent

@Override
public boolean onTouchEvent(MotionEvent event) {
	switch (event.getAction()) {
	case MotionEvent.ACTION_DOWN:
		onDown(event);
	case MotionEvent.ACTION_MOVE:
		onMove(event);
		break;
	case MotionEvent.ACTION_OUTSIDE:
		onOut(event);
	case MotionEvent.ACTION_UP:
		onUp(event);
		break;
	default:
		onleave(event);
	}
	invalidate();
	super.onTouchEvent(event);
	return true;
}
 
開發者ID:KishanV,項目名稱:Android-Music-Player,代碼行數:20,代碼來源:abLyt.java

示例9: dispatchTouchEvent

@Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
//        Log.i(tag, ev.getAction() + "--" + isAutoPlay);
        if (isAutoPlay) {
            int action = ev.getAction();
            if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL
                    || action == MotionEvent.ACTION_OUTSIDE) {
                startAutoPlay();
            } else if (action == MotionEvent.ACTION_DOWN) {
                stopAutoPlay();
            }
        }
        return super.dispatchTouchEvent(ev);
    }
 
開發者ID:Mrqinlei,項目名稱:ImitateZHRB,代碼行數:14,代碼來源:Banner.java

示例10: dispatchTouchEvent

public boolean dispatchTouchEvent(MotionEvent event) {
	if(!canClick){
		return false;
	}
	switch (event.getAction()) {
		case MotionEvent.ACTION_DOWN:
			 onDown(event);
			break;
		case MotionEvent.ACTION_MOVE:
			if(!onMove(event)) {
				return  false;
			}
			break;
		case MotionEvent.ACTION_OUTSIDE:
			//onOut(event);
			break;
		case MotionEvent.ACTION_UP:
			onUp(event);
			if(MoveD){
				return  false;
			}
			break;
		default:
			//onleave(event);
	}
	return super.dispatchTouchEvent(event);
}
 
開發者ID:KishanV,項目名稱:Android-Music-Player,代碼行數:27,代碼來源:ContentHome.java

示例11: actionToString

public static String actionToString(int action) {
    switch (action) {

        case MotionEvent.ACTION_DOWN: return "Down";
        case MotionEvent.ACTION_MOVE: return "Move";
        case MotionEvent.ACTION_POINTER_DOWN: return "Pointer Down";
        case MotionEvent.ACTION_UP: return "Up";
        case MotionEvent.ACTION_POINTER_UP: return "Pointer Up";
        case MotionEvent.ACTION_OUTSIDE: return "Outside";
        case MotionEvent.ACTION_CANCEL: return "Cancel";
    }
    return "";
}
 
開發者ID:victordiaz,項目名稱:phonk,代碼行數:13,代碼來源:AndroidUtils.java

示例12: onTouchEvent

/**
 * @brief Captures onTouchEvent
 * @param event The event
 * @return true
 * @details Captures onTouchEvent. Sends the event to the gesture and scaleGesture objects
 */
@Override
public boolean onTouchEvent(MotionEvent event){

	super.onTouchEvent(event);
	
	scaleGesture.onTouchEvent(event);
	gesture.onTouchEvent(event);
	
	int action = MotionEventCompat.getActionMasked(event);

       switch (action) {
       
        //case (MotionEvent.ACTION_DOWN):
            
        //case (MotionEvent.ACTION_MOVE):
 
        case (MotionEvent.ACTION_UP):
        	return onUpMouse(event);

       case (MotionEvent.ACTION_CANCEL):
            Log.d(DEBUG_TAG, "La accion ha sido CANCEL");
            return true;
        case (MotionEvent.ACTION_OUTSIDE):
            Log.d(DEBUG_TAG,
                    "La accion ha sido fuera del elemento de la pantalla");
            return true;
        default:
            return true;
            
       }
}
 
開發者ID:CodyyAndroid,項目名稱:LibVNCAndroid,代碼行數:37,代碼來源:CanvasActivity.java

示例13: onTouchEvent

@Override
public boolean onTouchEvent(MotionEvent event) {
    if (MotionEvent.ACTION_OUTSIDE == event.getAction()) {
        setResultAndFinish(CredentialDeleteResult.USER_CANCELED);
        return true;
    }

    return super.onTouchEvent(event);
}
 
開發者ID:openid,項目名稱:OpenYOLO-Android,代碼行數:9,代碼來源:DeleteCredentialActivity.java

示例14: dispatchTouchEvent

@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
    if(isAutoLooper){
        int action = ev.getAction();
        if(action == MotionEvent.ACTION_UP
                || action == MotionEvent.ACTION_CANCEL
                || action == MotionEvent.ACTION_OUTSIDE){
            startAutoLooper();
        }else if(action == MotionEvent.ACTION_DOWN){
            stopAutoLooper();
        }
    }
    return super.dispatchTouchEvent(ev);
}
 
開發者ID:Militch,項目名稱:banner-holder,代碼行數:14,代碼來源:BannerHolderView.java

示例15: onTouch

@Override
public boolean onTouch(View view, MotionEvent motionEvent) {

    switch (motionEvent.getAction()) {
        case MotionEvent.ACTION_DOWN:

            // Set Touched view as the animatingView if not set
            if (animatingView == null) animatingView = view;

            isTouching = true;
            startSwipe(motionEvent);
            break;

        case MotionEvent.ACTION_MOVE:

            if (!isTouching) break;
            moveSwipe(motionEvent);
            break;

        case MotionEvent.ACTION_UP:
        case MotionEvent.ACTION_OUTSIDE:

            isTouching = false;
            isSwipingHorizontal = false;
            endSwipe();
            break;
    }

    return isSwipingHorizontal;
}
 
開發者ID:Codigami,項目名稱:CFAlertDialog,代碼行數:30,代碼來源:SwipeToHideViewListener.java


注:本文中的android.view.MotionEvent.ACTION_OUTSIDE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。