We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b1c4ab5 + 989ae75 commit 1908cf9Copy full SHA for 1908cf9
1 file changed
core/java/android/view/View.java
@@ -4348,13 +4348,13 @@ public boolean requestRectangleOnScreen(Rect rectangle) {
4348
* @return Whether any parent scrolled.
4349
*/
4350
public boolean requestRectangleOnScreen(Rect rectangle, boolean immediate) {
4351
- if (mAttachInfo == null) {
+ if (mParent == null) {
4352
return false;
4353
}
4354
4355
View child = this;
4356
4357
- RectF position = mAttachInfo.mTmpTransformRect;
+ RectF position = (mAttachInfo != null) ? mAttachInfo.mTmpTransformRect : new RectF();
4358
position.set(rectangle);
4359
4360
ViewParent parent = mParent;
0 commit comments