List of usage examples for android.view ViewGroup onTouchEvent
public boolean onTouchEvent(MotionEvent event)
From source file:com.parrot.cyclops.CameraView.java
@Override public boolean onTouchEvent(MotionEvent ev) { logdebug("onTouchEvent"); ViewParent parent = this.getParent(); if (parent != null) { ViewGroup vg = (ViewGroup) parent; return vg.onTouchEvent(ev); }//from w ww . jav a 2 s . c om return super.onTouchEvent(ev); }
From source file:com.grottworkshop.gwsswipelayout.SwipeLayout.java
/** * if the ViewGroup children want to handle this event. * @param v the v/*from w w w. j av a 2 s . co m*/ * @param event the event * @return v */ private View childNeedHandleTouchEvent(ViewGroup v, MotionEvent event) { if (v == null) return null; if (v.onTouchEvent(event)) return v; int childCount = v.getChildCount(); for (int i = childCount - 1; i >= 0; i--) { View child = v.getChildAt(i); if (child instanceof ViewGroup) { View grandChild = childNeedHandleTouchEvent((ViewGroup) child, event); if (grandChild != null) return grandChild; } else { if (childNeedHandleTouchEvent(v.getChildAt(i), event)) return v.getChildAt(i); } } return null; }