Show gesture floating preview text at oldest finger
Bug: 7119032 Change-Id: Iddb26ba1a595e472fde0982d744b5652d5fbda3emain
parent
71fcf0f5ec
commit
f0e83046f0
|
@ -855,9 +855,10 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void showGesturePreviewTrail(final PointerTracker tracker) {
|
||||
public void showGesturePreviewTrail(final PointerTracker tracker,
|
||||
final boolean isOldestTracker) {
|
||||
locatePreviewPlacerView();
|
||||
mPreviewPlacerView.invalidatePointer(tracker);
|
||||
mPreviewPlacerView.invalidatePointer(tracker, isOldestTracker);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -80,7 +80,7 @@ public class PointerTracker implements PointerTrackerQueue.Element {
|
|||
public void invalidateKey(Key key);
|
||||
public void showKeyPreview(PointerTracker tracker);
|
||||
public void dismissKeyPreview(PointerTracker tracker);
|
||||
public void showGesturePreviewTrail(PointerTracker tracker);
|
||||
public void showGesturePreviewTrail(PointerTracker tracker, boolean isOldestTracker);
|
||||
}
|
||||
|
||||
public interface TimerProxy {
|
||||
|
@ -550,7 +550,7 @@ public class PointerTracker implements PointerTrackerQueue.Element {
|
|||
}
|
||||
sInGesture = true;
|
||||
mListener.onStartBatchInput();
|
||||
mDrawingProxy.showGesturePreviewTrail(this);
|
||||
mDrawingProxy.showGesturePreviewTrail(this, true /* isOldestTracker */);
|
||||
}
|
||||
|
||||
private void updateBatchInput(final long eventTime) {
|
||||
|
@ -567,7 +567,8 @@ public class PointerTracker implements PointerTrackerQueue.Element {
|
|||
mListener.onUpdateBatchInput(sAggregratedPointers);
|
||||
}
|
||||
}
|
||||
mDrawingProxy.showGesturePreviewTrail(this);
|
||||
final boolean isOldestTracker = sPointerTrackerQueue.getOldestElement() == this;
|
||||
mDrawingProxy.showGesturePreviewTrail(this, isOldestTracker);
|
||||
}
|
||||
|
||||
private void endBatchInput() {
|
||||
|
@ -584,7 +585,7 @@ public class PointerTracker implements PointerTrackerQueue.Element {
|
|||
clearBatchInputPointsOfAllPointerTrackers();
|
||||
}
|
||||
}
|
||||
mDrawingProxy.showGesturePreviewTrail(this);
|
||||
mDrawingProxy.showGesturePreviewTrail(this, true /* isOldestTracker */);
|
||||
}
|
||||
|
||||
private static void abortBatchInput() {
|
||||
|
|
|
@ -73,6 +73,10 @@ public class PointerTrackerQueue {
|
|||
mArraySize = newSize;
|
||||
}
|
||||
|
||||
public synchronized Element getOldestElement() {
|
||||
return (mArraySize == 0) ? null : mExpandableArrayOfActivePointers.get(0);
|
||||
}
|
||||
|
||||
public synchronized void releaseAllPointersOlderThan(final Element pointer,
|
||||
final long eventTime) {
|
||||
if (DEBUG) {
|
||||
|
|
|
@ -188,7 +188,7 @@ public class PreviewPlacerView extends RelativeLayout {
|
|||
mDrawsGestureFloatingPreviewText = drawsGestureFloatingPreviewText;
|
||||
}
|
||||
|
||||
public void invalidatePointer(final PointerTracker tracker) {
|
||||
public void invalidatePointer(final PointerTracker tracker, final boolean isOldestTracker) {
|
||||
GesturePreviewTrail trail;
|
||||
synchronized (mGesturePreviewTrails) {
|
||||
trail = mGesturePreviewTrails.get(tracker.mPointerId);
|
||||
|
@ -199,8 +199,10 @@ public class PreviewPlacerView extends RelativeLayout {
|
|||
}
|
||||
trail.addStroke(tracker.getGestureStrokeWithPreviewTrail(), tracker.getDownTime());
|
||||
|
||||
mLastPointerX = tracker.getLastX();
|
||||
mLastPointerY = tracker.getLastY();
|
||||
if (isOldestTracker) {
|
||||
mLastPointerX = tracker.getLastX();
|
||||
mLastPointerY = tracker.getLastY();
|
||||
}
|
||||
// TODO: Should narrow the invalidate region.
|
||||
invalidate();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue