android.view.MotionEvent.getEdgeFlags()方法的使用及代码示例

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

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

MotionEvent.getEdgeFlags介绍

暂无

代码示例

代码示例来源:origin: chentao0707/SimplifyReader

@Override
public boolean onTouchEvent(MotionEvent ev) {
  if (mItemsCanFocus && ev.getAction() == MotionEvent.ACTION_DOWN && ev.getEdgeFlags() != 0) {
    // Don't handle edge touches immediately -- they may actually belong to one of our
    // descendants.
    return false;
  }
  return super.onTouchEvent(ev);
}

代码示例来源:origin: TonicArtos/StickyGridHeaders

private MotionEvent transformEvent(MotionEvent e, int headerPosition) {
  if (headerPosition == MATCHED_STICKIED_HEADER) {
    return e;
  }
  long downTime = e.getDownTime();
  long eventTime = e.getEventTime();
  int action = e.getAction();
  int pointerCount = e.getPointerCount();
  int[] pointerIds = getPointerIds(e);
  MotionEvent.PointerCoords[] pointerCoords = getPointerCoords(e);
  int metaState = e.getMetaState();
  float xPrecision = e.getXPrecision();
  float yPrecision = e.getYPrecision();
  int deviceId = e.getDeviceId();
  int edgeFlags = e.getEdgeFlags();
  int source = e.getSource();
  int flags = e.getFlags();
  View headerHolder = getChildAt(headerPosition);
  for (int i = 0; i < pointerCount;i++) {
    pointerCoords[i].y -= headerHolder.getTop();
  }
  MotionEvent n = MotionEvent.obtain(downTime, eventTime, action,
      pointerCount, pointerIds, pointerCoords, metaState, xPrecision,
      yPrecision, deviceId, edgeFlags, source, flags);
  return n;
}

代码示例来源:origin: TangoAgency/material-intro-screen

