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

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

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

MotionEvent.getHistoricalPressure介绍

暂无

代码示例

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

.of(other.getHistoricalY(i));
check("getHistoricalPressure(%s)", i)
  .that(actual().getHistoricalPressure(i))
  .isWithin(tolerance)
  .of(other.getHistoricalPressure(i));
check("getHistoricalSize(%s)", i)
  .that(actual().getHistoricalSize(i))

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

@Override public boolean onTouchEvent(MotionEvent event) {
   int action = event.getActionMasked();
   if (action != MotionEvent.ACTION_UP && action != MotionEvent.ACTION_CANCEL) {
     int N = event.getHistorySize();
     int P = event.getPointerCount();
     for (int i = 0; i < N; i++) {
       for (int j = 0; j < P; j++) {
         mCurX = event.getHistoricalX(j, i);
         mCurY = event.getHistoricalY(j, i);
         drawPoint(mCurX, mCurY,
             event.getHistoricalPressure(j, i),
             event.getHistoricalTouchMajor(j, i));
       }
     }
     for (int j = 0; j < P; j++) {
       mCurX = event.getX(j);
       mCurY = event.getY(j);
       drawPoint(mCurX, mCurY, event.getPressure(j), event.getTouchMajor(j));
     }
   }
   return true;
 }

代码示例来源:origin: redfish64/TinyTravelTracker

: event.getY();
  pressureVals[0] = processingHist
    ? event.getHistoricalPressure(histIdx) : event.getPressure();
} else {

代码示例来源:origin: apps4av/avare

xVals[0] = (processingHist ? event.getHistoricalX(histIdx) : event.getX()) /*ZKZK*/ / div;
  yVals[0] = (processingHist ? event.getHistoricalY(histIdx) : event.getY()) /*ZKZK*/ / div;
  pressureVals[0] = processingHist ? event.getHistoricalPressure(histIdx) : event.getPressure();
} else {

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

event.getHistoricalPressure(i),
event.getHistoricalSize(i));

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

@Override public boolean onTouchEvent(MotionEvent event) {
   int action = event.getAction();
   mCurDown = action == MotionEvent.ACTION_DOWN
       || action == MotionEvent.ACTION_MOVE;
   int N = event.getHistorySize();
   for (int i=0; i<N; i++) {
     drawPoint(event.getHistoricalX(i), event.getHistoricalY(i),
         event.getHistoricalPressure(i),
         event.getHistoricalSize(i));
   }
   drawPoint(event.getX(), event.getY(), event.getPressure(),
       event.getSize());
   return true;
 }
 private void drawPoint(float x, float y, float pressure, float size) {
   mCurX = (int)x;
   mCurY = (int)y;
   mCurPressure = pressure;
   mCurSize = size;
   mCurWidth = (int)(mCurSize*(getWidth()/3));
   if (mCurWidth < 1) mCurWidth = 1;
   if (mCurDown && mBitmap != null) {
     int pressureLevel = (int)(mCurPressure*255);
     mPaint.setARGB(pressureLevel, 255, 255, 255);
     mCanvas.drawCircle(mCurX, mCurY, mCurWidth, mPaint);
     mRect.set(mCurX-mCurWidth-2, mCurY-mCurWidth-2,
         mCurX+mCurWidth+2, mCurY+mCurWidth+2);
     invalidate(mRect);
   }
 }

代码示例来源:origin: limboemu/limbo

float ex = event.getHistoricalX(h);
float ey = event.getHistoricalY(h);
float ep = event.getHistoricalPressure(h);
processHoverMouse(event, ex, ey, ep, action);

代码示例来源:origin: limboemu/limbo

float ex = event.getHistoricalX(h);
float ey = event.getHistoricalY(h);
float ep = event.getHistoricalPressure(h);
processHoverMouse(ex, ey, ep, action);

代码示例来源:origin: MyScript/interactive-ink-examples-android

pointerEvents[i] = new PointerEvent(PointerEventType.MOVE, event.getHistoricalX(pointerIndex, i), event.getHistoricalY(pointerIndex, i), eventTimeOffset + event.getHistoricalEventTime(i), event.getHistoricalPressure(pointerIndex, i), iinkPointerType, pointerId);
pointerEvents[historySize] = new PointerEvent(PointerEventType.MOVE, event.getX(pointerIndex), event.getY(pointerIndex), eventTimeOffset + event.getEventTime(), event.getPressure(), iinkPointerType, pointerId);
editor.pointerEvents(pointerEvents, true);
 pointerEvents[i] = new PointerEvent(PointerEventType.MOVE, event.getHistoricalX(pointerIndex, i), event.getHistoricalY(pointerIndex, i), eventTimeOffset + event.getHistoricalEventTime(i), event.getHistoricalPressure(pointerIndex, i), iinkPointerType, pointerId);
editor.pointerEvents(pointerEvents, true);

代码示例来源:origin: THEONE10211024/ApiDemos

event.getHistoricalX(j, i),
event.getHistoricalY(j, i),
event.getHistoricalPressure(j, i),
event.getHistoricalTouchMajor(j, i),
event.getHistoricalTouchMinor(j, i),

代码示例来源:origin: qiubiteme/android_api_demos

event.getHistoricalX(j, i),
event.getHistoricalY(j, i),
event.getHistoricalPressure(j, i),
event.getHistoricalTouchMajor(j, i),
event.getHistoricalTouchMinor(j, i),

相关文章