am 820b5e07: Merge "Add PointerTracker.isOldestPointerInQueue"

* commit '820b5e079c67dc95cd4b27d4d9f1afa5187b2d90':
  Add PointerTracker.isOldestPointerInQueue
main
Tadashi G. Takaoka 2013-01-21 01:39:22 -08:00 committed by Android Git Automerger
commit c76bb6cbcf
3 changed files with 10 additions and 11 deletions

View File

@ -888,10 +888,9 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
mDrawingHandler.dismissGestureFloatingPreviewText(mGestureFloatingPreviewTextLingerTimeout); mDrawingHandler.dismissGestureFloatingPreviewText(mGestureFloatingPreviewTextLingerTimeout);
} }
public void showGesturePreviewTrail(final PointerTracker tracker, public void showGesturePreviewTrail(final PointerTracker tracker) {
final boolean isOldestTracker) {
locatePreviewPlacerView(); locatePreviewPlacerView();
mPreviewPlacerView.invalidatePointer(tracker, isOldestTracker); mPreviewPlacerView.invalidatePointer(tracker);
} }
// Note that this method is called from a non-UI thread. // Note that this method is called from a non-UI thread.

View File

@ -83,7 +83,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
public void dismissKeyPreview(PointerTracker tracker); public void dismissKeyPreview(PointerTracker tracker);
public void showSlidingKeyInputPreview(PointerTracker tracker); public void showSlidingKeyInputPreview(PointerTracker tracker);
public void dismissSlidingKeyInputPreview(); public void dismissSlidingKeyInputPreview();
public void showGesturePreviewTrail(PointerTracker tracker, boolean isOldestTracker); public void showGesturePreviewTrail(PointerTracker tracker);
} }
public interface TimerProxy { public interface TimerProxy {
@ -709,8 +709,8 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
return sPointerTrackerQueue.size(); return sPointerTrackerQueue.size();
} }
private static boolean isOldestTrackerInQueue(final PointerTracker tracker) { public boolean isOldestTrackerInQueue() {
return sPointerTrackerQueue.getOldestElement() == tracker; return sPointerTrackerQueue.getOldestElement() == this;
} }
private void mayStartBatchInput(final Key key) { private void mayStartBatchInput(final Key key) {
@ -732,7 +732,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
dismissAllMoreKeysPanels(); dismissAllMoreKeysPanels();
} }
mTimerProxy.cancelLongPressTimer(); mTimerProxy.cancelLongPressTimer();
mDrawingProxy.showGesturePreviewTrail(this, isOldestTrackerInQueue(this)); mDrawingProxy.showGesturePreviewTrail(this);
} }
public void updateBatchInputByTimer(final long eventTime) { public void updateBatchInputByTimer(final long eventTime) {
@ -748,7 +748,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
if (mIsTrackingCanceled) { if (mIsTrackingCanceled) {
return; return;
} }
mDrawingProxy.showGesturePreviewTrail(this, isOldestTrackerInQueue(this)); mDrawingProxy.showGesturePreviewTrail(this);
} }
private void updateBatchInput(final long eventTime) { private void updateBatchInput(final long eventTime) {
@ -789,7 +789,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
if (mIsTrackingCanceled) { if (mIsTrackingCanceled) {
return; return;
} }
mDrawingProxy.showGesturePreviewTrail(this, isOldestTrackerInQueue(this)); mDrawingProxy.showGesturePreviewTrail(this);
} }
private void cancelBatchInput() { private void cancelBatchInput() {

View File

@ -133,9 +133,9 @@ public final class PreviewPlacerView extends RelativeLayout {
mGestureFloatingPreviewText.setPreviewEnabled(drawsGestureFloatingPreviewText); mGestureFloatingPreviewText.setPreviewEnabled(drawsGestureFloatingPreviewText);
} }
public void invalidatePointer(final PointerTracker tracker, final boolean isOldestTracker) { public void invalidatePointer(final PointerTracker tracker) {
final boolean needsToUpdateLastPointer = final boolean needsToUpdateLastPointer =
isOldestTracker && mGestureFloatingPreviewText.isPreviewEnabled(); tracker.isOldestTrackerInQueue() && mGestureFloatingPreviewText.isPreviewEnabled();
if (needsToUpdateLastPointer) { if (needsToUpdateLastPointer) {
mGestureFloatingPreviewText.setPreviewPosition(tracker); mGestureFloatingPreviewText.setPreviewPosition(tracker);
} }