feat: apply insets to repeater

This commit is contained in:
Vasil Chimev
2018-08-22 16:51:30 +03:00
committed by Martin Yankov
parent 9549f6b6a2
commit e66a6fa286

View File

@@ -101,7 +101,12 @@ export class Repeater extends CustomLayoutView implements RepeaterDefinition {
}
public onLayout(left: number, top: number, right: number, bottom: number): void {
View.layoutChild(this, this.itemsLayout, 0, 0, right - left, bottom - top);
const insets = this.getSafeAreaInsets();
const childLeft = left + insets.left;
const childTop = top + insets.top;
const childRight = right - insets.right;
const childBottom = bottom - insets.bottom;
View.layoutChild(this, this.itemsLayout, childLeft, childTop, childRight, childBottom);
}
public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void {