export function navigatingTo(args: EventData) {
  if (platform.device.os === platform.platformNames.ios) {
    if (defaultSpeed === -1) {
      defaultSpeed = frameModule.topmost().ios.controller.view.layer.speed;
      frameModule.topmost().ios.controller.navigationBar.translucent = false;
    }
  }
}
  /**
	 * Programmatically remove all buttons from the ActionBar
	 */
  public static actionBarSetStatusBarStyle(style: number) {
    if (topmost().ios) {
      let navigationBar = topmost().ios.controller.navigationBar;
      // 0: default
      // 1: light
      navigationBar.barStyle = style;
    }
  }
 public static STATUSBAR_STYLE(style: number) {
   if (topmost().ios) {
     let navigationBar = topmost().ios.controller.navigationBar;
     // 0: default
     // 1: light
     navigationBar.barStyle = style;
   }
 }
export function configurePlatformSpecificFeatures() {
    // Enable platform specific feature (in this case Android page caching)
    if (frameModule.topmost().android) {
        frameModule.topmost().android.cachePagesOnNavigate = true;
    }

    var iosFrame = frameModule.topmost().ios;
    if (iosFrame) {
        // Fix status bar color and nav bar vidibility
        iosFrame.controller.view.window.backgroundColor = UIColor.blackColor();
        iosFrame.navBarVisibility = 'never';
    }
}
export var test_ClearHistoryWithTransitionDoesNotBreakNavigation = function () {
    let topmost = topmostFrame();

    let mainTestPage = topmost.currentPage;
    let mainPageFactory = function (): Page {
        return mainTestPage;
    };

    // Go to details-page
    topmost.navigate({ create: pageFactory, clearHistory: false });
    TKUnit.waitUntilReady(() => { return topmost.currentPage !== mainTestPage; });

    // Go back to main-page with clearHistory
    var detailsPage: Page;
    detailsPage = topmost.currentPage;
    topmost.transition = { name: "fade" };
    topmost.navigate({ create: mainPageFactory, clearHistory: true });
    TKUnit.waitUntilReady(() => { return topmost.currentPage === mainTestPage; });

    // Go to details-page AGAIN
    topmost.navigate({ create: pageFactory, clearHistory: false });
    TKUnit.waitUntilReady(() => { return topmost.currentPage !== mainTestPage; });
    
    // Go back to main-page with clearHistory
    detailsPage = topmost.currentPage;
    topmost.transition = { name: "fade" };
    topmost.navigate({ create: mainPageFactory, clearHistory: true });
    TKUnit.waitUntilReady(() => { return topmost.currentPage === mainTestPage; });

    // Clean up
    topmost.transition = undefined;
}
Exemple #6
0
	public viewSegmentBar() {
		let navigationEntry = {
			moduleName: 'pages/segmentbar',
			clearHistory: true
		};
		topmost().navigate(navigationEntry);
	}
Exemple #7
0
	public viewTabs() {
		let navigationEntry = {
			moduleName: 'pages/tabs',
			clearHistory: true
		};
		topmost().navigate(navigationEntry);
	}
Exemple #8
0
	public viewSearch() {
		let navigationEntry = {
			moduleName: 'pages/search',
			clearHistory: true
		};
		topmost().navigate(navigationEntry);
	}
function printRunTestStats() {
    var j;
    var testsCount = 0;
    var failedTestCount = 0;
    var failedTestInfo = [];
    for (j = 0; j < testsQueue.length; j++) {
        if (testsQueue[j].isTest) {
            testsCount++;
            if (!testsQueue[j].isPassed) {
                failedTestCount++;
                failedTestInfo.push(testsQueue[j].testName + " FAILED: " + testsQueue[j].errorMessage);
            }
        }
    }
    let finalMessage = "=== ALL TESTS COMPLETE === \n" + (testsCount - failedTestCount) + " OK, " + failedTestCount + " failed" + "\n";
    TKUnit.write(finalMessage, messageType.info);
    for (j = 0; j < failedTestInfo.length; j++) {
        let failureMessage = failedTestInfo[j];
        TKUnit.write(failureMessage, messageType.error);
        finalMessage += "\n" + failureMessage;
    }

    let messageContainer = new TextView();
    messageContainer.text = finalMessage;
    topmost().currentPage.content = messageContainer;
}
Exemple #10
0
	public viewSwitches() {
		let navigationEntry = {
			moduleName: 'pages/switches',
			clearHistory: true
		};
		topmost().navigate(navigationEntry);
	}