fix-next: apply repeater onLayout initial values (#6344)

This commit is contained in:
Martin Yankov
2018-10-04 13:45:51 +03:00
committed by GitHub
parent 0f067a03ca
commit 2e3c0a812a

View File

@@ -102,10 +102,16 @@ export class Repeater extends CustomLayoutView implements RepeaterDefinition {
public onLayout(left: number, top: number, right: number, bottom: number): void {
const insets = this.getSafeAreaInsets();
const childLeft = left + insets.left;
const childTop = top + insets.top;
const childRight = right - insets.right;
const childBottom = bottom - insets.bottom;
const paddingLeft = this.effectiveBorderLeftWidth + this.effectivePaddingLeft + insets.left;
const paddingTop = this.effectiveBorderTopWidth + this.effectivePaddingTop + insets.top;
const paddingRight = this.effectiveBorderRightWidth + this.effectivePaddingRight + insets.right;
const paddingBottom = this.effectiveBorderBottomWidth + this.effectivePaddingBottom + insets.bottom;
const childLeft = paddingLeft;
const childTop = paddingTop;
const childRight = right - left - paddingRight;
const childBottom = bottom - top - paddingBottom;
View.layoutChild(this, this.itemsLayout, childLeft, childTop, childRight, childBottom);
}