本文整理汇总了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);
}
示例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);
}
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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 "";
}
示例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;
}
}
示例13: onTouchEvent
@Override
public boolean onTouchEvent(MotionEvent event) {
if (MotionEvent.ACTION_OUTSIDE == event.getAction()) {
setResultAndFinish(CredentialDeleteResult.USER_CANCELED);
return true;
}
return super.onTouchEvent(event);
}
示例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);
}
示例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;
}