From 2e3c0a812a33324d5a5b2b1593734d027a9a5369 Mon Sep 17 00:00:00 2001 From: Martin Yankov Date: Thu, 4 Oct 2018 13:45:51 +0300 Subject: [PATCH] fix-next: apply repeater onLayout initial values (#6344) --- tns-core-modules/ui/repeater/repeater.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tns-core-modules/ui/repeater/repeater.ts b/tns-core-modules/ui/repeater/repeater.ts index 1d606ee3d..ee1470b01 100644 --- a/tns-core-modules/ui/repeater/repeater.ts +++ b/tns-core-modules/ui/repeater/repeater.ts @@ -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); }