Pressure info in captured gestures.

Change-Id: If72f8d5ea0cb748f60357441153d5fb8ac1b8143
This commit is contained in:
Daniel Sandler
2012-07-24 12:37:58 -04:00
parent 3380534a62
commit 780d668bee

View File

@@ -63,11 +63,15 @@ public class GestureRecorder {
}
}
public String toJson() {
return String.format("{\"type\":\"motion\", \"time\":%d, \"action\":\"%s\", \"x\":%.2f, \"y\":%.2f}",
return String.format(
("{\"type\":\"motion\", \"time\":%d, \"action\":\"%s\", "
+ "\"x\":%.2f, \"y\":%.2f, \"s\":%.2f, \"p\":%.2f}"),
this.time,
actionName(this.event.getAction()),
this.event.getRawX(),
this.event.getRawY()
this.event.getRawY(),
this.event.getSize(),
this.event.getPressure()
);
}
}