This repository has been archived by the owner on Aug 4, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 97
/
app.ts
52 lines (45 loc) · 1.85 KB
/
app.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import * as application from "tns-core-modules/application";
import * as imageModule from 'nativescript-image';
// import * as frame from "tns-core-modules/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 "tns-core-modules/utils/utils";
// import { time, uptime } from "profiling";
import "nativescript-plugin-firebase";
import { init as initFirebase } from "./common/firebase";
import { init as initAppSync } from "./common/app-sync";
require("./module-registrations");
// 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.
initFirebase();
initAppSync();
if (application.android) {
application.on("launch", args => {
console.log("onLaunch");
imageModule.initialize();
application.android.on("activityStarted", ({activity}) => {
console.log("onStarted");
var window = activity.getWindow();
if (window) {
window.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(0xFF151F2F));
// Prevent the soft keyboard from hiding EditText's while typing.
window.setSoftInputMode(32); //android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN;
}
});
});
}
if (application.ios) {
application.on("launch", args => {
setTimeout(() => {
UIApplication.sharedApplication.keyWindow.backgroundColor = UIColor.blackColor;
}, 1);
});
}
// prof.start("main-page");
application.run({ moduleName: "app-root-page" });