Merge "Fix monkey crash in smart selection animation" into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
1ffdec20b4
@@ -285,10 +285,14 @@ public final class SelectionActionModeHelper {
|
|||||||
final Layout layout = mTextView.getLayout();
|
final Layout layout = mTextView.getLayout();
|
||||||
|
|
||||||
final Runnable onAnimationEndCallback = () -> {
|
final Runnable onAnimationEndCallback = () -> {
|
||||||
if (result.mStart >= 0 && result.mEnd <= getText(mTextView).length()
|
final SelectionResult startSelectionResult;
|
||||||
|
if (result != null && result.mStart >= 0 && result.mEnd <= getText(mTextView).length()
|
||||||
&& result.mStart <= result.mEnd) {
|
&& result.mStart <= result.mEnd) {
|
||||||
startSelectionActionMode(result);
|
startSelectionResult = result;
|
||||||
|
} else {
|
||||||
|
startSelectionResult = null;
|
||||||
}
|
}
|
||||||
|
startSelectionActionMode(startSelectionResult);
|
||||||
};
|
};
|
||||||
// TODO do not trigger the animation if the change included only non-printable characters
|
// TODO do not trigger the animation if the change included only non-printable characters
|
||||||
final boolean didSelectionChange =
|
final boolean didSelectionChange =
|
||||||
|
|||||||
Reference in New Issue
Block a user