@@ -10,6 +10,7 @@ import * as frameModule from "ui/frame";
1010import proxy = require( "ui/core/proxy" ) ;
1111import keyframeAnimation = require( "ui/animation/keyframe-animation" ) ;
1212import types = require( "utils/types" ) ;
13+ import { Color } from "color" ;
1314
1415let fs : typeof fileSystemModule ;
1516function ensureFS ( ) {
@@ -29,7 +30,18 @@ function ensureFrame() {
2930const AffectsLayout = global . android ? PropertyMetadataSettings . None : PropertyMetadataSettings . AffectsLayout ;
3031
3132const backgroundSpanUnderStatusBarProperty = new Property ( "backgroundSpanUnderStatusBar" , "Page" , new proxy . PropertyMetadata ( false , AffectsLayout ) ) ;
33+ const statusBarStyleProperty = new Property ( "statusBarStyle" , "Page" , new proxy . PropertyMetadata ( undefined ) ) ;
3234
35+ function onStatusBarStylePropertyChanged ( data : PropertyChangeData ) {
36+ const page = < Page > data . object ;
37+ if ( page . isLoaded ) {
38+ page . _updateStatusBar ( ) ;
39+ }
40+ }
41+
42+ ( < proxy . PropertyMetadata > statusBarStyleProperty . metadata ) . onSetNativeValue = onStatusBarStylePropertyChanged ;
43+
44+ const androidStatusBarBackgroundProperty = new Property ( "androidStatusBarBackground" , "Page" , new proxy . PropertyMetadata ( undefined ) ) ;
3345const actionBarHiddenProperty = new Property ( "actionBarHidden" , "Page" , new proxy . PropertyMetadata ( undefined , AffectsLayout ) ) ;
3446
3547function onActionBarHiddenPropertyChanged ( data : PropertyChangeData ) {
@@ -54,6 +66,8 @@ function enableSwipeBackNavigationPropertyChanged(data: PropertyChangeData) {
5466
5567export class Page extends ContentView implements dts . Page {
5668 public static backgroundSpanUnderStatusBarProperty = backgroundSpanUnderStatusBarProperty ;
69+ public static statusBarStyleProperty = statusBarStyleProperty ;
70+ public static androidStatusBarBackgroundProperty = androidStatusBarBackgroundProperty ;
5771 public static actionBarHiddenProperty = actionBarHiddenProperty ;
5872 public static iosSwipeBackNavigationEnabledProperty = enableSwipeBackNavigationProperty ;
5973 public static navigatingToEvent = "navigatingTo" ;
@@ -90,6 +104,8 @@ export class Page extends ContentView implements dts.Page {
90104 this . _updateActionBar ( this . actionBarHidden ) ;
91105 }
92106
107+ this . _updateStatusBar ( ) ;
108+
93109 super . onLoaded ( ) ;
94110 }
95111
@@ -101,6 +117,21 @@ export class Page extends ContentView implements dts.Page {
101117 this . _setValue ( Page . backgroundSpanUnderStatusBarProperty , value ) ;
102118 }
103119
120+ get statusBarStyle ( ) : string {
121+ return this . style . _getValue ( Page . statusBarStyleProperty ) ;
122+ }
123+
124+ set statusBarStyle ( value : string ) {
125+ this . style . _setValue ( Page . statusBarStyleProperty , value ) ;
126+ }
127+
128+ get androidStatusBarBackground ( ) : Color {
129+ return this . style . androidStatusBarBackground ;
130+ }
131+ set androidStatusBarBackground ( value : Color ) {
132+ this . style . androidStatusBarBackground = value ;
133+ }
134+
104135 get actionBarHidden ( ) : boolean {
105136 return this . _getValue ( Page . actionBarHiddenProperty ) ;
106137 }
@@ -121,6 +152,10 @@ export class Page extends ContentView implements dts.Page {
121152 //
122153 }
123154
155+ public _updateStatusBar ( ) {
156+ //
157+ }
158+
124159 public _updateEnableSwipeBackNavigation ( hidden : boolean ) {
125160 //
126161 }
@@ -365,4 +400,4 @@ export class Page extends ContentView implements dts.Page {
365400 resetCssValuesFunc ( this ) ;
366401 view . eachDescendant ( this , resetCssValuesFunc ) ;
367402 }
368- }
403+ }
0 commit comments