diff --git a/application/application.android.ts b/application/application.android.ts index cde2105a8..fcbcbd2bb 100644 --- a/application/application.android.ts +++ b/application/application.android.ts @@ -196,7 +196,7 @@ export class AndroidApplication extends observable.Observable implements dts.And public onActivityResult: (requestCode: number, resultCode: number, data: android.content.Intent) => void; private _eventsToken: any; - + public getActivity(intent: android.content.Intent): Object { if (intent && intent.getAction() === android.content.Intent.ACTION_MAIN) { // application's main activity @@ -292,7 +292,7 @@ class BroadcastReceiver extends android.content.BroadcastReceiver { this._onReceiveCallback(context, intent); } } -} +} global.__onUncaughtError = function (error: Error) { if (!types.isFunction(exports.onUncaughtError)) { diff --git a/apps/tests/ui/page/page-tests-common.ts b/apps/tests/ui/page/page-tests-common.ts index 61f30d9f3..3ff3f2abd 100644 --- a/apps/tests/ui/page/page-tests-common.ts +++ b/apps/tests/ui/page/page-tests-common.ts @@ -105,7 +105,7 @@ export function test_PageLoaded_is_called_once() { } } -export var test_NavigateToNewPage = function () { +export function test_NavigateToNewPage() { var currentPage; currentPage = FrameModule.topmost().currentPage; // @@ -146,7 +146,7 @@ export var test_NavigateToNewPage = function () { 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 context = { property: "this is the context" }; var eventSequence = []; @@ -184,7 +184,7 @@ export var test_PageNavigation_EventSequence = function () { 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; currentPage = FrameModule.topmost().currentPage; // @@ -220,7 +220,7 @@ export var test_NavigateTo_WithContext = function () { 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 pageFactory = function () { var testPage = new PageModule.Page(); @@ -243,7 +243,7 @@ export var test_FrameBackStack_WhenNavigatingForwardAndBack = function () { 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"); try { 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 testPage: PageModule.Page; 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 label: LabelModule.Label; 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 label: LabelModule.Label; var StackLayout: stackLayoutModule.StackLayout; @@ -332,4 +332,11 @@ export var test_cssShouldBeAppliedAfterChangeToAllNestedElements = function () { finally { helper.goBack(); } +} + +export function test_page_backgroundColor_is_white() { + helper.do_PageTest_WithButton(function testBackground(views: Array) { + var page = views[0]; + TKUnit.assertEqual(page.style.backgroundColor.hex.toLowerCase(), "#ffffff", "page background-color"); + }); } \ No newline at end of file diff --git a/ui/page/page-common.ts b/ui/page/page-common.ts index d634f3a57..2aa969705 100644 --- a/ui/page/page-common.ts +++ b/ui/page/page-common.ts @@ -2,6 +2,7 @@ import view = require("ui/core/view"); import dts = require("ui/page"); import frame = require("ui/frame"); +import styleModule = require("ui/styling/style"); import styleScope = require("ui/styling/style-scope"); import fs = require("file-system"); 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) { super(options); 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() {