Merge "Bug 5166707: NPE fixed in getFocusedRect"
This commit is contained in:
committed by
Android (Google) Code Review
commit
8e7e95f22f
@@ -4788,8 +4788,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
|
|||||||
selEnd = getSelectionEnd();
|
selEnd = getSelectionEnd();
|
||||||
|
|
||||||
if (selStart >= 0) {
|
if (selStart >= 0) {
|
||||||
if (mHighlightPath == null)
|
if (mHighlightPath == null) mHighlightPath = new Path();
|
||||||
mHighlightPath = new Path();
|
|
||||||
|
|
||||||
if (selStart == selEnd) {
|
if (selStart == selEnd) {
|
||||||
if (isCursorVisible() &&
|
if (isCursorVisible() &&
|
||||||
@@ -4995,6 +4994,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
|
|||||||
} else {
|
} else {
|
||||||
// Selection extends across multiple lines -- the focused
|
// Selection extends across multiple lines -- the focused
|
||||||
// rect covers the entire width.
|
// rect covers the entire width.
|
||||||
|
if (mHighlightPath == null) mHighlightPath = new Path();
|
||||||
if (mHighlightPathBogus) {
|
if (mHighlightPathBogus) {
|
||||||
mHighlightPath.reset();
|
mHighlightPath.reset();
|
||||||
mLayout.getSelectionPath(selStart, selEnd, mHighlightPath);
|
mLayout.getSelectionPath(selStart, selEnd, mHighlightPath);
|
||||||
|
|||||||
Reference in New Issue
Block a user