Skip to content

Commit

Permalink
[Android] Call handleUpdateLayout even if the content didn't change
Browse files Browse the repository at this point in the history
Fixes #11096
  • Loading branch information
Yann Pringault committed Nov 30, 2016
1 parent 6554ad5 commit c07c320
Showing 1 changed file with 4 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,23 +286,10 @@ public void onCollectExtraUpdates(UIViewOperationQueue uiViewOperationQueue) {
}

if (hasNewLayout()) {
float newLeft = Math.round(absoluteX + getLayoutX());
float newTop = Math.round(absoluteY + getLayoutY());
float newRight = Math.round(absoluteX + getLayoutX() + getLayoutWidth());
float newBottom = Math.round(absoluteY + getLayoutY() + getLayoutHeight());

if (newLeft == mAbsoluteLeft &&
newRight == mAbsoluteRight &&
newTop == mAbsoluteTop &&
newBottom == mAbsoluteBottom) {
return false;
}

mAbsoluteLeft = newLeft;
mAbsoluteTop = newTop;
mAbsoluteRight = newRight;
mAbsoluteBottom = newBottom;

mAbsoluteLeft = Math.round(absoluteX + getLayoutX());
mAbsoluteTop = Math.round(absoluteY + getLayoutY());
mAbsoluteRight = Math.round(absoluteX + getLayoutX() + getLayoutWidth());
mAbsoluteBottom = Math.round(absoluteY + getLayoutY() + getLayoutHeight());
nativeViewHierarchyOptimizer.handleUpdateLayout(this);
return true;
} else {
Expand Down

0 comments on commit c07c320

Please sign in to comment.