if (ev.getAction() == MotionEvent.ACTION_DOWN && ev.getEdgeFlags() != 0) {

代码示例来源:origin: aa112901/remusic

if (ev.getAction() == MotionEvent.ACTION_DOWN && ev.getEdgeFlags() != 0) {

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

if (ev.getAction() == MotionEvent.ACTION_DOWN && ev.getEdgeFlags() != 0) {

代码示例来源:origin: chentao0707/SimplifyReader

if (ev.getEdgeFlags() != 0 && motionPosition < 0) {

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

@Test
public void testWriteToParcel() {
 Parcel parcel = Parcel.obtain();
 motionEvent2.writeToParcel(parcel, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
 parcel.setDataPosition(0);
 MotionEvent motionEvent = MotionEvent.CREATOR.createFromParcel(parcel);
 assertThat(motionEvent).rawY().isWithin(TOLERANCE).of(motionEvent2.getRawY());
 assertThat(motionEvent).rawX().isWithin(TOLERANCE).of(motionEvent2.getRawX());
 assertThat(motionEvent).y().isWithin(TOLERANCE).of(motionEvent2.getY());
 assertThat(motionEvent).x().isWithin(TOLERANCE).of(motionEvent2.getX());
 assertThat(motionEvent).hasAction(motionEvent2.getAction());
 assertThat(motionEvent).hasDownTime(motionEvent2.getDownTime());
 assertThat(motionEvent).hasEventTime(motionEvent2.getEventTime());
 assertThat(motionEvent).hasEdgeFlags(motionEvent2.getEdgeFlags());
 assertThat(motionEvent).hasDeviceId(motionEvent2.getDeviceId());
}

代码示例来源:origin: tianshaojie/AndroidFine

if (event.getAction() == MotionEvent.ACTION_DOWN && event.getEdgeFlags() != 0) {
  return false;

代码示例来源:origin: tianshaojie/AndroidFine

if (event.getAction() == MotionEvent.ACTION_DOWN && event.getEdgeFlags() != 0) {
  return false;

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

check("deviceId()").that(actual().getDeviceId()).isEqualTo(other.getDeviceId());
check("getFlags()").that(actual().getFlags()).isEqualTo(other.getFlags());
check("getEdgeFlags()").that(actual().getEdgeFlags()).isEqualTo(other.getEdgeFlags());
check("getXPrecision()").that(actual().getXPrecision()).isEqualTo(other.getXPrecision());
check("getYPrecision()").that(actual().getYPrecision()).isEqualTo(other.getYPrecision());

代码示例来源:origin: dinuscxj/PullZoomRecyclerView

@Override
public boolean onTouchEvent(MotionEvent event) {
  if (!isZoomEnable) {
    return false;
  }
  if (event.getEdgeFlags() != 0 && event.getAction() == MotionEvent.ACTION_DOWN) {
    return false;
  }
  return performTouchAction(event);
}

代码示例来源:origin: FolioReader/FolioReader-Android

if (ev.getAction() == MotionEvent.ACTION_DOWN && ev.getEdgeFlags() != 0) {

代码示例来源:origin: mkulesh/microMathematics

/*********************************************************
 * Touch processing
 *********************************************************/
@Override
public boolean onInterceptTouchEvent(MotionEvent event)
{
  final int action = event.getActionMasked();
  if (action == MotionEvent.ACTION_DOWN && event.getEdgeFlags() != 0)
  {
    // Don't handle edge touches immediately -- they may actually belong to one of our
    // descendants.
    return false;
  }
  onTouchEvent(event);
  return mGestureListener.isMoved;
}

代码示例来源:origin: gqjjqg/android-extend

ev.getPressure(), ev.getSize(), ev.getMetaState(),
      ev.getXPrecision(), ev.getYPrecision(), ev.getDeviceId(),
      ev.getEdgeFlags());
} else {
  MotionEvent.PointerProperties[] preo = new MotionEvent.PointerProperties[ev.getPointerCount()];
      ev.getEdgeFlags(), ev.getSource(), ev.getFlags());

代码示例来源:origin: stackoverflow.com

event.getPressure(), event.getSize(), event.getMetaState(),
        event.getYPrecision(), event.getXPrecision(), event.getDeviceId(),
        event.getEdgeFlags());
return super.onTouchEvent(verticalEvent);

代码示例来源:origin: stackoverflow.com

.getAction(), coords[0], coords[1], event.getPressure(), event.getSize(), event
    .getMetaState(), event.getXPrecision(), event.getYPrecision(), event.getDeviceId(),
    event.getEdgeFlags());
return super.dispatchTouchEvent(evt);

代码示例来源:origin: stackoverflow.com

.getAction(), coords[0], coords[1], event.getPressure(), event.getSize(), event
    .getMetaState(), event.getXPrecision(), event.getYPrecision(), event.getDeviceId(),
    event.getEdgeFlags());
return super.dispatchTouchEvent(evt);

代码示例来源:origin: stackoverflow.com

.getAction(), coords[0], coords[1], event.getPressure(), event.getSize(), event
    .getMetaState(), event.getXPrecision(), event.getYPrecision(),    event.getDeviceId(),
    event.getEdgeFlags());
return super.dispatchTouchEvent(evt);

代码示例来源:origin: canqihe/TmallSale

private MotionEvent transformEvent(MotionEvent e, int headerPosition) {
  if (headerPosition == MATCHED_STICKIED_HEADER) {
    return e;
  }
  long downTime = e.getDownTime();
  long eventTime = e.getEventTime();
  int action = e.getAction();
  int pointerCount = e.getPointerCount();
  int[] pointerIds = getPointerIds(e);
  MotionEvent.PointerCoords[] pointerCoords = getPointerCoords(e);
  int metaState = e.getMetaState();
  float xPrecision = e.getXPrecision();
  float yPrecision = e.getYPrecision();
  int deviceId = e.getDeviceId();
  int edgeFlags = e.getEdgeFlags();
  int source = e.getSource();
  int flags = e.getFlags();
  View headerHolder = getChildAt(headerPosition);
  for (int i = 0; i < pointerCount; i++) {
    pointerCoords[i].y -= headerHolder.getTop();
  }
  MotionEvent n = MotionEvent.obtain(downTime, eventTime, action,
      pointerCount, pointerIds, pointerCoords, metaState, xPrecision,
      yPrecision, deviceId, edgeFlags, source, flags);
  return n;
}

代码示例来源:origin: GcsSloop/ViewSupport

float yPrecision = e.getYPrecision();
int deviceId = e.getDeviceId();
int edgeFlags = e.getEdgeFlags();
int source = e.getSource();
int flags = e.getFlags();

相关文章