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

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

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

NestedScrollView.onInterceptTouchEvent介绍

暂无

代码示例

代码示例来源:origin: Rukey7/MvpApp

@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
  return super.onInterceptTouchEvent(ev);
}

代码示例来源:origin: wzmyyj/ZYMK

@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
  // TODO Auto-generated method stub
  return super.onInterceptTouchEvent(ev);
}

代码示例来源:origin: WangDaYeeeeee/Waves

/** <br> parent methods. */

  @Override
  public boolean onInterceptTouchEvent(MotionEvent ev) {
    if (ev.getAction() == MotionEvent.ACTION_DOWN) {
      oldY = ev.getY();
    }
    return super.onInterceptTouchEvent(ev)
        || (ev.getAction() == MotionEvent.ACTION_MOVE && Math.abs(ev.getY() - oldY) > touchSlop);
  }
}

代码示例来源:origin: CodingBingo/FastReader

@Override
  public boolean onInterceptTouchEvent(MotionEvent ev) {
    switch (ev.getAction()){
      case MotionEvent.ACTION_DOWN:
        downY = (int) ev.getY();
        break;
      case MotionEvent.ACTION_MOVE:
        int moveY = (int) ev.getRawY();
        if (Math.abs(moveY - downY) > mTouchSlop) {
          return true;
        }
        break;
    }
    return super.onInterceptTouchEvent(ev);
  }
}

代码示例来源:origin: XiqingLiu/GEEK

@Override
  public boolean onInterceptTouchEvent(MotionEvent ev) {
    switch (ev.getAction()) {
      case MotionEvent.ACTION_DOWN:
        xDistance = yDistance = 0f;
        lastX = ev.getX();
        lastY = ev.getY();
        break;
      case MotionEvent.ACTION_MOVE:
        final float curX = ev.getX();
        final float curY = ev.getY();
        xDistance += Math.abs(curX - lastX);
        yDistance += Math.abs(curY - lastY);
        lastX = curX;
        lastY = curY;
        if (xDistance < yDistance)
          return false;
    }

    return super.onInterceptTouchEvent(ev);
  }
}

代码示例来源:origin: WangDaYeeeeee/GeometricWeather

@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
  boolean result = super.onInterceptTouchEvent(ev);
  switch (ev.getAction()) {
    case MotionEvent.ACTION_DOWN:

代码示例来源:origin: wangxp423/ViewExercise

@Override
  public boolean onInterceptTouchEvent(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");
        return true;
//                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.onInterceptTouchEvent(ev);
//        return false;
//        return true;
  }

相关文章