Default page background - white

This commit is contained in:
vakrilov
2015-07-29 11:43:12 +03:00
parent 58b93f3d1c
commit f0f0e91b70
3 changed files with 21 additions and 10 deletions

View File

@ -196,7 +196,7 @@ export class AndroidApplication extends observable.Observable implements dts.And
public onActivityResult: (requestCode: number, resultCode: number, data: android.content.Intent) => void; public onActivityResult: (requestCode: number, resultCode: number, data: android.content.Intent) => void;
private _eventsToken: any; private _eventsToken: any;
public getActivity(intent: android.content.Intent): Object { public getActivity(intent: android.content.Intent): Object {
if (intent && intent.getAction() === android.content.Intent.ACTION_MAIN) { if (intent && intent.getAction() === android.content.Intent.ACTION_MAIN) {
// application's main activity // application's main activity
@ -292,7 +292,7 @@ class BroadcastReceiver extends android.content.BroadcastReceiver {
this._onReceiveCallback(context, intent); this._onReceiveCallback(context, intent);
} }
} }
} }
global.__onUncaughtError = function (error: Error) { global.__onUncaughtError = function (error: Error) {
if (!types.isFunction(exports.onUncaughtError)) { if (!types.isFunction(exports.onUncaughtError)) {

View File

@ -105,7 +105,7 @@ export function test_PageLoaded_is_called_once() {
} }
} }
export var test_NavigateToNewPage = function () { export function test_NavigateToNewPage() {
var currentPage; var currentPage;
currentPage = FrameModule.topmost().currentPage; currentPage = FrameModule.topmost().currentPage;
// <snippet module="ui/page" title="Page"> // <snippet module="ui/page" title="Page">
@ -146,7 +146,7 @@ export var test_NavigateToNewPage = function () {
TKUnit.assert(testPage._isAddedToNativeVisualTree === false, "Page._isAddedToNativeVisualTree should become false after navigating back"); TKUnit.assert(testPage._isAddedToNativeVisualTree === false, "Page._isAddedToNativeVisualTree should become false after navigating back");
} }
export var test_PageNavigation_EventSequence = function () { export function test_PageNavigation_EventSequence() {
var testPage: PageModule.Page; var testPage: PageModule.Page;
var context = { property: "this is the context" }; var context = { property: "this is the context" };
var eventSequence = []; var eventSequence = [];
@ -184,7 +184,7 @@ export var test_PageNavigation_EventSequence = function () {
TKUnit.arrayAssert(eventSequence, expectedEventSequence, "Actual event sequence is not equal to expected."); TKUnit.arrayAssert(eventSequence, expectedEventSequence, "Actual event sequence is not equal to expected.");
} }
export var test_NavigateTo_WithContext = function () { export function test_NavigateTo_WithContext() {
var currentPage; var currentPage;
currentPage = FrameModule.topmost().currentPage; currentPage = FrameModule.topmost().currentPage;
// <snippet module="ui/page" title="Page"> // <snippet module="ui/page" title="Page">
@ -220,7 +220,7 @@ export var test_NavigateTo_WithContext = function () {
TKUnit.assert(testPage.navigationContext === undefined, "Navigation context should be cleared on navigating back"); TKUnit.assert(testPage.navigationContext === undefined, "Navigation context should be cleared on navigating back");
} }
export var test_FrameBackStack_WhenNavigatingForwardAndBack = function () { export function test_FrameBackStack_WhenNavigatingForwardAndBack() {
var testPage: PageModule.Page; var testPage: PageModule.Page;
var pageFactory = function () { var pageFactory = function () {
var testPage = new PageModule.Page(); var testPage = new PageModule.Page();
@ -243,7 +243,7 @@ export var test_FrameBackStack_WhenNavigatingForwardAndBack = function () {
TKUnit.assert(topFrame.canGoBack() === false, "canGoBack should return false."); TKUnit.assert(topFrame.canGoBack() === false, "canGoBack should return false.");
} }
export var test_LoadPageFromModule = function () { export function test_LoadPageFromModule() {
helper.navigateToModule("ui/page/test-page-module"); helper.navigateToModule("ui/page/test-page-module");
try { try {
var topFrame = FrameModule.topmost(); var topFrame = FrameModule.topmost();
@ -256,7 +256,7 @@ export var test_LoadPageFromModule = function () {
} }
} }
export var test_NavigateToPageCreatedWithNavigationEntry = function () { export function test_NavigateToPageCreatedWithNavigationEntry() {
var expectedText = "Label created with a NavigationEntry"; var expectedText = "Label created with a NavigationEntry";
var testPage: PageModule.Page; var testPage: PageModule.Page;
var pageFactory = function () { var pageFactory = function () {
@ -276,7 +276,7 @@ export var test_NavigateToPageCreatedWithNavigationEntry = function () {
} }
} }
export var test_cssShouldBeAppliedToAllNestedElements = function () { export function test_cssShouldBeAppliedToAllNestedElements() {
var testPage: PageModule.Page; var testPage: PageModule.Page;
var label: LabelModule.Label; var label: LabelModule.Label;
var StackLayout: stackLayoutModule.StackLayout; var StackLayout: stackLayoutModule.StackLayout;
@ -303,7 +303,7 @@ export var test_cssShouldBeAppliedToAllNestedElements = function () {
} }
} }
export var test_cssShouldBeAppliedAfterChangeToAllNestedElements = function () { export function test_cssShouldBeAppliedAfterChangeToAllNestedElements() {
var testPage: PageModule.Page; var testPage: PageModule.Page;
var label: LabelModule.Label; var label: LabelModule.Label;
var StackLayout: stackLayoutModule.StackLayout; var StackLayout: stackLayoutModule.StackLayout;
@ -332,4 +332,11 @@ export var test_cssShouldBeAppliedAfterChangeToAllNestedElements = function () {
finally { finally {
helper.goBack(); helper.goBack();
} }
}
export function test_page_backgroundColor_is_white() {
helper.do_PageTest_WithButton(function testBackground(views: Array<view.View>) {
var page = <PageModule.Page>views[0];
TKUnit.assertEqual(page.style.backgroundColor.hex.toLowerCase(), "#ffffff", "page background-color");
});
} }

View File

@ -2,6 +2,7 @@
import view = require("ui/core/view"); import view = require("ui/core/view");
import dts = require("ui/page"); import dts = require("ui/page");
import frame = require("ui/frame"); import frame = require("ui/frame");
import styleModule = require("ui/styling/style");
import styleScope = require("ui/styling/style-scope"); import styleScope = require("ui/styling/style-scope");
import fs = require("file-system"); import fs = require("file-system");
import fileSystemAccess = require("file-system/file-system-access"); import fileSystemAccess = require("file-system/file-system-access");
@ -42,6 +43,9 @@ export class Page extends contentView.ContentView implements dts.Page {
constructor(options?: dts.Options) { constructor(options?: dts.Options) {
super(options); super(options);
this.actionBar = new actionBar.ActionBar(); this.actionBar = new actionBar.ActionBar();
// The default style of the page should be white background
this.style._setValue(styleModule.backgroundColorProperty, "white", dependencyObservable.ValueSource.Inherited);
} }
public onLoaded() { public onLoaded() {