android.widget.HorizontalScrollView.onTouchEvent()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(140)

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

HorizontalScrollView.onTouchEvent介绍

暂无

代码示例

代码示例来源:origin: pili-engineering/PLDroidShortVideo

@Override
public boolean onTouchEvent(MotionEvent ev) {
  int action = ev.getAction();
  if (action == MotionEvent.ACTION_MOVE) {
    mIsTouching = true;
    mIsScrolling = true;
    mIsDragScroll = true;
  } else if (action == MotionEvent.ACTION_UP) {
    mIsTouching = false;
  }
  return super.onTouchEvent(ev);
}

代码示例来源:origin: weexteam/weex-hackernews

@Override
public boolean onTouchEvent(MotionEvent ev) {
 if(!scrollable) {
  return true; // when scrollable is set to false, then eat the touch event
 }
 boolean result = super.onTouchEvent(ev);
 if (wxGesture != null) {
  result |= wxGesture.onTouch(this, ev);
 }
 return result;
}

代码示例来源:origin: stripe/stripe-android

@Override
public boolean onTouchEvent(MotionEvent event) {
  if (event.getAction() != MotionEvent.ACTION_DOWN) {
    return super.onTouchEvent(event);
  }
  // We only pass the event to the base handler if mScrollable is true
  return mScrollable && super.onTouchEvent(event);
}

代码示例来源:origin: smuyyh/SprintNBA

@Override  
public boolean onTouchEvent(MotionEvent ev) {  
  if (ev == null) {  
    return super.onTouchEvent(ev);  
  } else {  
    commOnTouchEvent(ev);  
  }  
  return super.onTouchEvent(ev);  
}

代码示例来源:origin: woxblom/DragListView

@Override
public boolean onTouchEvent(MotionEvent event) {
  boolean retValue = handleTouchEvent(event);
  return retValue || super.onTouchEvent(event);
}

代码示例来源:origin: andstatus/andstatus

@Override
public boolean onTouchEvent(MotionEvent event) {
  boolean retValue = handleTouchEvent(event);
  return retValue || super.onTouchEvent(event);
}

代码示例来源:origin: GeoODK/collect

@Override public boolean onTouchEvent(MotionEvent event)
 {
   boolean ret = super.onTouchEvent(event);
   ret = ret | sv.onTouchEvent(event);
   return ret;
}

代码示例来源:origin: FangWW/ComparisonCar

@Override
public boolean onTouchEvent(MotionEvent ev) {
  //记录当前触摸的HListViewScrollView
  if(null!=this.listener){
    listener.setCurrentTouchView(this);
  }
  return super.onTouchEvent(ev);
}

代码示例来源:origin: Wilm0r/giggity

@Override
public boolean onTouchEvent(MotionEvent event)
{
  super.onTouchEvent(event);
  /* Beware: One ugliness of passing on events like this is that normally a ScrollView will
    do transformation of the event coordinates which we're not doing here, mostly because
    things work well enough without doing that.
    For events that we pass through to the child view, transformation *will* happen (because
    we're completely ignoring those and let the (H)ScrollView do the transformation for us).
   */
  vscroll.onTouchEventInt(event);
  return true;
}

代码示例来源:origin: JackWHLiu/jackknife

@Override
  public boolean onTouchEvent(MotionEvent ev) {
    switch (ev.getAction()) {
      case MotionEvent.ACTION_DOWN:
        mDownX = ev.getX();
        break;
      case MotionEvent.ACTION_UP:
        if (ev.getX() - mDownX > 0) {
          smoothScrollTo(0, 0);
        } else {
          smoothScrollTo(mMenuWidth, 0);
        }
        return true;
    }
    return super.onTouchEvent(ev);
  }
}

代码示例来源:origin: fengmaolian/AnalyzeRecyclerViewWithBGARefreshLayout

@Override
public boolean onTouchEvent(MotionEvent ev) {
  Log.i("TAG" , "18");
  int action = ev.getAction();
  switch (action) {
    case MotionEvent.ACTION_DOWN:
    case MotionEvent.ACTION_MOVE:
      Log.i("TAG" , "ACTION_MOVE  8");
      mIonSlidingButtonListener.onDownOrMove(this);
      break;
    case MotionEvent.ACTION_UP:
    case MotionEvent.ACTION_CANCEL:
      Log.i("TAG" , "ACTION_CANCEL  10");
      changeScrollx();
      return true;
    default:
      break;
  }
  return super.onTouchEvent(ev);
}
@Override

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

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

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

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

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

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

代码示例来源:origin: InnoFang/Android-Code-Demos

@Override
public boolean onTouchEvent(MotionEvent ev) {
  switch (ev.getAction()) {
    case MotionEvent.ACTION_DOWN:
      onCloseMenu();
      break;
    case MotionEvent.ACTION_UP:
      int scrollX = getScrollX();
      if (Math.abs(scrollX) > mMenuWidth / 2) {
        this.smoothScrollTo(mMenuWidth, 0);
        onOpenMenu();
      } else {
        this.smoothScrollTo(0, 0);
      }
      return true;
  }
  return super.onTouchEvent(ev);
}

代码示例来源:origin: Simon-Leeeeeeeee/SLWidget

@Override
@SuppressLint("ClickableViewAccessibility")
public boolean onTouchEvent(MotionEvent ev) {
  boolean expend = super.onTouchEvent(ev);
  if (getChildCount() != 1) {
    return expend;

代码示例来源:origin: yhaolpz/SlidingMenu

return super.onTouchEvent(ev);

代码示例来源:origin: yhaolpz/SlideAdapter

return super.onTouchEvent(ev);

相关文章

HorizontalScrollView类方法