本文整理了Java中android.support.v4.widget.NestedScrollView.dispatchTouchEvent()
方法的一些代码示例,展示了NestedScrollView.dispatchTouchEvent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NestedScrollView.dispatchTouchEvent()
方法的具体详情如下:
包路径:android.support.v4.widget.NestedScrollView
类名称:NestedScrollView
方法名:dispatchTouchEvent
暂无
代码示例来源:origin: Rukey7/MvpApp
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
return super.dispatchTouchEvent(ev);
}
代码示例来源:origin: JmStefanAndroid/EasyBehavior
public boolean dispatchTouchEvent(MotionEvent ev) {
getParent().requestDisallowInterceptTouchEvent(true);
return super.dispatchTouchEvent(ev);
}
代码示例来源:origin: whyalwaysmea/BigBoom
/**
* 触摸事件分发
* @param ev
* @return
*/
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
if(ev.getAction()==MotionEvent.ACTION_DOWN){
redirectTouchesToStickyView = true;
}
if(redirectTouchesToStickyView){
redirectTouchesToStickyView = currentlyStickingView != null;
if(redirectTouchesToStickyView){
redirectTouchesToStickyView =
ev.getY()<=(currentlyStickingView.getHeight()+stickyViewTopOffset) &&
ev.getX() >= getLeftForViewRelativeOnlyChild(currentlyStickingView) &&
ev.getX() <= getRightForViewRelativeOnlyChild(currentlyStickingView);
}
}else if(currentlyStickingView == null){
redirectTouchesToStickyView = false;
}
if(redirectTouchesToStickyView){
ev.offsetLocation(0, -1*((getScrollY() + stickyViewTopOffset) - getTopForViewRelativeOnlyChild(currentlyStickingView)));
}
return super.dispatchTouchEvent(ev);
}
代码示例来源:origin: wangxp423/ViewExercise
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
switch (ev.getAction()) {
case MotionEvent.ACTION_DOWN:
LogUtils.d("Test", "ACTION_DOWN");
// return true;
break;
case MotionEvent.ACTION_MOVE:
LogUtils.d("Test", "ACTION_MOVE");
break;
case MotionEvent.ACTION_UP:
LogUtils.d("Test", "ACTION_UP");
// return true;
break;
case MotionEvent.ACTION_CANCEL:
LogUtils.d("Test", "ACTION_CANCEL");
break;
default:
LogUtils.d("Test", "default");
break;
}
return super.dispatchTouchEvent(ev);
// return false;
// return true;
}
内容来源于网络,如有侵权,请联系作者删除!