android.support.v4.widget.NestedScrollView.dispatchTouchEvent()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(160)

本文整理了Java中android.support.v4.widget.NestedScrollView.dispatchTouchEvent()方法的一些代码示例,展示了NestedScrollView.dispatchTouchEvent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NestedScrollView.dispatchTouchEvent()方法的具体详情如下:
包路径:android.support.v4.widget.NestedScrollView
类名称:NestedScrollView
方法名:dispatchTouchEvent

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;
  }

相关文章