aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/research/Replayer.java
diff options
context:
space:
mode:
authorKurt Partridge <kep@google.com>2013-01-31 09:59:16 -0800
committerKurt Partridge <kep@google.com>2013-02-04 06:13:51 -0800
commit7708bcf6fb80f42f62f34b57aece4a2baa5b3320 (patch)
tree735d863920422c6ca3324a8eeada2067d6a2a457 /java/src/com/android/inputmethod/research/Replayer.java
parentce9e7f667d49735bbae344ea6c64e3ae39f7368a (diff)
downloadlatinime-7708bcf6fb80f42f62f34b57aece4a2baa5b3320.tar.gz
latinime-7708bcf6fb80f42f62f34b57aece4a2baa5b3320.tar.xz
latinime-7708bcf6fb80f42f62f34b57aece4a2baa5b3320.zip
[Rlog48c] Replay historical motion data
Change-Id: Ib398ea61ff048b1a4ac3b7f7b4a772e173a7b294
Diffstat (limited to 'java/src/com/android/inputmethod/research/Replayer.java')
-rw-r--r--java/src/com/android/inputmethod/research/Replayer.java20
1 files changed, 16 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/research/Replayer.java b/java/src/com/android/inputmethod/research/Replayer.java
index 9bf5fee6c..a9b7a9d0c 100644
--- a/java/src/com/android/inputmethod/research/Replayer.java
+++ b/java/src/com/android/inputmethod/research/Replayer.java
@@ -22,6 +22,8 @@ import android.os.Message;
import android.os.SystemClock;
import android.util.Log;
import android.view.MotionEvent;
+import android.view.MotionEvent.PointerCoords;
+import android.view.MotionEvent.PointerProperties;
import com.android.inputmethod.keyboard.KeyboardSwitcher;
import com.android.inputmethod.keyboard.MainKeyboardView;
@@ -62,7 +64,6 @@ public class Replayer {
if (mIsReplaying) {
return;
}
-
mIsReplaying = true;
final int numActions = replayData.mActions.size();
if (DEBUG) {
@@ -95,25 +96,36 @@ public class Replayer {
case MSG_MOTION_EVENT:
final int index = msg.arg1;
final int action = replayData.mActions.get(index);
- final int x = replayData.mXCoords.get(index);
- final int y = replayData.mYCoords.get(index);
+ final PointerProperties[] pointerPropertiesArray =
+ replayData.mPointerPropertiesArrays.get(index);
+ final PointerCoords[] pointerCoordsArray =
+ replayData.mPointerCoordsArrays.get(index);
final long origTime = replayData.mTimes.get(index);
if (action == MotionEvent.ACTION_DOWN) {
mOrigDownTime = origTime;
}
final MotionEvent me = MotionEvent.obtain(mOrigDownTime + timeAdjustment,
- origTime + timeAdjustment, action, x, y, 0);
+ origTime + timeAdjustment, action,
+ pointerPropertiesArray.length, pointerPropertiesArray,
+ pointerCoordsArray, 0, 0, 1.0f, 1.0f, 0, 0, 0, 0);
mainKeyboardView.processMotionEvent(me);
me.recycle();
break;
case MSG_DONE:
mIsReplaying = false;
+ ResearchLogger.getInstance().requestIndicatorRedraw();
break;
}
}
};
+ handler.post(new Runnable() {
+ @Override
+ public void run() {
+ ResearchLogger.getInstance().requestIndicatorRedraw();
+ }
+ });
for (int i = 0; i < numActions; i++) {
final Message msg = Message.obtain(handler, MSG_MOTION_EVENT, i, 0);
final long msgTime = replayData.mTimes.get(i) + timeAdjustment;