当前位置: 首页>>代码示例>>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;未经允许,请勿转载。