use of android.view.MotionEvent.PointerProperties in project android_packages_apps_Trebuchet by LineageOS.
the class TouchEventGenerator method getFingerState.
/**
* Returns the description of the fingers' state expected by MotionEvent.
*/
private Pair<PointerProperties[], PointerCoords[]> getFingerState() {
int nFingers = mFingers.size();
PointerProperties[] properties = new PointerProperties[nFingers];
PointerCoords[] coordinates = new PointerCoords[nFingers];
int index = 0;
for (Map.Entry<Integer, Point> entry : mFingers.entrySet()) {
int id = entry.getKey();
Point location = entry.getValue();
PointerProperties property = new PointerProperties();
property.id = id;
property.toolType = MotionEvent.TOOL_TYPE_FINGER;
properties[index] = property;
PointerCoords coordinate = new PointerCoords();
coordinate.x = location.x;
coordinate.y = location.y;
coordinate.pressure = 1.0f;
coordinates[index] = coordinate;
index++;
}
return new Pair<MotionEvent.PointerProperties[], MotionEvent.PointerCoords[]>(properties, coordinates);
}
use of android.view.MotionEvent.PointerProperties in project android_packages_apps_Launcher3 by ArrowOS.
the class TouchEventGenerator method getFingerState.
/**
* Returns the description of the fingers' state expected by MotionEvent.
*/
private Pair<PointerProperties[], PointerCoords[]> getFingerState() {
int nFingers = mFingers.size();
PointerProperties[] properties = new PointerProperties[nFingers];
PointerCoords[] coordinates = new PointerCoords[nFingers];
int index = 0;
for (Map.Entry<Integer, Point> entry : mFingers.entrySet()) {
int id = entry.getKey();
Point location = entry.getValue();
PointerProperties property = new PointerProperties();
property.id = id;
property.toolType = MotionEvent.TOOL_TYPE_FINGER;
properties[index] = property;
PointerCoords coordinate = new PointerCoords();
coordinate.x = location.x;
coordinate.y = location.y;
coordinate.pressure = 1.0f;
coordinates[index] = coordinate;
index++;
}
return new Pair<MotionEvent.PointerProperties[], MotionEvent.PointerCoords[]>(properties, coordinates);
}
use of android.view.MotionEvent.PointerProperties in project android-test by android.
the class MotionEventBuilder method setPointer.
/**
* Simple mechanism to add a pointer to the MotionEvent.
*
* <p>Can be called multiple times to add multiple pointers to the event.
*/
public MotionEventBuilder setPointer(float x, float y) {
PointerProperties pointerProperties = new PointerProperties();
pointerProperties.id = pointerPropertiesList.size();
PointerCoords pointerCoords = new PointerCoords();
pointerCoords.x = x;
pointerCoords.y = y;
return setPointer(pointerProperties, pointerCoords);
}
use of android.view.MotionEvent.PointerProperties in project android-test by android.
the class PointerPropertiesBuilder method build.
public PointerProperties build() {
final PointerProperties pointerProperties = new PointerProperties();
pointerProperties.id = id;
pointerProperties.toolType = toolType;
return pointerProperties;
}
use of android.view.MotionEvent.PointerProperties in project android-test by android.
the class MotionEventSubject method pointerProperties.
public PointerPropertiesSubject pointerProperties(int pointerIndex) {
PointerProperties outPointerProps = new PointerProperties();
actual.getPointerProperties(pointerIndex, outPointerProps);
return check("getPointerProperties(%s)", pointerIndex).about(PointerPropertiesSubject.pointerProperties()).that(outPointerProps);
}
Aggregations