From 35b8209ddbdde614ecf225b9866c83fdc4b6ed70 Mon Sep 17 00:00:00 2001 From: hshristov Date: Fri, 6 Nov 2015 16:45:20 +0200 Subject: [PATCH] Implemented LiveSync page reload. Fixed iOS layout bug --- application/application.android.ts | 4 ++++ ui/frame/frame.d.ts | 6 +++++- ui/frame/frame.ios.ts | 7 +++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/application/application.android.ts b/application/application.android.ts index 6bafb8e40..66ea161a4 100644 --- a/application/application.android.ts +++ b/application/application.android.ts @@ -156,6 +156,10 @@ app.init({ onCreate: function () { exports.android.init(this); + }, + + onLiveSync: function () { + frame.reloadPage(); } }); diff --git a/ui/frame/frame.d.ts b/ui/frame/frame.d.ts index d4c65d512..64d1a250c 100644 --- a/ui/frame/frame.d.ts +++ b/ui/frame/frame.d.ts @@ -245,4 +245,8 @@ declare module "ui/frame" { */ navBarVisibility: string; } -} + + //@private + export function reloadPage(): void; + //@endprivate +} \ No newline at end of file diff --git a/ui/frame/frame.ios.ts b/ui/frame/frame.ios.ts index 9472f10dc..de74a415c 100644 --- a/ui/frame/frame.ios.ts +++ b/ui/frame/frame.ios.ts @@ -196,6 +196,10 @@ export class Frame extends frameCommon.Frame { this._heightMeasureSpec = heightMeasureSpec; let result = this.measurePage(this.currentPage); + if (this._navigateToEntry && this.currentPage) { + this.measurePage(this._navigateToEntry.resolvedPage); + } + let widthAndState = view.View.resolveSizeAndState(result.measuredWidth, width, widthMode, 0); let heightAndState = view.View.resolveSizeAndState(result.measuredHeight, height, heightMode, 0); @@ -220,6 +224,9 @@ export class Frame extends frameCommon.Frame { this._layoutWidth = right - left; this._layoutheight = bottom - top; this.layoutPage(this.currentPage); + if (this._navigateToEntry && this.currentPage) { + this.layoutPage(this._navigateToEntry.resolvedPage); + } } public layoutPage(page: pages.Page): void {