Files: 57f715d7df7dc32f4a285df821933c0f7e0afa97 / index.android.js
1348 bytesRaw
1 | import RNNode from "react-native-node"; |
2 | import { run } from "@cycle/run"; |
3 | import { makeHTTPDriver } from "@cycle/http"; |
4 | import { makeSingleScreenNavDrivers } from "cycle-native-navigation"; |
5 | import onionify from "cycle-onionify"; |
6 | import { navigatorStyle } from "./lib/styles"; |
7 | import apkInstallerDriver from "./lib/drivers/apk-installer"; |
8 | import packageInfoDriver from "./lib/drivers/package-info"; |
9 | import main from "./lib/main"; |
10 | import { NativeModules } from "react-native"; |
11 | |
12 | const { screenVNodeDriver, commandDriver } = makeSingleScreenNavDrivers( |
13 | ["DatInstaller.Central", "DatInstaller.Addition", "DatInstaller.Details"], |
14 | { |
15 | screen: { |
16 | screen: "DatInstaller.Central", |
17 | title: "Dat Installer", |
18 | navigatorStyle: navigatorStyle, |
19 | }, |
20 | }, |
21 | ); |
22 | |
23 | run(onionify(main), { |
24 | screen: screenVNodeDriver, |
25 | navCommand: commandDriver, |
26 | http: makeHTTPDriver(), |
27 | packageInfo: packageInfoDriver, |
28 | installApk: apkInstallerDriver, |
29 | }); |
30 | |
31 | RNNode.start(); |
32 | |
33 | const startedListener = () => { |
34 | RNNode.start(); |
35 | NativeModules.ActivityCallbacks.setStartedListener(startedListener); |
36 | }; |
37 | NativeModules.ActivityCallbacks.setStartedListener(startedListener); |
38 | |
39 | const stoppedListener = () => { |
40 | RNNode.stop(); |
41 | NativeModules.ActivityCallbacks.setStoppedListener(stoppedListener); |
42 | }; |
43 | NativeModules.ActivityCallbacks.setStoppedListener(stoppedListener); |
44 |
Built with git-ssb-web