am 2c7583f6: am c6cb2ec1: Add new public attribute mPointerId to PointerTracker

Merge commit '2c7583f6c3c24202492b9404955b1aee2dc5ce94'

* commit '2c7583f6c3c24202492b9404955b1aee2dc5ce94':
  Add new public attribute mPointerId to PointerTracker
main
Tadashi G. Takaoka 2010-09-01 13:04:27 -07:00 committed by Android Git Automerger
commit 568743e182
2 changed files with 5 additions and 3 deletions

View File

@ -774,7 +774,6 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener,
if (DEBUG) { if (DEBUG) {
if (mShowTouchPoints) { if (mShowTouchPoints) {
for (PointerTracker tracker : mPointerTrackers) { for (PointerTracker tracker : mPointerTrackers) {
if (tracker == null) continue;
int startX = tracker.getStartX(); int startX = tracker.getStartX();
int startY = tracker.getStartY(); int startY = tracker.getStartY();
int lastX = tracker.getLastX(); int lastX = tracker.getLastX();
@ -1047,7 +1046,7 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener,
// Create pointer trackers until we can get 'id+1'-th tracker, if needed. // Create pointer trackers until we can get 'id+1'-th tracker, if needed.
for (int i = pointers.size(); i <= id; i++) { for (int i = pointers.size(); i <= id; i++) {
final PointerTracker tracker = final PointerTracker tracker =
new PointerTracker(mHandler, mKeyDetector, this); new PointerTracker(i, mHandler, mKeyDetector, this);
if (keys != null) if (keys != null)
tracker.setKeyboard(keys, mDebounceHysteresis); tracker.setKeyboard(keys, mDebounceHysteresis);
if (listener != null) if (listener != null)

View File

@ -32,6 +32,8 @@ public class PointerTracker {
public boolean isMiniKeyboardOnScreen(); public boolean isMiniKeyboardOnScreen();
} }
public final int mPointerId;
// Timing constants // Timing constants
private static final int REPEAT_START_DELAY = 400; private static final int REPEAT_START_DELAY = 400;
/* package */ static final int REPEAT_INTERVAL = 50; // ~20 keys per second /* package */ static final int REPEAT_INTERVAL = 50; // ~20 keys per second
@ -77,9 +79,10 @@ public class PointerTracker {
// pressed key // pressed key
private int mPreviousKey = NOT_A_KEY; private int mPreviousKey = NOT_A_KEY;
public PointerTracker(UIHandler handler, KeyDetector keyDetector, UIProxy proxy) { public PointerTracker(int id, UIHandler handler, KeyDetector keyDetector, UIProxy proxy) {
if (proxy == null || handler == null || keyDetector == null) if (proxy == null || handler == null || keyDetector == null)
throw new NullPointerException(); throw new NullPointerException();
mPointerId = id;
mProxy = proxy; mProxy = proxy;
mHandler = handler; mHandler = handler;
mKeyDetector = keyDetector; mKeyDetector = keyDetector;