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

x33g5p2x  于2022-01-19 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(148)

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

GridView.onInterceptTouchEvent介绍

暂无

代码示例

代码示例来源:origin: ksoichiro/Android-ObservableScrollView

@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
  if (hasNoCallbacks()) {
    return super.onInterceptTouchEvent(ev);
  }
  switch (ev.getActionMasked()) {
    case MotionEvent.ACTION_DOWN:
      // Whether or not motion events are consumed by children,
      // flag initializations which are related to ACTION_DOWN events should be executed.
      // Because if the ACTION_DOWN is consumed by children and only ACTION_MOVEs are
      // passed to parent (this view), the flags will be invalid.
      // Also, applications might implement initialization codes to onDownMotionEvent,
      // so call it here.
      mFirstScroll = mDragging = true;
      dispatchOnDownMotionEvent();
      break;
  }
  return super.onInterceptTouchEvent(ev);
}

代码示例来源:origin: Solartisan/DragDropListView

@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
  if (ev.getAction() == MotionEvent.ACTION_DOWN) {
    mTouchDownForDragStartX = (int) ev.getX();
    mTouchDownForDragStartY = (int) ev.getY();
  }
  return super.onInterceptTouchEvent(ev);
}

代码示例来源:origin: geniusgithub/AndroidDialer

/**
 * TODO: This is all swipe to remove code (nothing to do with drag to remove). This should
 * be cleaned up and removed once drag to remove becomes the only way to remove contacts.
 */
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
  if (ev.getAction() == MotionEvent.ACTION_DOWN) {
    mTouchDownForDragStartX = (int) ev.getX();
    mTouchDownForDragStartY = (int) ev.getY();
  }
  return super.onInterceptTouchEvent(ev);
}

代码示例来源:origin: yuqirong/DragGridView

@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
  switch (ev.getAction()) {
    case MotionEvent.ACTION_DOWN:
      mWindowX = ev.getRawX();
      mWindowY = ev.getRawY();
      break;
    case MotionEvent.ACTION_MOVE:
      break;
    case MotionEvent.ACTION_UP:
      break;
  }
  return super.onInterceptTouchEvent(ev);
}

代码示例来源:origin: TUBB/SwipeMenu

@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
  boolean isIntercepted = super.onInterceptTouchEvent(ev);
  int action = ev.getActionMasked();
  switch (action) {
    case MotionEvent.ACTION_DOWN:
      isIntercepted = mHelper.handleListDownTouchEvent(ev, isIntercepted);
      break;
  }
  return isIntercepted;
}

代码示例来源:origin: whatshappen/TopGrid

@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
  if (ev.getAction() == MotionEvent.ACTION_DOWN) {
    downX = (int) ev.getX();
    downY = (int) ev.getY();
    windowX = (int) ev.getX();
    windowY = (int) ev.getY();
    setOnItemClickListener(ev);
  }
  return super.onInterceptTouchEvent(ev);
}

代码示例来源:origin: com.albedinsky.android/ui-widget-collection

/**
 */
@Override
public boolean onInterceptTouchEvent(@NonNull MotionEvent event) {
  this.ensureDecorator();
  return mDecorator.onInterceptTouchEvent(event) || super.onInterceptTouchEvent(event);
}

代码示例来源:origin: com.albedinsky.android/ui

/**
 */
@Override
public boolean onInterceptTouchEvent(@NonNull MotionEvent event) {
  this.ensureDecorator();
  return mDecorator.onInterceptTouchEvent(event) || super.onInterceptTouchEvent(event);
}

相关文章

GridView类方法