• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript application.on函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中application.on函数的典型用法代码示例。如果您正苦于以下问题:TypeScript on函数的具体用法?TypeScript on怎么用?TypeScript on使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了on函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: setStatusBarColors

export function setStatusBarColors() {
  // Make the iOS status bar transparent with white text.
  if (application.ios) {
    application.on("launch", () => {
      utils.ios.getter(UIApplication, UIApplication.sharedApplication).statusBarStyle = UIStatusBarStyle.LightContent;
    });
  }

  // Make the Android status bar transparent.
  // See http://bradmartin.net/2016/03/10/fullscreen-and-navigation-bar-color-in-a-nativescript-android-app/
  // for details on the technique used.
  if (application.android) {
    application.android.onActivityStarted = function() {
      if (application.android && platform.device.sdkVersion >= "21") {
        const View = android.view.View;
        const window = application.android.startActivity.getWindow();
        window.setStatusBarColor(0x000000);

        const decorView = window.getDecorView();
        decorView.setSystemUiVisibility(
          View.SYSTEM_UI_FLAG_LAYOUT_STABLE
          | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
          | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
          | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
      }
    };
  }
}
开发者ID:EddyVerbruggen,项目名称:sample-Groceries,代码行数:28,代码来源:status-bar-util.ts


示例2: ngAfterViewInit

 ngAfterViewInit() {
     app.on(app.resumeEvent, (args: app.ApplicationEventData) => {
         if (args.android) {
             const dld = new DeepLinkData("", args.android);
             this.launchExample();
         } else if (args.ios) {
             this.launchExample();
         }
     });
 }
开发者ID:yirony199,项目名称:nativescript-sdk-examples-ng,代码行数:10,代码来源:app.component.ts


示例3:

import * as applicationModule from "application";
import * as frescoModule from "nativescript-fresco";

if (applicationModule.android) {
    applicationModule.on("launch", () => {
        frescoModule.initialize();
    });
}

applicationModule.start({ moduleName: "pages/main-page" });
开发者ID:ignaciolarranaga,项目名称:nativescript-fresco,代码行数:10,代码来源:app.ts


示例4:

import * as app from 'application';
import { HockeyApp } from 'nativescript-hockey-sdk';

app.on(app.launchEvent, (args) => {
    // Init HockeyApp SDK
    HockeyApp.init();
});

app.start({ moduleName: 'main-page' });

/*
Do not place any code after the application has been started as it will not
be executed on iOS.
*/
开发者ID:toddanglin,项目名称:nativescript-hockey-sdk,代码行数:14,代码来源:app.ts


示例5: require

import * as application from 'application';
import applicationSettingModule = require("application-settings");
var setString = applicationSettingModule.setString;

application.on(application.uncaughtErrorEvent, function(args) {

	if (args.ios) {
        console.log("NativeScriptError: " + args.ios);
        console.log("Stacktrace: " + args.ios.stack);
        setString("crash", args.ios + args.ios.stack);
	 }
    else if (args.android) {
		  console.log("NativeScriptError: " + args.android);
		  console.log("NativeScriptError: " + args.android.nativeException);
	      console.log("NativeScriptError: " + args.android.nativeException.getMessage());
	      setString("crash", args.android +
	                         args.android.nativeException +
	                         args.android.nativeException.getMessage());
    }
});

application.start({ moduleName: 'main-page' });
开发者ID:AntonioCuevaUrraco,项目名称:nativescript-logEntries,代码行数:22,代码来源:app.ts


示例6: time

import * as application from "application";
import * as frame from "ui/frame";
import * as exampleBase from "./examples/example-base-page";
import * as prof from "./common/profiling";
import * as trace from "trace";
import * as utils from "utils/utils";
import { time, uptime } from "profiling";
import "nativescript-plugin-firebase";

import * as json from "~/package.json";
console.log("App config is: " + JSON.stringify(json));

application.on("displayed", () => {
  var now = time();
  var started = now - uptime();
  console.log("Timeline: Startup time...  (" + started + "ms. - " + now + "ms.)");
});

// The location of this import is important. iOS swizzles the app delegate.
import "./common/firebase";

if (application.android) {
    application.on("launch", args => {
        console.log("onLaunch");
        com.facebook.drawee.backends.pipeline.Fresco.initialize(application.android.context);
        application.android.on("activityStarted", ({activity}) => {
            console.log("onStarted");
            var window = activity.getWindow();
            if (window) {
                window.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(0xFF151F2F));
开发者ID:phattranky,项目名称:nativescript-marketplace-demo,代码行数:30,代码来源:main-common.ts



注:本文中的application.on函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript application.start函数代码示例发布时间:2022-05-25
下一篇:
TypeScript WidgetRole.WidgetRole类代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap