advanced cljs compilation on android

This commit is contained in:
Roman Volosovskyi 2017-01-01 18:52:38 +02:00
parent 0ee9bb09ac
commit d57f4847c3
4 changed files with 202 additions and 4 deletions

197
externs/externs.js Normal file
View File

@ -0,0 +1,197 @@
var TopLevel = {
"ActionSheetIOS" : function () {},
"addEntropy" : function () {},
"addEventListener" : function () {},
"addListener" : function () {},
"addOrientationListener" : function () {},
"Alert" : function () {},
"alert" : function () {},
"Animated" : function () {},
"Array" : function () {},
"awesome-phonenumber" : function () {},
"blur" : function () {},
"call" : function () {},
"callJail" : function () {},
"capture" : function () {},
"catch" : function () {},
"Chance" : function () {},
"clearInterval" : function () {},
"clearTimeout" : function () {},
"Clipboard" : function () {},
"cloneWithRows" : function () {},
"close" : function () {},
"closeDrawer" : function () {},
"codec" : function () {},
"completeTransaction" : function () {},
"console" : function () {},
"contentOffset" : function () {},
"contentSize" : function () {},
"create" : function () {},
"createAccount" : function () {},
"data" : function () {},
"Date" : function () {},
"DEBUG" : function () {},
"decay" : function () {},
"decrypt" : function () {},
"default" : function () {},
"defaultPath" : function () {},
"defaultSeparator" : function () {},
"delay" : function () {},
"delete" : function () {},
"deleteAll" : function () {},
"DeviceEventEmitter" : function () {},
"digest" : function () {},
"Dimensions" : function () {},
"disableYellowBox" : function () {},
"discardTransaction" : function () {},
"dy" : function () {},
"encrypt" : function () {},
"ENC_DEC" : function () {},
"end" : function () {},
"endCoordinates" : function () {},
"eth" : function () {},
"getBlock" : function () {},
"event" : function () {},
"fallbacks" : function () {},
"fetch" : function () {},
"filter" : function () {},
"filtered" : function () {},
"find" : function () {},
"finished" : function () {},
"focus" : function () {},
"fromUtf8" : function () {},
"fromWei" : function () {},
"generate" : function () {},
"get" : function () {},
"getAll" : function () {},
"getInitialOrientation" : function () {},
"getLayout" : function () {},
"getNumber" : function () {},
"getTime" : function () {},
"getTimezoneOffset" : function () {},
"goog" : function () {},
"guid" : function () {},
"hash" : function () {},
"height" : function () {},
"hex" : function () {},
"hide" : function () {},
"indexOf" : function () {},
"initialPage" : function () {},
"initJail" : function () {},
"isAddress" : function () {},
"isConnected" : function () {},
"isMatches" : function () {},
"isMobile" : function () {},
"isSyncing" : function () {},
"isValid" : function () {},
"Item" : function () {},
"JSON" : function () {},
"jsonEvent" : function () {},
"Keyboard" : function () {},
"layout" : function () {},
"length" : function () {},
"locale" : function () {},
"lockToPortrait" : function () {},
"log" : function () {},
"login" : function () {},
"map" : function () {},
"Math" : function () {},
"message" : function () {},
"moveFile" : function () {},
"moveY" : function () {},
"nativeEvent" : function () {},
"NativeModules" : function () {},
"objects" : function () {},
"open" : function () {},
"openDrawer" : function () {},
"openPicker" : function () {},
"OS" : function () {},
"p" : function () {},
"panHandlers" : function () {},
"PanResponder" : function () {},
"parallel" : function () {},
"parse" : function () {},
"parseInt" : function () {},
"parseJail" : function () {},
"path" : function () {},
"Platform" : function () {},
"post" : function () {},
"prototype" : function () {},
"push" : function () {},
"random" : function () {},
"randomBytes" : function () {},
"ReactNative" : function () {},
"readFile" : function () {},
"realm-class" : function () {},
"recoverAccount" : function () {},
"registerComponent" : function () {},
"remove" : function () {},
"removeAllListeners" : function () {},
"require" : function () {},
"reset" : function () {},
"reverse" : function () {},
"round" : function () {},
"schema" : function () {},
"schemaVersion" : function () {},
"scrollBy" : function () {},
"scrollTo" : function () {},
"scrollView" : function () {},
"selection" : function () {},
"sendToBridge" : function () {},
"sequence" : function () {},
"set" : function () {},
"setInterval" : function () {},
"setSoftInputMode" : function () {},
"setState" : function () {},
"setString" : function () {},
"setTimeout" : function () {},
"setValue" : function () {},
"Sha256" : function () {},
"shh" : function () {},
"show" : function () {},
"showActionSheetWithOptions" : function () {},
"sjcl" : function () {},
"slice" : function () {},
"sorted" : function () {},
"SplashScreen" : function () {},
"spring" : function () {},
"start" : function () {},
"startNode" : function () {},
"startNodeRPCServer" : function () {},
"startsWith" : function () {},
"Status" : function () {},
"status" : function () {},
"stopAnimation" : function () {},
"stopNodeRPCServer" : function () {},
"stopWatching" : function () {},
"stringify" : function () {},
"t" : function () {},
"Text" : function () {},
"text" : function () {},
"then" : function () {},
"timing" : function () {},
"toBits" : function () {},
"toDecimal" : function () {},
"toLowerCase" : function () {},
"toString" : function () {},
"toUtf8" : function () {},
"translations" : function () {},
"update" : function () {},
"Value" : function () {},
"value" : function () {},
"ValueXY" : function () {},
"View" : function () {},
"vy" : function () {},
"Web3" : function () {},
"web3" : function () {},
"providers" : function () {},
"HttpProvider": function () {},
"width" : function () {},
"window" : function () {},
"write" : function () {},
"x" : function () {},
"y" : function () {},
"_value" : function () {},
"ListView": function() {},
"DataSource": function() {}
};

View File

@ -71,5 +71,6 @@
:output-dir "target/android-prod"
:static-fns true
:optimize-constants true
:optimizations :simple
:optimizations :advanced
:externs ["externs/externs.js"]
:closure-defines {"goog.DEBUG" false}}}]}}})

View File

@ -1,6 +1,4 @@
(ns status-im.android.core
(:require-macros
[natal-shell.back-android :refer [add-event-listener remove-event-listener]])
(:require [reagent.core :as r :refer [atom]]
[re-frame.core :refer [subscribe dispatch dispatch-sync]]
[status-im.handlers]
@ -8,6 +6,7 @@
[status-im.components.react :refer [app-registry
keyboard
orientation
back-android
view
modal
splash-screen]]
@ -44,7 +43,7 @@
(when (< 1 (count @stack))
(dispatch [:navigate-back])
true)))]
(add-event-listener "hardwareBackPress" new-listener)))
(.addEventListener back-android "hardwareBackPress" new-listener)))
(defn orientation->keyword [o]
(keyword (.toLowerCase o)))

View File

@ -12,6 +12,7 @@
(def linear-gradient-module (js/require "react-native-linear-gradient"))
(def dismiss-keyboard! (js/require "dismissKeyboard"))
(def orientation (js/require "react-native-orientation"))
(def back-android (get-react-property "BackAndroid"))
(def drawer (js/require "react-native-drawer-layout"))
(def splash-screen (.-SplashScreen native-modules))