Merge "Add PointerTracker.isOldestPointerInQueue"
commit
820b5e079c
|
@ -888,10 +888,9 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
|
|||
mDrawingHandler.dismissGestureFloatingPreviewText(mGestureFloatingPreviewTextLingerTimeout);
|
||||
}
|
||||
|
||||
public void showGesturePreviewTrail(final PointerTracker tracker,
|
||||
final boolean isOldestTracker) {
|
||||
public void showGesturePreviewTrail(final PointerTracker tracker) {
|
||||
locatePreviewPlacerView();
|
||||
mPreviewPlacerView.invalidatePointer(tracker, isOldestTracker);
|
||||
mPreviewPlacerView.invalidatePointer(tracker);
|
||||
}
|
||||
|
||||
// Note that this method is called from a non-UI thread.
|
||||
|
|
|
@ -83,7 +83,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
|
|||
public void dismissKeyPreview(PointerTracker tracker);
|
||||
public void showSlidingKeyInputPreview(PointerTracker tracker);
|
||||
public void dismissSlidingKeyInputPreview();
|
||||
public void showGesturePreviewTrail(PointerTracker tracker, boolean isOldestTracker);
|
||||
public void showGesturePreviewTrail(PointerTracker tracker);
|
||||
}
|
||||
|
||||
public interface TimerProxy {
|
||||
|
@ -709,8 +709,8 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
|
|||
return sPointerTrackerQueue.size();
|
||||
}
|
||||
|
||||
private static boolean isOldestTrackerInQueue(final PointerTracker tracker) {
|
||||
return sPointerTrackerQueue.getOldestElement() == tracker;
|
||||
public boolean isOldestTrackerInQueue() {
|
||||
return sPointerTrackerQueue.getOldestElement() == this;
|
||||
}
|
||||
|
||||
private void mayStartBatchInput(final Key key) {
|
||||
|
@ -732,7 +732,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
|
|||
dismissAllMoreKeysPanels();
|
||||
}
|
||||
mTimerProxy.cancelLongPressTimer();
|
||||
mDrawingProxy.showGesturePreviewTrail(this, isOldestTrackerInQueue(this));
|
||||
mDrawingProxy.showGesturePreviewTrail(this);
|
||||
}
|
||||
|
||||
public void updateBatchInputByTimer(final long eventTime) {
|
||||
|
@ -748,7 +748,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
|
|||
if (mIsTrackingCanceled) {
|
||||
return;
|
||||
}
|
||||
mDrawingProxy.showGesturePreviewTrail(this, isOldestTrackerInQueue(this));
|
||||
mDrawingProxy.showGesturePreviewTrail(this);
|
||||
}
|
||||
|
||||
private void updateBatchInput(final long eventTime) {
|
||||
|
@ -789,7 +789,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
|
|||
if (mIsTrackingCanceled) {
|
||||
return;
|
||||
}
|
||||
mDrawingProxy.showGesturePreviewTrail(this, isOldestTrackerInQueue(this));
|
||||
mDrawingProxy.showGesturePreviewTrail(this);
|
||||
}
|
||||
|
||||
private void cancelBatchInput() {
|
||||
|
|
|
@ -133,9 +133,9 @@ public final class PreviewPlacerView extends RelativeLayout {
|
|||
mGestureFloatingPreviewText.setPreviewEnabled(drawsGestureFloatingPreviewText);
|
||||
}
|
||||
|
||||
public void invalidatePointer(final PointerTracker tracker, final boolean isOldestTracker) {
|
||||
public void invalidatePointer(final PointerTracker tracker) {
|
||||
final boolean needsToUpdateLastPointer =
|
||||
isOldestTracker && mGestureFloatingPreviewText.isPreviewEnabled();
|
||||
tracker.isOldestTrackerInQueue() && mGestureFloatingPreviewText.isPreviewEnabled();
|
||||
if (needsToUpdateLastPointer) {
|
||||
mGestureFloatingPreviewText.setPreviewPosition(tracker);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue