Cancel selection animation when new selection arrives
The onAnimationEnd callback will set the selection but there is a race condition that the new selection may arrive during animation. The later selection should be honored, so cancel the ongoing animation before starting new selection. Bug: 244273440 Test: Manually done on the Pixel 5 with wireless mouse Change-Id: I977f6cc9244e571caddfe0d79e10ee1c6c8a413d
This commit is contained in:
@@ -148,6 +148,9 @@ public final class SelectionActionModeHelper {
|
||||
startSelectionActionMode(null);
|
||||
} else {
|
||||
resetTextClassificationHelper();
|
||||
if (mSmartSelectSprite != null && mSmartSelectSprite.isAnimationActive()) {
|
||||
mSmartSelectSprite.cancelAnimation();
|
||||
}
|
||||
mTextClassificationAsyncTask = new TextClassificationAsyncTask(
|
||||
mTextView,
|
||||
mTextClassificationHelper.getTimeoutDuration(),
|
||||
|
||||
Reference in New Issue
Block a user