Skip to content

Commit 48ab2e4

Browse files
authored
Merge pull request NativeScript#2459 from NativeScript/action-bar-title-fix
fix: ActionBar's title not updating in OnLoaded event
2 parents b07dd30 + 1d63103 commit 48ab2e4

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

tns-core-modules/ui/action-bar/action-bar.android.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import common = require("./action-bar-common");
2-
import frame = require("ui/frame");
32
import types = require("utils/types");
43
import enums = require("ui/enums");
54
import application = require("application");
@@ -50,7 +49,7 @@ export class ActionItem extends common.ActionItem {
5049
private _itemId;
5150
constructor() {
5251
super();
53-
this._itemId = generateItemId();
52+
this._itemId = generateItemId();
5453
}
5554

5655
public get android(): dts.AndroidActionItemSettings {
@@ -171,7 +170,7 @@ export class ActionBar extends common.ActionBar {
171170
this.navigationButton._raiseTap();
172171
return true;
173172
}
174-
173+
175174
// Find item with the right ID;
176175
var menuItem: dts.ActionItem = undefined;
177176
var items = this.actionItems.getItems();
@@ -301,15 +300,13 @@ export class ActionBar extends common.ActionBar {
301300
}
302301

303302
public _onTitlePropertyChanged() {
304-
var topFrame = frame.topmost();
305-
if (this._toolbar && topFrame && topFrame.currentPage === this.page) {
303+
if (this._toolbar) {
306304
this._updateTitleAndTitleView();
307305
}
308306
}
309307

310308
public _onIconPropertyChanged() {
311-
var topFrame = frame.topmost();
312-
if (this._toolbar && topFrame && topFrame.currentPage === this.page) {
309+
if (this._toolbar) {
313310
this._updateIcon();
314311
}
315312
}

0 commit comments

Comments
 (0)