Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nativescript-core/ui/page/page-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export class PageBase extends ContentView implements PageDefinition {

public eachChildView(callback: (child: View) => boolean) {
super.eachChildView(callback);
if (this.actionBar) {
if (this.hasActionBar) {
callback(this.actionBar);
}
}
Expand Down
19 changes: 16 additions & 3 deletions nativescript-core/ui/page/page.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,30 @@ export class Page extends PageBase {
@profile
public onLoaded() {
super.onLoaded();
if (this.actionBarHidden !== undefined) {
if (!this.hasActionBar && this.actionBarHidden !== true) {
// ensure actionBar is created
// but we only need to do that if the actionBarHidden is not hidden
this.actionBar = new ActionBar();
}
if (this.hasActionBar) {
this.updateActionBar();
}
}

private updateActionBar() {
this.actionBar.update();
// the test is actually to ensure the actionBar is created
// it will be created if not
if (this.actionBar) {
this.actionBar.update();
}
}

[actionBarHiddenProperty.setNative](value: boolean) {
this.updateActionBar();
// in case the actionBar is not created and actionBarHidden is changed to true
// the actionBar will be created by updateActionBar
if (!value || this.hasActionBar) {
this.updateActionBar();
}
}

[statusBarStyleProperty.getDefault](): { color: number, systemUiVisibility: number } {
Expand Down