diff options
author | 2013-02-04 10:38:35 -0800 | |
---|---|---|
committer | 2013-02-04 10:38:35 -0800 | |
commit | 54359d860439d9bf3e8b2a46f1d0eda0d002deee (patch) | |
tree | fad710d96cf56bf44e13bc4413d1e901c40779e7 /java/src/com/android/inputmethod/research/Replayer.java | |
parent | 32d171225b73f097aabb7d38f2486fa4d469a233 (diff) | |
parent | 5ca4afa543a8ce8ba82d84e393a577de306582b3 (diff) | |
download | latinime-54359d860439d9bf3e8b2a46f1d0eda0d002deee.tar.gz latinime-54359d860439d9bf3e8b2a46f1d0eda0d002deee.tar.xz latinime-54359d860439d9bf3e8b2a46f1d0eda0d002deee.zip |
am 5ca4afa5: Merge "[Rlog48c] Replay historical motion data"
# Via Android (Google) Code Review (1) and Kurt Partridge (1)
* commit '5ca4afa543a8ce8ba82d84e393a577de306582b3':
[Rlog48c] Replay historical motion data
Diffstat (limited to 'java/src/com/android/inputmethod/research/Replayer.java')
-rw-r--r-- | java/src/com/android/inputmethod/research/Replayer.java | 20 |
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; |