| @@ -0,0 +1,149 @@ | ||
| apply plugin: "com.android.application" | ||
|
|
||
| import com.android.build.OutputFile | ||
|
|
||
| /** | ||
| * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets | ||
| * and bundleReleaseJsAndAssets). | ||
| * These basically call `react-native bundle` with the correct arguments during the Android build | ||
| * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the | ||
| * bundle directly from the development server. Below you can see all the possible configurations | ||
| * and their defaults. If you decide to add a configuration block, make sure to add it before the | ||
| * `apply from: "../../node_modules/react-native/react.gradle"` line. | ||
| * | ||
| * project.ext.react = [ | ||
| * // the name of the generated asset file containing your JS bundle | ||
| * bundleAssetName: "index.android.bundle", | ||
| * | ||
| * // the entry file for bundle generation | ||
| * entryFile: "index.android.js", | ||
| * | ||
| * // whether to bundle JS and assets in debug mode | ||
| * bundleInDebug: false, | ||
| * | ||
| * // whether to bundle JS and assets in release mode | ||
| * bundleInRelease: true, | ||
| * | ||
| * // whether to bundle JS and assets in another build variant (if configured). | ||
| * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants | ||
| * // The configuration property can be in the following formats | ||
| * // 'bundleIn${productFlavor}${buildType}' | ||
| * // 'bundleIn${buildType}' | ||
| * // bundleInFreeDebug: true, | ||
| * // bundleInPaidRelease: true, | ||
| * // bundleInBeta: true, | ||
| * | ||
| * // whether to disable dev mode in custom build variants (by default only disabled in release) | ||
| * // for example: to disable dev mode in the staging build type (if configured) | ||
| * devDisabledInStaging: true, | ||
| * // The configuration property can be in the following formats | ||
| * // 'devDisabledIn${productFlavor}${buildType}' | ||
| * // 'devDisabledIn${buildType}' | ||
| * | ||
| * // the root of your project, i.e. where "package.json" lives | ||
| * root: "../../", | ||
| * | ||
| * // where to put the JS bundle asset in debug mode | ||
| * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", | ||
| * | ||
| * // where to put the JS bundle asset in release mode | ||
| * jsBundleDirRelease: "$buildDir/intermediates/assets/release", | ||
| * | ||
| * // where to put drawable resources / React Native assets, e.g. the ones you use via | ||
| * // require('./image.png')), in debug mode | ||
| * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", | ||
| * | ||
| * // where to put drawable resources / React Native assets, e.g. the ones you use via | ||
| * // require('./image.png')), in release mode | ||
| * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", | ||
| * | ||
| * // by default the gradle tasks are skipped if none of the JS files or assets change; this means | ||
| * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to | ||
| * // date; if you have any other folders that you want to ignore for performance reasons (gradle | ||
| * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ | ||
| * // for example, you might want to remove it from here. | ||
| * inputExcludes: ["android/**", "ios/**"], | ||
| * | ||
| * // override which node gets called and with what additional arguments | ||
| * nodeExecutableAndArgs: ["node"] | ||
| * | ||
| * // supply additional arguments to the packager | ||
| * extraPackagerArgs: [] | ||
| * ] | ||
| */ | ||
|
|
||
| apply from: "../../node_modules/react-native/react.gradle" | ||
|
|
||
| /** | ||
| * Set this to true to create two separate APKs instead of one: | ||
| * - An APK that only works on ARM devices | ||
| * - An APK that only works on x86 devices | ||
| * The advantage is the size of the APK is reduced by about 4MB. | ||
| * Upload all the APKs to the Play Store and people will download | ||
| * the correct one based on the CPU architecture of their device. | ||
| */ | ||
| def enableSeparateBuildPerCPUArchitecture = false | ||
|
|
||
| /** | ||
| * Run Proguard to shrink the Java bytecode in release builds. | ||
| */ | ||
| def enableProguardInReleaseBuilds = false | ||
|
|
||
| android { | ||
| compileSdkVersion 23 | ||
| buildToolsVersion "23.0.1" | ||
|
|
||
| defaultConfig { | ||
| applicationId "com.starterkit" | ||
| minSdkVersion 16 | ||
| targetSdkVersion 22 | ||
| versionCode 1 | ||
| versionName "1.0" | ||
| ndk { | ||
| abiFilters "armeabi-v7a", "x86" | ||
| } | ||
| } | ||
| splits { | ||
| abi { | ||
| reset() | ||
| enable enableSeparateBuildPerCPUArchitecture | ||
| universalApk false // If true, also generate a universal APK | ||
| include "armeabi-v7a", "x86" | ||
| } | ||
| } | ||
| buildTypes { | ||
| release { | ||
| minifyEnabled enableProguardInReleaseBuilds | ||
| proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" | ||
| } | ||
| } | ||
| // applicationVariants are e.g. debug, release | ||
| applicationVariants.all { variant -> | ||
| variant.outputs.each { output -> | ||
| // For each separate APK per architecture, set a unique version code as described here: | ||
| // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits | ||
| def versionCodes = ["armeabi-v7a":1, "x86":2] | ||
| def abi = output.getFilter(OutputFile.ABI) | ||
| if (abi != null) { // null for the universal-debug, universal-release variants | ||
| output.versionCodeOverride = | ||
| versionCodes.get(abi) * 1048576 + defaultConfig.versionCode | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
| compile project(':react-native-vector-icons') | ||
| compile project(':react-native-google-analytics-bridge') | ||
| compile project(':react-native-device-info') | ||
| compile fileTree(dir: "libs", include: ["*.jar"]) | ||
| compile "com.android.support:appcompat-v7:23.0.1" | ||
| compile "com.facebook.react:react-native:+" // From node_modules | ||
| } | ||
|
|
||
| // Run this once to be able to run the application with BUCK | ||
| // puts all compile dependencies into folder libs for BUCK to use | ||
| task copyDownloadableDepsToLibs(type: Copy) { | ||
| from configurations.compile | ||
| into 'libs' | ||
| } |
| @@ -0,0 +1,66 @@ | ||
| # Add project specific ProGuard rules here. | ||
| # By default, the flags in this file are appended to flags specified | ||
| # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt | ||
| # You can edit the include path and order by changing the proguardFiles | ||
| # directive in build.gradle. | ||
| # | ||
| # For more details, see | ||
| # http://developer.android.com/guide/developing/tools/proguard.html | ||
|
|
||
| # Add any project specific keep options here: | ||
|
|
||
| # If your project uses WebView with JS, uncomment the following | ||
| # and specify the fully qualified class name to the JavaScript interface | ||
| # class: | ||
| #-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
| # public *; | ||
| #} | ||
|
|
||
| # Disabling obfuscation is useful if you collect stack traces from production crashes | ||
| # (unless you are using a system that supports de-obfuscate the stack traces). | ||
| -dontobfuscate | ||
|
|
||
| # React Native | ||
|
|
||
| # Keep our interfaces so they can be used by other ProGuard rules. | ||
| # See http://sourceforge.net/p/proguard/bugs/466/ | ||
| -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip | ||
| -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters | ||
| -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip | ||
|
|
||
| # Do not strip any method/class that is annotated with @DoNotStrip | ||
| -keep @com.facebook.proguard.annotations.DoNotStrip class * | ||
| -keep @com.facebook.common.internal.DoNotStrip class * | ||
| -keepclassmembers class * { | ||
| @com.facebook.proguard.annotations.DoNotStrip *; | ||
| @com.facebook.common.internal.DoNotStrip *; | ||
| } | ||
|
|
||
| -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { | ||
| void set*(***); | ||
| *** get*(); | ||
| } | ||
|
|
||
| -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } | ||
| -keep class * extends com.facebook.react.bridge.NativeModule { *; } | ||
| -keepclassmembers,includedescriptorclasses class * { native <methods>; } | ||
| -keepclassmembers class * { @com.facebook.react.uimanager.UIProp <fields>; } | ||
| -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp <methods>; } | ||
| -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; } | ||
|
|
||
| -dontwarn com.facebook.react.** | ||
|
|
||
| # okhttp | ||
|
|
||
| -keepattributes Signature | ||
| -keepattributes *Annotation* | ||
| -keep class okhttp3.** { *; } | ||
| -keep interface okhttp3.** { *; } | ||
| -dontwarn okhttp3.** | ||
|
|
||
| # okio | ||
|
|
||
| -keep class sun.misc.Unsafe { *; } | ||
| -dontwarn java.nio.file.* | ||
| -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement | ||
| -dontwarn okio.** |
| @@ -0,0 +1,31 @@ | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| package="com.starterkit" | ||
| android:versionCode="1" | ||
| android:versionName="1.0"> | ||
|
|
||
| <uses-permission android:name="android.permission.INTERNET" /> | ||
| <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> | ||
|
|
||
| <uses-sdk | ||
| android:minSdkVersion="16" | ||
| android:targetSdkVersion="22" /> | ||
|
|
||
| <application | ||
| android:name=".MainApplication" | ||
| android:allowBackup="true" | ||
| android:label="@string/app_name" | ||
| android:icon="@mipmap/ic_launcher" | ||
| android:theme="@style/AppTheme"> | ||
| <activity | ||
| android:name=".MainActivity" | ||
| android:label="@string/app_name" | ||
| android:configChanges="keyboard|keyboardHidden|orientation|screenSize"> | ||
| <intent-filter> | ||
| <action android:name="android.intent.action.MAIN" /> | ||
| <category android:name="android.intent.category.LAUNCHER" /> | ||
| </intent-filter> | ||
| </activity> | ||
| <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" /> | ||
| </application> | ||
|
|
||
| </manifest> |
| @@ -0,0 +1,15 @@ | ||
| package com.starterkit; | ||
|
|
||
| import com.facebook.react.ReactActivity; | ||
|
|
||
| public class MainActivity extends ReactActivity { | ||
|
|
||
| /** | ||
| * Returns the name of the main component registered from JavaScript. | ||
| * This is used to schedule rendering of the component. | ||
| */ | ||
| @Override | ||
| protected String getMainComponentName() { | ||
| return "StarterKit"; | ||
| } | ||
| } |
| @@ -0,0 +1,48 @@ | ||
| package com.starterkit; | ||
|
|
||
| import android.app.Application; | ||
| import android.util.Log; | ||
|
|
||
| import com.facebook.react.ReactApplication; | ||
| import com.oblador.vectoricons.VectorIconsPackage; | ||
| import com.idehub.GoogleAnalyticsBridge.GoogleAnalyticsBridgePackage; | ||
| import com.learnium.RNDeviceInfo.RNDeviceInfo; | ||
| import com.facebook.react.ReactInstanceManager; | ||
| import com.facebook.react.ReactNativeHost; | ||
| import com.facebook.react.ReactPackage; | ||
| import com.facebook.react.shell.MainReactPackage; | ||
| import com.facebook.soloader.SoLoader; | ||
|
|
||
| import java.util.Arrays; | ||
| import java.util.List; | ||
|
|
||
| public class MainApplication extends Application implements ReactApplication { | ||
|
|
||
| private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { | ||
| @Override | ||
| public boolean getUseDeveloperSupport() { | ||
| return BuildConfig.DEBUG; | ||
| } | ||
|
|
||
| @Override | ||
| protected List<ReactPackage> getPackages() { | ||
| return Arrays.<ReactPackage>asList( | ||
| new MainReactPackage(), | ||
| new VectorIconsPackage(), | ||
| new GoogleAnalyticsBridgePackage(), | ||
| new RNDeviceInfo() | ||
| ); | ||
| } | ||
| }; | ||
|
|
||
| @Override | ||
| public ReactNativeHost getReactNativeHost() { | ||
| return mReactNativeHost; | ||
| } | ||
|
|
||
| @Override | ||
| public void onCreate() { | ||
| super.onCreate(); | ||
| SoLoader.init(this, /* native exopackage */ false); | ||
| } | ||
| } |
| @@ -0,0 +1,4 @@ | ||
| <resources> | ||
|
|
||
| <string name="app_name">StarterKit</string> | ||
| </resources> |
| @@ -0,0 +1,11 @@ | ||
| <resources> | ||
|
|
||
| <!-- Base application theme. --> | ||
| <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> | ||
| <!-- Customize your theme here. --> | ||
| <item name="colorPrimary">#4099FF</item> | ||
| <!-- Details color --> | ||
| <item name="colorAccent">#4099FF</item> | ||
| </style> | ||
|
|
||
| </resources> |
| @@ -0,0 +1,24 @@ | ||
| // Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
|
|
||
| buildscript { | ||
| repositories { | ||
| jcenter() | ||
| } | ||
| dependencies { | ||
| classpath 'com.android.tools.build:gradle:1.3.1' | ||
|
|
||
| // NOTE: Do not place your application dependencies here; they belong | ||
| // in the individual module build.gradle files | ||
| } | ||
| } | ||
|
|
||
| allprojects { | ||
| repositories { | ||
| mavenLocal() | ||
| jcenter() | ||
| maven { | ||
| // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm | ||
| url "$rootDir/../node_modules/react-native/android" | ||
| } | ||
| } | ||
| } |
| @@ -0,0 +1,20 @@ | ||
| # Project-wide Gradle settings. | ||
|
|
||
| # IDE (e.g. Android Studio) users: | ||
| # Gradle settings configured through the IDE *will override* | ||
| # any settings specified in this file. | ||
|
|
||
| # For more details on how to configure your build environment visit | ||
| # http://www.gradle.org/docs/current/userguide/build_environment.html | ||
|
|
||
| # Specifies the JVM arguments used for the daemon process. | ||
| # The setting is particularly useful for tweaking memory settings. | ||
| # Default value: -Xmx10248m -XX:MaxPermSize=256m | ||
| # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||
|
|
||
| # When configured, Gradle will run in incubating parallel mode. | ||
| # This option should only be used with decoupled projects. More details, visit | ||
| # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | ||
| # org.gradle.parallel=true | ||
|
|
||
| android.useDeprecatedNdk=true |
| @@ -0,0 +1,5 @@ | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip |
| @@ -0,0 +1,164 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| ############################################################################## | ||
| ## | ||
| ## Gradle start up script for UN*X | ||
| ## | ||
| ############################################################################## | ||
|
|
||
| # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||
| DEFAULT_JVM_OPTS="" | ||
|
|
||
| APP_NAME="Gradle" | ||
| APP_BASE_NAME=`basename "$0"` | ||
|
|
||
| # Use the maximum available, or set MAX_FD != -1 to use that value. | ||
| MAX_FD="maximum" | ||
|
|
||
| warn ( ) { | ||
| echo "$*" | ||
| } | ||
|
|
||
| die ( ) { | ||
| echo | ||
| echo "$*" | ||
| echo | ||
| exit 1 | ||
| } | ||
|
|
||
| # OS specific support (must be 'true' or 'false'). | ||
| cygwin=false | ||
| msys=false | ||
| darwin=false | ||
| case "`uname`" in | ||
| CYGWIN* ) | ||
| cygwin=true | ||
| ;; | ||
| Darwin* ) | ||
| darwin=true | ||
| ;; | ||
| MINGW* ) | ||
| msys=true | ||
| ;; | ||
| esac | ||
|
|
||
| # For Cygwin, ensure paths are in UNIX format before anything is touched. | ||
| if $cygwin ; then | ||
| [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` | ||
| fi | ||
|
|
||
| # Attempt to set APP_HOME | ||
| # Resolve links: $0 may be a link | ||
| PRG="$0" | ||
| # Need this for relative symlinks. | ||
| while [ -h "$PRG" ] ; do | ||
| ls=`ls -ld "$PRG"` | ||
| link=`expr "$ls" : '.*-> \(.*\)$'` | ||
| if expr "$link" : '/.*' > /dev/null; then | ||
| PRG="$link" | ||
| else | ||
| PRG=`dirname "$PRG"`"/$link" | ||
| fi | ||
| done | ||
| SAVED="`pwd`" | ||
| cd "`dirname \"$PRG\"`/" >&- | ||
| APP_HOME="`pwd -P`" | ||
| cd "$SAVED" >&- | ||
|
|
||
| CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar | ||
|
|
||
| # Determine the Java command to use to start the JVM. | ||
| if [ -n "$JAVA_HOME" ] ; then | ||
| if [ -x "$JAVA_HOME/jre/sh/java" ] ; then | ||
| # IBM's JDK on AIX uses strange locations for the executables | ||
| JAVACMD="$JAVA_HOME/jre/sh/java" | ||
| else | ||
| JAVACMD="$JAVA_HOME/bin/java" | ||
| fi | ||
| if [ ! -x "$JAVACMD" ] ; then | ||
| die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME | ||
| Please set the JAVA_HOME variable in your environment to match the | ||
| location of your Java installation." | ||
| fi | ||
| else | ||
| JAVACMD="java" | ||
| which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | ||
| Please set the JAVA_HOME variable in your environment to match the | ||
| location of your Java installation." | ||
| fi | ||
|
|
||
| # Increase the maximum file descriptors if we can. | ||
| if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then | ||
| MAX_FD_LIMIT=`ulimit -H -n` | ||
| if [ $? -eq 0 ] ; then | ||
| if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then | ||
| MAX_FD="$MAX_FD_LIMIT" | ||
| fi | ||
| ulimit -n $MAX_FD | ||
| if [ $? -ne 0 ] ; then | ||
| warn "Could not set maximum file descriptor limit: $MAX_FD" | ||
| fi | ||
| else | ||
| warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" | ||
| fi | ||
| fi | ||
|
|
||
| # For Darwin, add options to specify how the application appears in the dock | ||
| if $darwin; then | ||
| GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" | ||
| fi | ||
|
|
||
| # For Cygwin, switch paths to Windows format before running java | ||
| if $cygwin ; then | ||
| APP_HOME=`cygpath --path --mixed "$APP_HOME"` | ||
| CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` | ||
|
|
||
| # We build the pattern for arguments to be converted via cygpath | ||
| ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` | ||
| SEP="" | ||
| for dir in $ROOTDIRSRAW ; do | ||
| ROOTDIRS="$ROOTDIRS$SEP$dir" | ||
| SEP="|" | ||
| done | ||
| OURCYGPATTERN="(^($ROOTDIRS))" | ||
| # Add a user-defined pattern to the cygpath arguments | ||
| if [ "$GRADLE_CYGPATTERN" != "" ] ; then | ||
| OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" | ||
| fi | ||
| # Now convert the arguments - kludge to limit ourselves to /bin/sh | ||
| i=0 | ||
| for arg in "$@" ; do | ||
| CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` | ||
| CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option | ||
|
|
||
| if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition | ||
| eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` | ||
| else | ||
| eval `echo args$i`="\"$arg\"" | ||
| fi | ||
| i=$((i+1)) | ||
| done | ||
| case $i in | ||
| (0) set -- ;; | ||
| (1) set -- "$args0" ;; | ||
| (2) set -- "$args0" "$args1" ;; | ||
| (3) set -- "$args0" "$args1" "$args2" ;; | ||
| (4) set -- "$args0" "$args1" "$args2" "$args3" ;; | ||
| (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; | ||
| (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; | ||
| (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; | ||
| (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; | ||
| (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; | ||
| esac | ||
| fi | ||
|
|
||
| # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules | ||
| function splitJvmOpts() { | ||
| JVM_OPTS=("$@") | ||
| } | ||
| eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS | ||
| JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" | ||
|
|
||
| exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" |
| @@ -0,0 +1,90 @@ | ||
| @if "%DEBUG%" == "" @echo off | ||
| @rem ########################################################################## | ||
| @rem | ||
| @rem Gradle startup script for Windows | ||
| @rem | ||
| @rem ########################################################################## | ||
|
|
||
| @rem Set local scope for the variables with windows NT shell | ||
| if "%OS%"=="Windows_NT" setlocal | ||
|
|
||
| @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||
| set DEFAULT_JVM_OPTS= | ||
|
|
||
| set DIRNAME=%~dp0 | ||
| if "%DIRNAME%" == "" set DIRNAME=. | ||
| set APP_BASE_NAME=%~n0 | ||
| set APP_HOME=%DIRNAME% | ||
|
|
||
| @rem Find java.exe | ||
| if defined JAVA_HOME goto findJavaFromJavaHome | ||
|
|
||
| set JAVA_EXE=java.exe | ||
| %JAVA_EXE% -version >NUL 2>&1 | ||
| if "%ERRORLEVEL%" == "0" goto init | ||
|
|
||
| echo. | ||
| echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | ||
| echo. | ||
| echo Please set the JAVA_HOME variable in your environment to match the | ||
| echo location of your Java installation. | ||
|
|
||
| goto fail | ||
|
|
||
| :findJavaFromJavaHome | ||
| set JAVA_HOME=%JAVA_HOME:"=% | ||
| set JAVA_EXE=%JAVA_HOME%/bin/java.exe | ||
|
|
||
| if exist "%JAVA_EXE%" goto init | ||
|
|
||
| echo. | ||
| echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% | ||
| echo. | ||
| echo Please set the JAVA_HOME variable in your environment to match the | ||
| echo location of your Java installation. | ||
|
|
||
| goto fail | ||
|
|
||
| :init | ||
| @rem Get command-line arguments, handling Windowz variants | ||
|
|
||
| if not "%OS%" == "Windows_NT" goto win9xME_args | ||
| if "%@eval[2+2]" == "4" goto 4NT_args | ||
|
|
||
| :win9xME_args | ||
| @rem Slurp the command line arguments. | ||
| set CMD_LINE_ARGS= | ||
| set _SKIP=2 | ||
|
|
||
| :win9xME_args_slurp | ||
| if "x%~1" == "x" goto execute | ||
|
|
||
| set CMD_LINE_ARGS=%* | ||
| goto execute | ||
|
|
||
| :4NT_args | ||
| @rem Get arguments from the 4NT Shell from JP Software | ||
| set CMD_LINE_ARGS=%$ | ||
|
|
||
| :execute | ||
| @rem Setup the command line | ||
|
|
||
| set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar | ||
|
|
||
| @rem Execute Gradle | ||
| "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% | ||
|
|
||
| :end | ||
| @rem End local scope for the variables with windows NT shell | ||
| if "%ERRORLEVEL%"=="0" goto mainEnd | ||
|
|
||
| :fail | ||
| rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of | ||
| rem the _cmd.exe /c_ return code! | ||
| if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 | ||
| exit /b 1 | ||
|
|
||
| :mainEnd | ||
| if "%OS%"=="Windows_NT" endlocal | ||
|
|
||
| :omega |
| @@ -0,0 +1,8 @@ | ||
| keystore( | ||
| name = 'debug', | ||
| store = 'debug.keystore', | ||
| properties = 'debug.keystore.properties', | ||
| visibility = [ | ||
| 'PUBLIC', | ||
| ], | ||
| ) |
| @@ -0,0 +1,4 @@ | ||
| key.store=debug.keystore | ||
| key.alias=androiddebugkey | ||
| key.store.password=android | ||
| key.alias.password=android |
| @@ -0,0 +1,9 @@ | ||
| rootProject.name = 'StarterKit' | ||
| include ':react-native-vector-icons' | ||
| project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android') | ||
| include ':react-native-google-analytics-bridge' | ||
| project(':react-native-google-analytics-bridge').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-google-analytics-bridge/android') | ||
| include ':react-native-device-info' | ||
| project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android') | ||
|
|
||
| include ':app' |
| @@ -0,0 +1,30 @@ | ||
| # Contributing | ||
|
|
||
| Love to hear any feedback or tips to improve - submit an issue or a fix via a pull request. | ||
|
|
||
| Please ensure you're following the below rules before submitting a PR: | ||
|
|
||
| ## Naming Conventions | ||
|
|
||
| Please follow [Airbnb's Name Conventions](https://github.com/airbnb/javascript#naming-conventions) from the style guide. | ||
|
|
||
| ## File Structure & Naming Conventions | ||
|
|
||
| - __Structure__ | ||
| - Follow the file structure [outlined above](#32-file-structure) | ||
| - __Files__ | ||
| - Should be `lowercase`, with words separated by hyphens (`-`) eg. `logo-cropped.jpg` | ||
| - With the exception of Containers and Components, which should be `PascalCase` - eg. `RecipeView.js` | ||
| - __Directories__ | ||
| - Folder names should be `lowercase,` with words separated by a hyphen (`-`) - eg. `/components/case-studies` | ||
| - Folders and files can be named singular or plural - do what sounds right | ||
| - If there's more than 1 file in a directory that are related, group them within their own directory | ||
| - eg. if I have 2 components: `/components/RecipeListing.js` and `/components/RecipeView.js`, create a new directory within components called `recipes` and put the 2 files within (removing `Recipes`). The result would be: `/components/recipes/Listing.js` and `/components/recipes/View.js` | ||
|
|
||
| ## Linting | ||
|
|
||
| Please ensure you're code is passing the built in linter. | ||
|
|
||
| ## Tests | ||
|
|
||
| Please include tests with your code and ensure your code is passing the existing tests. |
| @@ -0,0 +1,19 @@ | ||
| # Google Analytics | ||
|
|
||
| The app routing runs through React Native Router Flux. We've applied a middleware to Redux to track each screen view, and send the data to Google Analytics. | ||
|
|
||
| You could also extend the `/src/lib/analytics.js` middleware to include other tracking codes too. By default we've just included Google Analytics. | ||
|
|
||
| ## Usage | ||
|
|
||
| ### Step 1. Google Analytics tracking code | ||
|
|
||
| Setup your Google Analytics account and simply paste the tracking code to into the `gaTrackingId` variable in `/src/constants/config.js` | ||
|
|
||
| FYI you can have separate tracking codes for debug (to test tracking when your developing in debug mode) and production. | ||
|
|
||
| ### Step 2. Screen Name/Description | ||
|
|
||
| When setting up new scene to navigate to in `/src/navigation/index.js`, simply add the prop `analyticsDesc` to your scene. The value of this prop will be sent to Google Analytics, prefixed to the `title` prop (if that exists). | ||
|
|
||
| I usually like to send the `{Component Name}`: `{Description of Screen}` - `{Navbar Title}`. That way I can filter down to the data I need within Analytics. |
| @@ -0,0 +1,32 @@ | ||
| # Opinions Guiding this Project | ||
|
|
||
| By no means is this the 'right' or 'only' way to build a React Native App. We have however, worked on various apps built with React Native, that are 'in the wild' right now. So the ideas presented here are simply based on our experience. | ||
|
|
||
| We hope to explain our opinions here - but keep in mind they may change over time as we learn more. | ||
|
|
||
| ## Create wrapper components | ||
|
|
||
| You'll notice in `/src/components/ui/` that we have various UI elements - some of them don't do much more than call the default React Native component and pass in a style. | ||
|
|
||
| We do this: | ||
|
|
||
| - so that we can pass in default props - eg. default styles or perhaps a default activeOpacity | ||
| - if an API changes, or perhaps we want to switch out a library, we can do it in one place - not throughout the entire codebase | ||
|
|
||
| ## Code Style Guide | ||
|
|
||
| We're using [Airbnb's](https://github.com/airbnb/javascript) JS/React Style Guide with ESLint linting. We just like it :) | ||
|
|
||
| ## React Native Directory Aliases | ||
|
|
||
| We import files absolutely like so: | ||
|
|
||
| ``` | ||
| import Error from '@components/general/Error' | ||
| ``` | ||
|
|
||
| Because it's: | ||
|
|
||
| - less confusing to write - no more trying to figure out how deeply you're nested when importing files | ||
| - simpler to read | ||
| - when you move a file, it's easier to find/replace - the imports are always the same |
| @@ -0,0 +1,34 @@ | ||
| # React Native Quick Tips | ||
|
|
||
| ## Running in an Emulator | ||
|
|
||
| ### iOS | ||
|
|
||
| - Open the /ios/StarterKit.xcodeproj file in Xcode | ||
| - Select the iOS simulator then press the Play (triangle) icon at the top left | ||
|
|
||
| ### Android | ||
|
|
||
| - From terminal, run `android avd`. This will open the Android Virtual Device Manager. Select a device to open. | ||
| - In a new terminal window, enter the root directory of the project, then run: `react-native run-android` | ||
|
|
||
| ## Running on Device | ||
|
|
||
| - [iOS Guide](https://facebook.github.io/react-native/docs/running-on-device-ios.html) | ||
| - [Android Guide](https://facebook.github.io/react-native/docs/running-on-device-android.html) | ||
|
|
||
| ## Opening the Debug Menu | ||
|
|
||
| - **iOS** - CMD + D | ||
| - **Android** - CMD + M | ||
|
|
||
| ## Reload | ||
|
|
||
| - **iOS** - CMD + R | ||
| - **Android** - Double tap R on your keyboard | ||
|
|
||
| ## App Icons | ||
|
|
||
| - [Generate the Icons](https://makeappicon.com/) | ||
| - **iOS** - Place the contents into: `/ios/StarterKit/Images.xcassets/AppIcon.appiconset` | ||
| - **Android** - Place the contents into: `/android/app/src/main/res/mipmap-*/ic_launcher.png` |
| @@ -0,0 +1,26 @@ | ||
| # Getting Started with React Native | ||
|
|
||
| ## Setting Up Your Machine for App Development | ||
|
|
||
| - iOS (You require a Mac to develop iOS Apps) Simply download XCode | ||
| - [Android on Mac](https://medium.com/pvtl/react-native-android-development-on-mac-ef7481f65e47#.w2hel88zy) | ||
| - Android on Windows - coming soon... | ||
|
|
||
| ## Install React Native | ||
|
|
||
| [React Native - Get Started Guide](https://facebook.github.io/react-native/docs/getting-started.html) | ||
|
|
||
| ## Learn React | ||
|
|
||
| [React Native Express](http://www.reactnativeexpress.com/) is a great site to get you started, specifically: | ||
|
|
||
| - [Get your head around ES6](http://www.reactnativeexpress.com/es6) | ||
| - [What is JSX?](http://www.reactnativeexpress.com/jsx) | ||
| - [What are Components?](http://www.reactnativeexpress.com/components) | ||
| - [React State](http://www.reactnativeexpress.com/data_component_state) | ||
| - [Redux](http://www.reactnativeexpress.com/redux) | ||
|
|
||
| Once you've got your head around the basics, checkout the [React Native](https://facebook.github.io/react-native/) website, specifically: | ||
|
|
||
| - Go through ['The Basics'](https://facebook.github.io/react-native/docs/props.html) | ||
| - Gain an understanding of the [components](https://facebook.github.io/react-native/docs/activityindicator.html) React Native provides out of the box |
| @@ -0,0 +1,18 @@ | ||
| # Renaming the App from StarterKit | ||
|
|
||
| You've cloned the project and you're wanting to make it your own. But..."StarterKit". | ||
| With one command, [React Native Rename](https://github.com/JuneDomingo/react-native-rename) will replace all files, directories and references of 'StarterKit' to what ever you'd like. | ||
|
|
||
| ## Install the Package | ||
|
|
||
| ``` | ||
| npm install react-native-rename -g | ||
| ``` | ||
|
|
||
| ## Rename the App | ||
|
|
||
| ``` | ||
| react-native-rename YourNewApp | ||
| ``` | ||
|
|
||
| Piece of :cake: |
| @@ -0,0 +1,22 @@ | ||
| # Testing | ||
|
|
||
| ## Linting (with eslint) | ||
|
|
||
| Want to check if your code is formatted consistently + pick up on any syntax errors: | ||
|
|
||
| ``` | ||
| ./node_modules/.bin/eslint "src/**/*.js" | ||
| ``` | ||
|
|
||
| ## Jest Snapshots | ||
|
|
||
| Run `npm test` to run a test add `-- --watch` to run it in developer mode. | ||
|
|
||
| To run an individual Jest test: | ||
| * Run `jest path/to/test.js` if you have Jest installed globally | ||
| * Run `node_modules/.bin/jest path/to/test.js` to use the projects Jest installation | ||
|
|
||
| Tests should be placed in their related parents folder to keep consistency, i.e __components/\_\_tests\_\___ or __containers/\_\_tests\_\___ | ||
|
|
||
| - (Snapshot testing) https://facebook.github.io/jest/docs/tutorial-react-native.html#snapshot-test | ||
| - (DOM testing WIP) https://facebook.github.io/jest/docs/tutorial-react.html#dom-testing |
| @@ -0,0 +1,3 @@ | ||
| .firebaserc | ||
| firebase.json | ||
| firebase-debug.log |
| @@ -0,0 +1,25 @@ | ||
| # Firebase Cloud Functions | ||
|
|
||
| [Learn more](https://firebase.google.com/docs/functions/) about this tool. | ||
|
|
||
| This repo comes with a couple of handy examples, to get you up and running. You can find out what they do by [reading the comments](/firebase-cloud-functions/functions/index.js). | ||
|
|
||
| ## Deploy | ||
|
|
||
| Once you've setup a Firebase account + project: | ||
|
|
||
| ``` | ||
| # From the /firebase-cloud-functions directory: | ||
| # Install the Node dependencies | ||
| cd functions && npm i && cd ../ | ||
| # Install the Firebase-Cli on your computer | ||
| npm install -g firebase-tools | ||
| # Login to Firebase | ||
| firebase login | ||
| # Initialise the project | ||
| firebase init | ||
| ``` |
| @@ -0,0 +1,43 @@ | ||
| /** | ||
| * React Native Starter Kit - Firebase Cloud Functions | ||
| * - A collection of example cloud functions to use with this project | ||
| * | ||
| * React Native Starter App | ||
| * https://github.com/mcnamee/react-native-starter-app | ||
| */ | ||
| const functions = require('firebase-functions'); | ||
| const admin = require('firebase-admin'); | ||
|
|
||
| admin.initializeApp(functions.config().firebase); | ||
|
|
||
| /** | ||
| * Listens for updates to /users/:userId and creates an | ||
| * full name attribute based on the first and last names | ||
| */ | ||
| exports.cleanUserData = functions.database.ref('/users/{userId}').onWrite((event) => { | ||
| console.log('Making Full Name for UserID:', event.params.userId); | ||
|
|
||
| // Get the first and last names | ||
| const firstName = event.data._newData.firstName || ''; | ||
| const lastName = event.data._newData.lastName || ''; | ||
|
|
||
| const userData = { | ||
| fullName: `${firstName} ${lastName}`, | ||
| }; | ||
|
|
||
| // Add Role if it doesn't already exist | ||
| if (event && event.data && event.data._data && !event.data._newData.role) { | ||
| userData.role = 'user'; | ||
| } | ||
|
|
||
| return event.data.ref.update(userData); | ||
| }); | ||
|
|
||
| /** | ||
| * Listens for user deletion and | ||
| * - deletes the user's reference in the database | ||
| */ | ||
| exports.deleteUserData = functions.auth.user().onDelete((event) => { | ||
| const uid = event.data.uid; | ||
| return admin.database().ref(`/users/${uid}`).remove(); | ||
| }); |
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "name": "rnsk-firebase-cloud-functions", | ||
| "description": "React Native Starter Kit Firebase Cloud Functions", | ||
| "dependencies": { | ||
| "firebase-admin": "^4.1.1", | ||
| "firebase-functions": "^0.5.1" | ||
| }, | ||
| "devDependencies": { | ||
| "chai": "^3.5.0", | ||
| "chai-as-promised": "^6.0.0", | ||
| "mocha": "^3.2.0", | ||
| "sinon": "^1.17.7" | ||
| }, | ||
| "scripts": { | ||
| "test": "./node_modules/.bin/mocha --reporter spec" | ||
| } | ||
| } |
| @@ -0,0 +1,282 @@ | ||
| { | ||
| "users": { | ||
| }, | ||
| "favourites": { | ||
| }, | ||
| "meals": [ | ||
| { | ||
| "id": 1, | ||
| "title": "Lunch" | ||
| }, | ||
| { | ||
| "id": 2, | ||
| "title": "Dinner" | ||
| } | ||
| ], | ||
| "recipes" : [ | ||
| { | ||
| "id": 1, | ||
| "slug": "this-is-an-article", | ||
| "title": "This is an Article", | ||
| "body": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.", | ||
| "author": "John Smith", | ||
| "category": 1, | ||
| "image": "https://firebasestorage.googleapis.com/v0/b/react-native-starter-app.appspot.com/o/image-1.jpg?alt=media&token=9f7c839b-2d40-4660-a2a0-bf6c2f64a2e5", | ||
| "ingredients": [ | ||
| "sed do eiusmod tempor incididunt", | ||
| "aute irure dolor in", | ||
| "do eiusmod tempor", | ||
| "uis aute irure dolor in", | ||
| "doloremque laudantium", | ||
| "cupidatat non proident" | ||
| ], | ||
| "method": [ | ||
| "iste natus error sit voluptatem accusantium doloremque laudantium", | ||
| "magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet", | ||
| "sed quia non numquam eius modi tempora incidunt ut labore" | ||
| ] | ||
| }, | ||
| { | ||
| "id": 2, | ||
| "slug": "dummy-text-of-the-printing", | ||
| "title": "Dummy text of the printing", | ||
| "body": "Typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.", | ||
| "author": "Jane Doe", | ||
| "category": 2, | ||
| "image": "https://firebasestorage.googleapis.com/v0/b/react-native-starter-app.appspot.com/o/image-2.jpg?alt=media&token=6ed1740b-529b-4772-9a92-615e92b544b2", | ||
| "ingredients": [ | ||
| "sed do eiusmod tempor incididunt", | ||
| "aute irure dolor in", | ||
| "do eiusmod tempor", | ||
| "uis aute irure dolor in", | ||
| "doloremque laudantium", | ||
| "cupidatat non proident" | ||
| ], | ||
| "method": [ | ||
| "iste natus error sit voluptatem accusantium doloremque laudantium", | ||
| "magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet", | ||
| "sed quia non numquam eius modi tempora incidunt ut labore" | ||
| ] | ||
| }, | ||
| { | ||
| "id": 3, | ||
| "slug": "survived-not-only-five", | ||
| "title": "Survived not only five", | ||
| "body": "Simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.", | ||
| "author": "Jane Doe", | ||
| "category": 1, | ||
| "image": "https://firebasestorage.googleapis.com/v0/b/react-native-starter-app.appspot.com/o/image-3.jpg?alt=media&token=ad0c1913-fd82-48fa-937c-4298875544fa", | ||
| "ingredients": [ | ||
| "sed do eiusmod tempor incididunt", | ||
| "aute irure dolor in", | ||
| "do eiusmod tempor", | ||
| "uis aute irure dolor in", | ||
| "doloremque laudantium", | ||
| "cupidatat non proident" | ||
| ], | ||
| "method": [ | ||
| "iste natus error sit voluptatem accusantium doloremque laudantium", | ||
| "magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet", | ||
| "sed quia non numquam eius modi tempora incidunt ut labore" | ||
| ] | ||
| }, | ||
| { | ||
| "id": 4, | ||
| "slug": "standard-dummy-text-ever", | ||
| "title": "Standard dummy text ever", | ||
| "body": "Has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.", | ||
| "author": "John Smith", | ||
| "category": 2, | ||
| "image": "https://firebasestorage.googleapis.com/v0/b/react-native-starter-app.appspot.com/o/image-4.jpg?alt=media&token=52d5ab1a-98af-42cb-adaf-da04666a7953", | ||
| "ingredients": [ | ||
| "sed do eiusmod tempor incididunt", | ||
| "aute irure dolor in", | ||
| "do eiusmod tempor", | ||
| "uis aute irure dolor in", | ||
| "doloremque laudantium", | ||
| "cupidatat non proident" | ||
| ], | ||
| "method": [ | ||
| "iste natus error sit voluptatem accusantium doloremque laudantium", | ||
| "magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet", | ||
| "sed quia non numquam eius modi tempora incidunt ut labore" | ||
| ] | ||
| }, | ||
| { | ||
| "id": 5, | ||
| "slug": "remaining-essentially-unchanged", | ||
| "title": "Remaining essentially unchanged", | ||
| "body": "Industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.", | ||
| "author": "John Smith", | ||
| "category": 2, | ||
| "image": "https://firebasestorage.googleapis.com/v0/b/react-native-starter-app.appspot.com/o/image-1.jpg?alt=media&token=9f7c839b-2d40-4660-a2a0-bf6c2f64a2e5", | ||
| "ingredients": [ | ||
| "sed do eiusmod tempor incididunt", | ||
| "aute irure dolor in", | ||
| "do eiusmod tempor", | ||
| "uis aute irure dolor in", | ||
| "doloremque laudantium", | ||
| "cupidatat non proident" | ||
| ], | ||
| "method": [ | ||
| "iste natus error sit voluptatem accusantium doloremque laudantium", | ||
| "magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet", | ||
| "sed quia non numquam eius modi tempora incidunt ut labore" | ||
| ] | ||
| }, | ||
| { | ||
| "id": 6, | ||
| "slug": "only-five-centuries", | ||
| "title": "Only five centuries", | ||
| "body": "Standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.", | ||
| "author": "John Smith", | ||
| "category": 2, | ||
| "image": "https://firebasestorage.googleapis.com/v0/b/react-native-starter-app.appspot.com/o/image-2.jpg?alt=media&token=6ed1740b-529b-4772-9a92-615e92b544b2", | ||
| "ingredients": [ | ||
| "sed do eiusmod tempor incididunt", | ||
| "aute irure dolor in", | ||
| "do eiusmod tempor", | ||
| "uis aute irure dolor in", | ||
| "doloremque laudantium", | ||
| "cupidatat non proident" | ||
| ], | ||
| "method": [ | ||
| "iste natus error sit voluptatem accusantium doloremque laudantium", | ||
| "magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet", | ||
| "sed quia non numquam eius modi tempora incidunt ut labore" | ||
| ] | ||
| }, | ||
| { | ||
| "id": 7, | ||
| "slug": "but-also-the-leap-into", | ||
| "title": "But also the leap into", | ||
| "body": "Dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.", | ||
| "author": "Jane Doe", | ||
| "category": 1, | ||
| "image": "https://firebasestorage.googleapis.com/v0/b/react-native-starter-app.appspot.com/o/image-1.jpg?alt=media&token=9f7c839b-2d40-4660-a2a0-bf6c2f64a2e5", | ||
| "ingredients": [ | ||
| "aute irure dolor in", | ||
| "sed do eiusmod tempor incididunt", | ||
| "do eiusmod tempor", | ||
| "uis aute irure dolor in", | ||
| "doloremque laudantium", | ||
| "cupidatat non proident" | ||
| ], | ||
| "method": [ | ||
| "magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet", | ||
| "iste natus error sit voluptatem accusantium doloremque laudantium", | ||
| "sed quia non numquam eius modi tempora incidunt ut labore" | ||
| ] | ||
| }, | ||
| { | ||
| "id": 8, | ||
| "slug": "electronic-typesetting", | ||
| "title": "Electronic typesetting", | ||
| "body": "Text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.", | ||
| "author": "John Smith", | ||
| "category": 2, | ||
| "image": "https://firebasestorage.googleapis.com/v0/b/react-native-starter-app.appspot.com/o/image-1.jpg?alt=media&token=9f7c839b-2d40-4660-a2a0-bf6c2f64a2e5", | ||
| "ingredients": [ | ||
| "sed do eiusmod tempor incididunt", | ||
| "aute irure dolor in", | ||
| "do eiusmod tempor", | ||
| "uis aute irure dolor in", | ||
| "doloremque laudantium", | ||
| "cupidatat non proident" | ||
| ], | ||
| "method": [ | ||
| "iste natus error sit voluptatem accusantium doloremque laudantium", | ||
| "magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet", | ||
| "sed quia non numquam eius modi tempora incidunt ut labore" | ||
| ] | ||
| }, | ||
| { | ||
| "id": 9, | ||
| "slug": "essentially-unchanged", | ||
| "title": "Essentially unchanged", | ||
| "body": "Industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.", | ||
| "author": "John Smith", | ||
| "category": 2, | ||
| "image": "https://firebasestorage.googleapis.com/v0/b/react-native-starter-app.appspot.com/o/image-2.jpg?alt=media&token=6ed1740b-529b-4772-9a92-615e92b544b2", | ||
| "ingredients": [ | ||
| "sed do eiusmod tempor incididunt", | ||
| "aute irure dolor in", | ||
| "do eiusmod tempor", | ||
| "uis aute irure dolor in", | ||
| "doloremque laudantium", | ||
| "cupidatat non proident" | ||
| ], | ||
| "method": [ | ||
| "iste natus error sit voluptatem accusantium doloremque laudantium", | ||
| "magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet", | ||
| "sed quia non numquam eius modi tempora incidunt ut labore" | ||
| ] | ||
| }, | ||
| { | ||
| "id": 10, | ||
| "slug": "standard-text", | ||
| "title": "Standard text", | ||
| "body": "Unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.", | ||
| "author": "Jane Doe", | ||
| "category": 2, | ||
| "image": "https://firebasestorage.googleapis.com/v0/b/react-native-starter-app.appspot.com/o/image-1.jpg?alt=media&token=9f7c839b-2d40-4660-a2a0-bf6c2f64a2e5", | ||
| "ingredients": [ | ||
| "sed do eiusmod tempor incididunt", | ||
| "aute irure dolor in", | ||
| "do eiusmod tempor", | ||
| "uis aute irure dolor in", | ||
| "doloremque laudantium", | ||
| "cupidatat non proident" | ||
| ], | ||
| "method": [ | ||
| "iste natus error sit voluptatem accusantium doloremque laudantium", | ||
| "magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet", | ||
| "sed quia non numquam eius modi tempora incidunt ut labore" | ||
| ] | ||
| }, | ||
| { | ||
| "id": 11, | ||
| "slug": "but-also", | ||
| "title": "But also", | ||
| "body": "Industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.", | ||
| "author": "John Smith", | ||
| "category": 2, | ||
| "image": "https://firebasestorage.googleapis.com/v0/b/react-native-starter-app.appspot.com/o/image-3.jpg?alt=media&token=ad0c1913-fd82-48fa-937c-4298875544fa", | ||
| "ingredients": [ | ||
| "sed do eiusmod tempor incididunt", | ||
| "aute irure dolor in", | ||
| "do eiusmod tempor", | ||
| "uis aute irure dolor in", | ||
| "doloremque laudantium", | ||
| "cupidatat non proident" | ||
| ], | ||
| "method": [ | ||
| "iste natus error sit voluptatem accusantium doloremque laudantium", | ||
| "magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet", | ||
| "sed quia non numquam eius modi tempora incidunt ut labore" | ||
| ] | ||
| }, | ||
| { | ||
| "id": 12, | ||
| "slug": "text-but-also", | ||
| "title": "Text But also", | ||
| "body": "Industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.", | ||
| "author": "John Smith", | ||
| "category": 2, | ||
| "image": "https://firebasestorage.googleapis.com/v0/b/react-native-starter-app.appspot.com/o/image-2.jpg?alt=media&token=6ed1740b-529b-4772-9a92-615e92b544b2", | ||
| "ingredients": [ | ||
| "sed do eiusmod tempor incididunt", | ||
| "aute irure dolor in", | ||
| "do eiusmod tempor", | ||
| "uis aute irure dolor in", | ||
| "doloremque laudantium", | ||
| "cupidatat non proident" | ||
| ], | ||
| "method": [ | ||
| "iste natus error sit voluptatem accusantium doloremque laudantium", | ||
| "magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet", | ||
| "sed quia non numquam eius modi tempora incidunt ut labore" | ||
| ] | ||
| } | ||
| ] | ||
| } |
| @@ -0,0 +1,12 @@ | ||
| /** | ||
| * Load the App component. | ||
| * (All the fun stuff happens in "/src/index.js") | ||
| * | ||
| * React Native Starter App | ||
| * https://github.com/mcnamee/react-native-starter-app | ||
| */ | ||
|
|
||
| import { AppRegistry } from 'react-native'; | ||
| import AppContainer from './src/'; | ||
|
|
||
| AppRegistry.registerComponent('StarterKit', () => AppContainer); |
| @@ -0,0 +1,12 @@ | ||
| /** | ||
| * Load the App component. | ||
| * (All the fun stuff happens in "/src/index.js") | ||
| * | ||
| * React Native Starter App | ||
| * https://github.com/mcnamee/react-native-starter-app | ||
| */ | ||
|
|
||
| import { AppRegistry } from 'react-native'; | ||
| import AppContainer from './src/'; | ||
|
|
||
| AppRegistry.registerComponent('StarterKit', () => AppContainer); |
| @@ -0,0 +1,136 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <Scheme | ||
| LastUpgradeVersion = "0620" | ||
| version = "1.3"> | ||
| <BuildAction | ||
| parallelizeBuildables = "NO" | ||
| buildImplicitDependencies = "YES"> | ||
| <BuildActionEntries> | ||
| <BuildActionEntry | ||
| buildForTesting = "YES" | ||
| buildForRunning = "YES" | ||
| buildForProfiling = "YES" | ||
| buildForArchiving = "YES" | ||
| buildForAnalyzing = "YES"> | ||
| <BuildableReference | ||
| BuildableIdentifier = "primary" | ||
| BlueprintIdentifier = "83CBBA2D1A601D0E00E9B192" | ||
| BuildableName = "libReact.a" | ||
| BlueprintName = "React" | ||
| ReferencedContainer = "container:../node_modules/react-native/React/React.xcodeproj"> | ||
| </BuildableReference> | ||
| </BuildActionEntry> | ||
| <BuildActionEntry | ||
| buildForTesting = "YES" | ||
| buildForRunning = "YES" | ||
| buildForProfiling = "YES" | ||
| buildForArchiving = "YES" | ||
| buildForAnalyzing = "YES"> | ||
| <BuildableReference | ||
| BuildableIdentifier = "primary" | ||
| BlueprintIdentifier = "13B07F861A680F5B00A75B9A" | ||
| BuildableName = "StarterKit.app" | ||
| BlueprintName = "StarterKit" | ||
| ReferencedContainer = "container:StarterKit.xcodeproj"> | ||
| </BuildableReference> | ||
| </BuildActionEntry> | ||
| <BuildActionEntry | ||
| buildForTesting = "YES" | ||
| buildForRunning = "YES" | ||
| buildForProfiling = "NO" | ||
| buildForArchiving = "NO" | ||
| buildForAnalyzing = "YES"> | ||
| <BuildableReference | ||
| BuildableIdentifier = "primary" | ||
| BlueprintIdentifier = "00E356ED1AD99517003FC87E" | ||
| BuildableName = "StarterKitTests.xctest" | ||
| BlueprintName = "StarterKitTests" | ||
| ReferencedContainer = "container:StarterKit.xcodeproj"> | ||
| </BuildableReference> | ||
| </BuildActionEntry> | ||
| </BuildActionEntries> | ||
| </BuildAction> | ||
| <TestAction | ||
| buildConfiguration = "Debug" | ||
| selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
| selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
| shouldUseLaunchSchemeArgsEnv = "YES"> | ||
| <Testables> | ||
| <TestableReference | ||
| skipped = "NO"> | ||
| <BuildableReference | ||
| BuildableIdentifier = "primary" | ||
| BlueprintIdentifier = "00E356ED1AD99517003FC87E" | ||
| BuildableName = "StarterKitTests.xctest" | ||
| BlueprintName = "StarterKitTests" | ||
| ReferencedContainer = "container:StarterKit.xcodeproj"> | ||
| </BuildableReference> | ||
| </TestableReference> | ||
| </Testables> | ||
| <MacroExpansion> | ||
| <BuildableReference | ||
| BuildableIdentifier = "primary" | ||
| BlueprintIdentifier = "13B07F861A680F5B00A75B9A" | ||
| BuildableName = "StarterKit.app" | ||
| BlueprintName = "StarterKit" | ||
| ReferencedContainer = "container:StarterKit.xcodeproj"> | ||
| </BuildableReference> | ||
| </MacroExpansion> | ||
| <AdditionalOptions> | ||
| </AdditionalOptions> | ||
| </TestAction> | ||
| <LaunchAction | ||
| buildConfiguration = "Debug" | ||
| selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
| selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
| launchStyle = "0" | ||
| useCustomWorkingDirectory = "NO" | ||
| ignoresPersistentStateOnLaunch = "NO" | ||
| debugDocumentVersioning = "YES" | ||
| debugServiceExtension = "internal" | ||
| allowLocationSimulation = "YES"> | ||
| <BuildableProductRunnable | ||
| runnableDebuggingMode = "0"> | ||
| <BuildableReference | ||
| BuildableIdentifier = "primary" | ||
| BlueprintIdentifier = "13B07F861A680F5B00A75B9A" | ||
| BuildableName = "StarterKit.app" | ||
| BlueprintName = "StarterKit" | ||
| ReferencedContainer = "container:StarterKit.xcodeproj"> | ||
| </BuildableReference> | ||
| </BuildableProductRunnable> | ||
| <EnvironmentVariables> | ||
| <EnvironmentVariable | ||
| key = "OS_ACTIVITY_MODE" | ||
| value = "disable" | ||
| isEnabled = "YES"> | ||
| </EnvironmentVariable> | ||
| </EnvironmentVariables> | ||
| <AdditionalOptions> | ||
| </AdditionalOptions> | ||
| </LaunchAction> | ||
| <ProfileAction | ||
| buildConfiguration = "Release" | ||
| shouldUseLaunchSchemeArgsEnv = "YES" | ||
| savedToolIdentifier = "" | ||
| useCustomWorkingDirectory = "NO" | ||
| debugDocumentVersioning = "YES"> | ||
| <BuildableProductRunnable | ||
| runnableDebuggingMode = "0"> | ||
| <BuildableReference | ||
| BuildableIdentifier = "primary" | ||
| BlueprintIdentifier = "13B07F861A680F5B00A75B9A" | ||
| BuildableName = "StarterKit.app" | ||
| BlueprintName = "StarterKit" | ||
| ReferencedContainer = "container:StarterKit.xcodeproj"> | ||
| </BuildableReference> | ||
| </BuildableProductRunnable> | ||
| </ProfileAction> | ||
| <AnalyzeAction | ||
| buildConfiguration = "Debug"> | ||
| </AnalyzeAction> | ||
| <ArchiveAction | ||
| buildConfiguration = "Release" | ||
| revealArchiveInOrganizer = "YES"> | ||
| </ArchiveAction> | ||
| </Scheme> |
| @@ -0,0 +1,16 @@ | ||
| /** | ||
| * Copyright (c) 2015-present, Facebook, Inc. | ||
| * All rights reserved. | ||
| * | ||
| * This source code is licensed under the BSD-style license found in the | ||
| * LICENSE file in the root directory of this source tree. An additional grant | ||
| * of patent rights can be found in the PATENTS file in the same directory. | ||
| */ | ||
|
|
||
| #import <UIKit/UIKit.h> | ||
|
|
||
| @interface AppDelegate : UIResponder <UIApplicationDelegate> | ||
|
|
||
| @property (nonatomic, strong) UIWindow *window; | ||
|
|
||
| @end |
| @@ -0,0 +1,47 @@ | ||
| /** | ||
| * Copyright (c) 2015-present, Facebook, Inc. | ||
| * All rights reserved. | ||
| * | ||
| * This source code is licensed under the BSD-style license found in the | ||
| * LICENSE file in the root directory of this source tree. An additional grant | ||
| * of patent rights can be found in the PATENTS file in the same directory. | ||
| */ | ||
|
|
||
| #import "AppDelegate.h" | ||
|
|
||
| #import <React/RCTBundleURLProvider.h> | ||
| #import <React/RCTRootView.h> | ||
|
|
||
| @implementation AppDelegate | ||
|
|
||
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | ||
| { | ||
| NSURL *jsCodeLocation; | ||
|
|
||
| jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; | ||
|
|
||
| RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation | ||
| moduleName:@"StarterKit" | ||
| initialProperties:nil | ||
| launchOptions:launchOptions]; | ||
| rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; | ||
|
|
||
| self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; | ||
| UIViewController *rootViewController = [UIViewController new]; | ||
| rootViewController.view = rootView; | ||
| self.window.rootViewController = rootViewController; | ||
| [self.window makeKeyAndVisible]; | ||
|
|
||
| /** | ||
| * Custom | ||
| * Get launch image - saves annoying white flash | ||
| */ | ||
| UIImageView *launchScreenView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Launch"]]; // Image named "Launch" | ||
| launchScreenView.frame = self.window.bounds; | ||
| launchScreenView.contentMode = UIViewContentModeScaleAspectFill; | ||
| rootView.loadingView = launchScreenView; | ||
|
|
||
| return YES; | ||
| } | ||
|
|
||
| @end |
| @@ -0,0 +1,94 @@ | ||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
| <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM"> | ||
| <dependencies> | ||
| <deployment identifier="iOS"/> | ||
| <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> | ||
| </dependencies> | ||
| <scenes> | ||
| <!--View Controller--> | ||
| <scene sceneID="EHf-IW-A2E"> | ||
| <objects> | ||
| <viewController autoresizesArchivedViewToFullSize="NO" automaticallyAdjustsScrollViewInsets="NO" id="01J-lp-oVM" sceneMemberID="viewController"> | ||
| <layoutGuides> | ||
| <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/> | ||
| <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/> | ||
| </layoutGuides> | ||
| <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> | ||
| <rect key="frame" x="0.0" y="0.0" width="414" height="736"/> | ||
| <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
| <subviews> | ||
| <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" semanticContentAttribute="spatial" horizontalHuggingPriority="1000" verticalHuggingPriority="251" ambiguous="YES" misplaced="YES" preservesSuperviewLayoutMargins="YES" image="Launch" translatesAutoresizingMaskIntoConstraints="NO" id="wPK-QX-6Fq"> | ||
| <rect key="frame" x="-57" y="0.0" width="714" height="601"/> | ||
| <color key="backgroundColor" red="0.16078431372549018" green="0.14509803921568626" blue="0.14117647058823529" alpha="1" colorSpace="calibratedRGB"/> | ||
| <variation key="heightClass=compact" fixedFrame="YES"> | ||
| <rect key="frame" x="-39" y="-178" width="678" height="719"/> | ||
| </variation> | ||
| <variation key="heightClass=regular" ambiguous="YES" misplaced="YES"> | ||
| <rect key="frame" x="-98" y="0.0" width="817" height="800"/> | ||
| </variation> | ||
| <variation key="widthClass=compact" ambiguous="YES" misplaced="YES"> | ||
| <rect key="frame" x="0.0" y="0.0" width="414" height="736"/> | ||
| </variation> | ||
| <variation key="widthClass=regular" fixedFrame="YES"> | ||
| <rect key="frame" x="-58" y="-101" width="916" height="802"/> | ||
| </variation> | ||
| <variation key="heightClass=compact-widthClass=compact" misplaced="YES"> | ||
| <rect key="frame" x="0.0" y="0.0" width="414" height="736"/> | ||
| </variation> | ||
| <variation key="heightClass=compact-widthClass=regular" fixedFrame="YES"> | ||
| <rect key="frame" x="0.0" y="-234" width="800" height="852"/> | ||
| </variation> | ||
| <variation key="heightClass=regular-widthClass=regular" fixedFrame="YES"> | ||
| <rect key="frame" x="-46" y="0.0" width="892" height="811"/> | ||
| </variation> | ||
| </imageView> | ||
| </subviews> | ||
| <color key="backgroundColor" red="0.16078431372549018" green="0.14509803921568626" blue="0.14117647058823529" alpha="1" colorSpace="calibratedRGB"/> | ||
| <constraints> | ||
| <constraint firstItem="wPK-QX-6Fq" firstAttribute="top" secondItem="Llm-lL-Icb" secondAttribute="bottom" id="3Qe-K1-1TZ"/> | ||
| <constraint firstItem="wPK-QX-6Fq" firstAttribute="bottom" secondItem="xb3-aO-Qok" secondAttribute="top" id="8tp-CX-Ycp"/> | ||
| <constraint firstItem="wPK-QX-6Fq" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="OER-yt-fkn"/> | ||
| <constraint firstItem="wPK-QX-6Fq" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="cLX-6g-cOz"/> | ||
| <constraint firstAttribute="trailing" secondItem="wPK-QX-6Fq" secondAttribute="trailing" id="fxM-WZ-XpD"/> | ||
| <constraint firstItem="wPK-QX-6Fq" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="kd9-Ik-7Ql"/> | ||
| </constraints> | ||
| <variation key="default"> | ||
| <mask key="constraints"> | ||
| <exclude reference="3Qe-K1-1TZ"/> | ||
| <exclude reference="8tp-CX-Ycp"/> | ||
| <exclude reference="OER-yt-fkn"/> | ||
| <exclude reference="cLX-6g-cOz"/> | ||
| <exclude reference="fxM-WZ-XpD"/> | ||
| <exclude reference="kd9-Ik-7Ql"/> | ||
| </mask> | ||
| </variation> | ||
| <variation key="heightClass=compact-widthClass=compact"> | ||
| <mask key="constraints"> | ||
| <include reference="cLX-6g-cOz"/> | ||
| <include reference="kd9-Ik-7Ql"/> | ||
| </mask> | ||
| </variation> | ||
| <variation key="heightClass=regular-widthClass=compact"> | ||
| <mask key="constraints"> | ||
| <include reference="3Qe-K1-1TZ"/> | ||
| <include reference="8tp-CX-Ycp"/> | ||
| <include reference="OER-yt-fkn"/> | ||
| <include reference="fxM-WZ-XpD"/> | ||
| </mask> | ||
| </variation> | ||
| </view> | ||
| <value key="contentSizeForViewInPopover" type="size" width="414" height="736"/> | ||
| <nil key="simulatedStatusBarMetrics"/> | ||
| <nil key="simulatedTopBarMetrics"/> | ||
| <nil key="simulatedBottomBarMetrics"/> | ||
| <simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina55"/> | ||
| </viewController> | ||
| <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
| </objects> | ||
| <point key="canvasLocation" x="82.5" y="331"/> | ||
| </scene> | ||
| </scenes> | ||
| <resources> | ||
| <image name="Launch" width="2000" height="2000"/> | ||
| </resources> | ||
| </document> |
| @@ -0,0 +1,42 @@ | ||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
| <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7702" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES"> | ||
| <dependencies> | ||
| <deployment identifier="iOS"/> | ||
| <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/> | ||
| <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/> | ||
| </dependencies> | ||
| <objects> | ||
| <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> | ||
| <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | ||
| <view contentMode="scaleToFill" id="iN0-l3-epB"> | ||
| <rect key="frame" x="0.0" y="0.0" width="480" height="480"/> | ||
| <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
| <subviews> | ||
| <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Powered by React Native" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye"> | ||
| <rect key="frame" x="20" y="439" width="441" height="21"/> | ||
| <fontDescription key="fontDescription" type="system" pointSize="17"/> | ||
| <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> | ||
| <nil key="highlightedColor"/> | ||
| </label> | ||
| <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="StarterKit" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX"> | ||
| <rect key="frame" x="20" y="140" width="441" height="43"/> | ||
| <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/> | ||
| <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> | ||
| <nil key="highlightedColor"/> | ||
| </label> | ||
| </subviews> | ||
| <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> | ||
| <constraints> | ||
| <constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/> | ||
| <constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/> | ||
| <constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/> | ||
| <constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/> | ||
| <constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/> | ||
| <constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/> | ||
| </constraints> | ||
| <nil key="simulatedStatusBarMetrics"/> | ||
| <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> | ||
| <point key="canvasLocation" x="548" y="455"/> | ||
| </view> | ||
| </objects> | ||
| </document> |
| @@ -0,0 +1,176 @@ | ||
| { | ||
| "images":[ | ||
| { | ||
| "idiom":"iphone", | ||
| "size":"20x20", | ||
| "scale":"2x", | ||
| "filename":"Icon-App-20x20@2x.png" | ||
| }, | ||
| { | ||
| "idiom":"iphone", | ||
| "size":"20x20", | ||
| "scale":"3x", | ||
| "filename":"Icon-App-20x20@3x.png" | ||
| }, | ||
| { | ||
| "idiom":"iphone", | ||
| "size":"29x29", | ||
| "scale":"1x", | ||
| "filename":"Icon-App-29x29@1x.png" | ||
| }, | ||
| { | ||
| "idiom":"iphone", | ||
| "size":"29x29", | ||
| "scale":"2x", | ||
| "filename":"Icon-App-29x29@2x.png" | ||
| }, | ||
| { | ||
| "idiom":"iphone", | ||
| "size":"29x29", | ||
| "scale":"3x", | ||
| "filename":"Icon-App-29x29@3x.png" | ||
| }, | ||
| { | ||
| "idiom":"iphone", | ||
| "size":"40x40", | ||
| "scale":"1x", | ||
| "filename":"Icon-App-40x40@1x.png" | ||
| }, | ||
| { | ||
| "idiom":"iphone", | ||
| "size":"40x40", | ||
| "scale":"2x", | ||
| "filename":"Icon-App-40x40@2x.png" | ||
| }, | ||
| { | ||
| "idiom":"iphone", | ||
| "size":"40x40", | ||
| "scale":"3x", | ||
| "filename":"Icon-App-40x40@3x.png" | ||
| }, | ||
| { | ||
| "idiom":"iphone", | ||
| "size":"57x57", | ||
| "scale":"1x", | ||
| "filename":"Icon-App-57x57@1x.png" | ||
| }, | ||
| { | ||
| "idiom":"iphone", | ||
| "size":"57x57", | ||
| "scale":"2x", | ||
| "filename":"Icon-App-57x57@2x.png" | ||
| }, | ||
| { | ||
| "idiom":"iphone", | ||
| "size":"60x60", | ||
| "scale":"1x", | ||
| "filename":"Icon-App-60x60@1x.png" | ||
| }, | ||
| { | ||
| "idiom":"iphone", | ||
| "size":"60x60", | ||
| "scale":"2x", | ||
| "filename":"Icon-App-60x60@2x.png" | ||
| }, | ||
| { | ||
| "idiom":"iphone", | ||
| "size":"60x60", | ||
| "scale":"3x", | ||
| "filename":"Icon-App-60x60@3x.png" | ||
| }, | ||
| { | ||
| "idiom":"iphone", | ||
| "size":"76x76", | ||
| "scale":"1x", | ||
| "filename":"Icon-App-76x76@1x.png" | ||
| }, | ||
| { | ||
| "idiom":"ipad", | ||
| "size":"20x20", | ||
| "scale":"1x", | ||
| "filename":"Icon-App-20x20@1x.png" | ||
| }, | ||
| { | ||
| "idiom":"ipad", | ||
| "size":"20x20", | ||
| "scale":"2x", | ||
| "filename":"Icon-App-20x20@2x.png" | ||
| }, | ||
| { | ||
| "idiom":"ipad", | ||
| "size":"29x29", | ||
| "scale":"1x", | ||
| "filename":"Icon-App-29x29@1x.png" | ||
| }, | ||
| { | ||
| "idiom":"ipad", | ||
| "size":"29x29", | ||
| "scale":"2x", | ||
| "filename":"Icon-App-29x29@2x.png" | ||
| }, | ||
| { | ||
| "idiom":"ipad", | ||
| "size":"40x40", | ||
| "scale":"1x", | ||
| "filename":"Icon-App-40x40@1x.png" | ||
| }, | ||
| { | ||
| "idiom":"ipad", | ||
| "size":"40x40", | ||
| "scale":"2x", | ||
| "filename":"Icon-App-40x40@2x.png" | ||
| }, | ||
| { | ||
| "size" : "50x50", | ||
| "idiom" : "ipad", | ||
| "filename" : "Icon-Small-50x50@1x.png", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "size" : "50x50", | ||
| "idiom" : "ipad", | ||
| "filename" : "Icon-Small-50x50@2x.png", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "idiom":"ipad", | ||
| "size":"72x72", | ||
| "scale":"1x", | ||
| "filename":"Icon-App-72x72@1x.png" | ||
| }, | ||
| { | ||
| "idiom":"ipad", | ||
| "size":"72x72", | ||
| "scale":"2x", | ||
| "filename":"Icon-App-72x72@2x.png" | ||
| }, | ||
| { | ||
| "idiom":"ipad", | ||
| "size":"76x76", | ||
| "scale":"1x", | ||
| "filename":"Icon-App-76x76@1x.png" | ||
| }, | ||
| { | ||
| "idiom":"ipad", | ||
| "size":"76x76", | ||
| "scale":"2x", | ||
| "filename":"Icon-App-76x76@2x.png" | ||
| }, | ||
| { | ||
| "idiom":"ipad", | ||
| "size":"76x76", | ||
| "scale":"3x", | ||
| "filename":"Icon-App-76x76@3x.png" | ||
| }, | ||
| { | ||
| "idiom":"ipad", | ||
| "size":"83.5x83.5", | ||
| "scale":"2x", | ||
| "filename":"Icon-App-83.5x83.5@2x.png" | ||
| } | ||
| ], | ||
| "info":{ | ||
| "version":1, | ||
| "author":"makeappicon" | ||
| } | ||
| } |
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "info" : { | ||
| "version" : 1, | ||
| "author" : "xcode" | ||
| } | ||
| } |
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "idiom" : "universal", | ||
| "filename" : "Launch.jpg", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "idiom" : "universal", | ||
| "filename" : "Launch.jpg", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "idiom" : "universal", | ||
| "filename" : "Launch.jpg", | ||
| "scale" : "3x" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "version" : 1, | ||
| "author" : "xcode" | ||
| } | ||
| } |
| @@ -0,0 +1,70 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict> | ||
| <key>CFBundleDevelopmentRegion</key> | ||
| <string>en</string> | ||
| <key>CFBundleExecutable</key> | ||
| <string>$(EXECUTABLE_NAME)</string> | ||
| <key>CFBundleIdentifier</key> | ||
| <string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string> | ||
| <key>CFBundleInfoDictionaryVersion</key> | ||
| <string>6.0</string> | ||
| <key>CFBundleName</key> | ||
| <string>$(PRODUCT_NAME)</string> | ||
| <key>CFBundlePackageType</key> | ||
| <string>APPL</string> | ||
| <key>CFBundleShortVersionString</key> | ||
| <string>1.0</string> | ||
| <key>CFBundleSignature</key> | ||
| <string>????</string> | ||
| <key>CFBundleVersion</key> | ||
| <string>1</string> | ||
| <key>LSRequiresIPhoneOS</key> | ||
| <true/> | ||
| <key>NSAppTransportSecurity</key> | ||
| <dict> | ||
| <key>NSExceptionDomains</key> | ||
| <dict> | ||
| <key>localhost</key> | ||
| <dict> | ||
| <key>NSExceptionAllowsInsecureHTTPLoads</key> | ||
| <true/> | ||
| </dict> | ||
| </dict> | ||
| </dict> | ||
| <key>NSLocationWhenInUseUsageDescription</key> | ||
| <string/> | ||
| <key>UIAppFonts</key> | ||
| <array> | ||
| <string>Entypo.ttf</string> | ||
| <string>EvilIcons.ttf</string> | ||
| <string>FontAwesome.ttf</string> | ||
| <string>Foundation.ttf</string> | ||
| <string>Ionicons.ttf</string> | ||
| <string>MaterialIcons.ttf</string> | ||
| <string>Octicons.ttf</string> | ||
| <string>SimpleLineIcons.ttf</string> | ||
| <string>Zocial.ttf</string> | ||
| <string>MaterialCommunityIcons.ttf</string> | ||
| </array> | ||
| <key>UILaunchStoryboardName</key> | ||
| <string>LaunchScreen</string> | ||
| <key>UIRequiredDeviceCapabilities</key> | ||
| <array> | ||
| <string>armv7</string> | ||
| </array> | ||
| <key>UIStatusBarHidden</key> | ||
| <true/> | ||
| <key>UIStatusBarStyle</key> | ||
| <string>UIStatusBarStyleLightContent</string> | ||
| <key>UISupportedInterfaceOrientations</key> | ||
| <array> | ||
| <string>UIInterfaceOrientationPortrait</string> | ||
| <string>UIInterfaceOrientationLandscapeLeft</string> | ||
| <string>UIInterfaceOrientationLandscapeRight</string> | ||
| </array> | ||
| <key>UIViewControllerBasedStatusBarAppearance</key> | ||
| <false/> | ||
| </dict> | ||
| </plist> |
| @@ -0,0 +1,94 @@ | ||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
| <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM"> | ||
| <dependencies> | ||
| <deployment identifier="iOS"/> | ||
| <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> | ||
| </dependencies> | ||
| <scenes> | ||
| <!--View Controller--> | ||
| <scene sceneID="EHf-IW-A2E"> | ||
| <objects> | ||
| <viewController autoresizesArchivedViewToFullSize="NO" automaticallyAdjustsScrollViewInsets="NO" id="01J-lp-oVM" sceneMemberID="viewController"> | ||
| <layoutGuides> | ||
| <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/> | ||
| <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/> | ||
| </layoutGuides> | ||
| <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> | ||
| <rect key="frame" x="0.0" y="0.0" width="414" height="736"/> | ||
| <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
| <subviews> | ||
| <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" semanticContentAttribute="spatial" horizontalHuggingPriority="1000" verticalHuggingPriority="251" ambiguous="YES" misplaced="YES" preservesSuperviewLayoutMargins="YES" image="Launch" translatesAutoresizingMaskIntoConstraints="NO" id="wPK-QX-6Fq"> | ||
| <rect key="frame" x="-57" y="0.0" width="714" height="601"/> | ||
| <color key="backgroundColor" red="0.16078431372549018" green="0.14509803921568626" blue="0.14117647058823529" alpha="1" colorSpace="calibratedRGB"/> | ||
| <variation key="heightClass=compact" fixedFrame="YES"> | ||
| <rect key="frame" x="-39" y="-178" width="678" height="719"/> | ||
| </variation> | ||
| <variation key="heightClass=regular" ambiguous="YES" misplaced="YES"> | ||
| <rect key="frame" x="-98" y="0.0" width="817" height="800"/> | ||
| </variation> | ||
| <variation key="widthClass=compact" ambiguous="YES" misplaced="YES"> | ||
| <rect key="frame" x="0.0" y="0.0" width="414" height="736"/> | ||
| </variation> | ||
| <variation key="widthClass=regular" fixedFrame="YES"> | ||
| <rect key="frame" x="-58" y="-101" width="916" height="802"/> | ||
| </variation> | ||
| <variation key="heightClass=compact-widthClass=compact" misplaced="YES"> | ||
| <rect key="frame" x="0.0" y="0.0" width="414" height="736"/> | ||
| </variation> | ||
| <variation key="heightClass=compact-widthClass=regular" fixedFrame="YES"> | ||
| <rect key="frame" x="0.0" y="-234" width="800" height="852"/> | ||
| </variation> | ||
| <variation key="heightClass=regular-widthClass=regular" fixedFrame="YES"> | ||
| <rect key="frame" x="-46" y="0.0" width="892" height="811"/> | ||
| </variation> | ||
| </imageView> | ||
| </subviews> | ||
| <color key="backgroundColor" red="0.16078431372549018" green="0.14509803921568626" blue="0.14117647058823529" alpha="1" colorSpace="calibratedRGB"/> | ||
| <constraints> | ||
| <constraint firstItem="wPK-QX-6Fq" firstAttribute="top" secondItem="Llm-lL-Icb" secondAttribute="bottom" id="3Qe-K1-1TZ"/> | ||
| <constraint firstItem="wPK-QX-6Fq" firstAttribute="bottom" secondItem="xb3-aO-Qok" secondAttribute="top" id="8tp-CX-Ycp"/> | ||
| <constraint firstItem="wPK-QX-6Fq" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="OER-yt-fkn"/> | ||
| <constraint firstItem="wPK-QX-6Fq" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="cLX-6g-cOz"/> | ||
| <constraint firstAttribute="trailing" secondItem="wPK-QX-6Fq" secondAttribute="trailing" id="fxM-WZ-XpD"/> | ||
| <constraint firstItem="wPK-QX-6Fq" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="kd9-Ik-7Ql"/> | ||
| </constraints> | ||
| <variation key="default"> | ||
| <mask key="constraints"> | ||
| <exclude reference="3Qe-K1-1TZ"/> | ||
| <exclude reference="8tp-CX-Ycp"/> | ||
| <exclude reference="OER-yt-fkn"/> | ||
| <exclude reference="cLX-6g-cOz"/> | ||
| <exclude reference="fxM-WZ-XpD"/> | ||
| <exclude reference="kd9-Ik-7Ql"/> | ||
| </mask> | ||
| </variation> | ||
| <variation key="heightClass=compact-widthClass=compact"> | ||
| <mask key="constraints"> | ||
| <include reference="cLX-6g-cOz"/> | ||
| <include reference="kd9-Ik-7Ql"/> | ||
| </mask> | ||
| </variation> | ||
| <variation key="heightClass=regular-widthClass=compact"> | ||
| <mask key="constraints"> | ||
| <include reference="3Qe-K1-1TZ"/> | ||
| <include reference="8tp-CX-Ycp"/> | ||
| <include reference="OER-yt-fkn"/> | ||
| <include reference="fxM-WZ-XpD"/> | ||
| </mask> | ||
| </variation> | ||
| </view> | ||
| <value key="contentSizeForViewInPopover" type="size" width="414" height="736"/> | ||
| <nil key="simulatedStatusBarMetrics"/> | ||
| <nil key="simulatedTopBarMetrics"/> | ||
| <nil key="simulatedBottomBarMetrics"/> | ||
| <simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina55"/> | ||
| </viewController> | ||
| <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
| </objects> | ||
| <point key="canvasLocation" x="82.5" y="331"/> | ||
| </scene> | ||
| </scenes> | ||
| <resources> | ||
| <image name="Launch" width="2000" height="2000"/> | ||
| </resources> | ||
| </document> |
| @@ -0,0 +1,18 @@ | ||
| /** | ||
| * Copyright (c) 2015-present, Facebook, Inc. | ||
| * All rights reserved. | ||
| * | ||
| * This source code is licensed under the BSD-style license found in the | ||
| * LICENSE file in the root directory of this source tree. An additional grant | ||
| * of patent rights can be found in the PATENTS file in the same directory. | ||
| */ | ||
|
|
||
| #import <UIKit/UIKit.h> | ||
|
|
||
| #import "AppDelegate.h" | ||
|
|
||
| int main(int argc, char * argv[]) { | ||
| @autoreleasepool { | ||
| return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); | ||
| } | ||
| } |
| @@ -0,0 +1,24 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict> | ||
| <key>CFBundleDevelopmentRegion</key> | ||
| <string>en</string> | ||
| <key>CFBundleExecutable</key> | ||
| <string>$(EXECUTABLE_NAME)</string> | ||
| <key>CFBundleIdentifier</key> | ||
| <string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string> | ||
| <key>CFBundleInfoDictionaryVersion</key> | ||
| <string>6.0</string> | ||
| <key>CFBundleName</key> | ||
| <string>$(PRODUCT_NAME)</string> | ||
| <key>CFBundlePackageType</key> | ||
| <string>BNDL</string> | ||
| <key>CFBundleShortVersionString</key> | ||
| <string>1.0</string> | ||
| <key>CFBundleSignature</key> | ||
| <string>????</string> | ||
| <key>CFBundleVersion</key> | ||
| <string>1</string> | ||
| </dict> | ||
| </plist> |
| @@ -0,0 +1,70 @@ | ||
| /** | ||
| * Copyright (c) 2015-present, Facebook, Inc. | ||
| * All rights reserved. | ||
| * | ||
| * This source code is licensed under the BSD-style license found in the | ||
| * LICENSE file in the root directory of this source tree. An additional grant | ||
| * of patent rights can be found in the PATENTS file in the same directory. | ||
| */ | ||
|
|
||
| #import <UIKit/UIKit.h> | ||
| #import <XCTest/XCTest.h> | ||
|
|
||
| #import <React/RCTLog.h> | ||
| #import <React/RCTRootView.h> | ||
|
|
||
| #define TIMEOUT_SECONDS 600 | ||
| #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" | ||
|
|
||
| @interface StarterKitTests : XCTestCase | ||
|
|
||
| @end | ||
|
|
||
| @implementation StarterKitTests | ||
|
|
||
| - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test | ||
| { | ||
| if (test(view)) { | ||
| return YES; | ||
| } | ||
| for (UIView *subview in [view subviews]) { | ||
| if ([self findSubviewInView:subview matching:test]) { | ||
| return YES; | ||
| } | ||
| } | ||
| return NO; | ||
| } | ||
|
|
||
| - (void)testRendersWelcomeScreen | ||
| { | ||
| UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; | ||
| NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; | ||
| BOOL foundElement = NO; | ||
|
|
||
| __block NSString *redboxError = nil; | ||
| RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { | ||
| if (level >= RCTLogLevelError) { | ||
| redboxError = message; | ||
| } | ||
| }); | ||
|
|
||
| while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { | ||
| [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; | ||
| [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; | ||
|
|
||
| foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { | ||
| if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { | ||
| return YES; | ||
| } | ||
| return NO; | ||
| }]; | ||
| } | ||
|
|
||
| RCTSetLogFunction(RCTDefaultLogFunction); | ||
|
|
||
| XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); | ||
| XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); | ||
| } | ||
|
|
||
|
|
||
| @end |
| @@ -0,0 +1,28 @@ | ||
| /* global jest fetch */ | ||
|
|
||
| jest.mock('Linking', () => | ||
| ({ | ||
| addEventListener: jest.fn(), | ||
| removeEventListener: jest.fn(), | ||
| openURL: jest.fn(), | ||
| canOpenURL: jest.fn(), | ||
| getInitialURL: jest.fn(), | ||
| }), | ||
| ); | ||
|
|
||
| // Mocking the global.fetch included in React Native | ||
| global.fetch = jest.fn(); | ||
|
|
||
| // Helper to mock a success response (only once) | ||
| fetch.mockResponseSuccess = (body) => { | ||
| fetch.mockImplementationOnce( | ||
| () => Promise.resolve({ json: () => Promise.resolve(JSON.parse(body)) }), | ||
| ); | ||
| }; | ||
|
|
||
| // Helper to mock a failure response (only once) | ||
| fetch.mockResponseFailure = (error) => { | ||
| fetch.mockImplementationOnce( | ||
| () => Promise.reject(error), | ||
| ); | ||
| }; |
| @@ -0,0 +1,57 @@ | ||
| { | ||
| "name": "StarterKit", | ||
| "version": "1.0.0", | ||
| "private": true, | ||
| "scripts": { | ||
| "start": "node node_modules/react-native/local-cli/cli.js start", | ||
| "pretest": "./node_modules/.bin/eslint -c .eslintrc --ext .js src", | ||
| "test": "jest" | ||
| }, | ||
| "jest": { | ||
| "preset": "react-native", | ||
| "setupFiles": [ | ||
| "<rootDir>/jest.setup.js" | ||
| ], | ||
| "transformIgnorePatterns": [ | ||
| "node_modules/(?!react-native|tcomb-form-native|apsl-react-native-button,react-native-device-info|react-clone-referenced-element)" | ||
| ], | ||
| "collectCoverage": true, | ||
| "verbose": true | ||
| }, | ||
| "dependencies": { | ||
| "firebase": "^4.1.2", | ||
| "prop-types": "^15.5.10", | ||
| "react": "16.0.0-alpha.6", | ||
| "react-addons-shallow-compare": "^15.4.2", | ||
| "react-native": "0.44.3", | ||
| "react-native-device-info": "^0.10.1", | ||
| "react-native-dotenv": "0.1.0", | ||
| "react-native-elements": "^0.15.0", | ||
| "react-native-google-analytics-bridge": "^5.0.0", | ||
| "react-native-router-flux": "3.39.2", | ||
| "react-native-side-menu": "^1.0.2", | ||
| "react-native-tab-view": "0.0.67", | ||
| "react-native-vector-icons": "^4.2.0", | ||
| "react-redux": "^5.0.1", | ||
| "redux": "^3.6.0", | ||
| "redux-logger": "^3.0.6", | ||
| "redux-thunk": "^2.1.0", | ||
| "tcomb-form-native": "^0.6.1" | ||
| }, | ||
| "devDependencies": { | ||
| "babel-core": "^6.17.0", | ||
| "babel-eslint": "^7.1.1", | ||
| "babel-jest": "20.0.3", | ||
| "babel-preset-es2015": "^6.18.0", | ||
| "babel-preset-react-native": "2.1.0", | ||
| "babel-register": "^6.16.3", | ||
| "eslint-config-airbnb": "^15.0.2", | ||
| "eslint-plugin-import": "^2.2.0", | ||
| "eslint-plugin-jsx-a11y": "^6.0.2", | ||
| "eslint": "^3.9.1", | ||
| "eslint-plugin-react": "^7.0.1", | ||
| "jest": "^20.0.4", | ||
| "jest-react-native": "^18.0.0", | ||
| "react-test-renderer": "^16.0.0-alpha.6" | ||
| } | ||
| } |
| @@ -0,0 +1,17 @@ | ||
| # Components | ||
|
|
||
| This directory is used for React "Dumb-Components" which simply render elements to the screen and are ideally stateless (don't manipulate any state - instead uses props from a Container). | ||
|
|
||
| They shouldn't know what's happening in Redux nor should they deal with business logic, API calls or general heavy lifting. | ||
|
|
||
| ## Grouping | ||
|
|
||
| We've found grouping Components by their type (eg. `recipes`) is a great approach, especially when you start to get a lot of Components. This way, you can easily browse to what you looking for. | ||
|
|
||
| ## Naming conventions | ||
|
|
||
| __Directories__ | ||
| All directories are lowercase, except for each [Container's](../containers/README.md) directory - which are Pascal Case. | ||
|
|
||
| __Files__ | ||
| Components should be `Pascal Case`. |
| @@ -0,0 +1,291 @@ | ||
| // Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
|
||
| exports[`Error renders correctly 1`] = ` | ||
| <View | ||
| style={ | ||
| Array [ | ||
| Object { | ||
| "backgroundColor": "#E9EBEE", | ||
| "flex": 1, | ||
| "flexDirection": "column", | ||
| "position": "relative", | ||
| }, | ||
| Object { | ||
| "alignItems": "center", | ||
| "justifyContent": "center", | ||
| }, | ||
| ] | ||
| } | ||
| > | ||
| <Text | ||
| accessible={true} | ||
| allowFontScaling={false} | ||
| ellipsizeMode="tail" | ||
| style={ | ||
| Array [ | ||
| Object { | ||
| "color": "#CCC", | ||
| "fontSize": 50, | ||
| }, | ||
| undefined, | ||
| Object { | ||
| "fontFamily": "Ionicons", | ||
| "fontStyle": "normal", | ||
| "fontWeight": "normal", | ||
| }, | ||
| ] | ||
| } | ||
| > | ||
|  | ||
| </Text> | ||
| <View | ||
| style={ | ||
| Object { | ||
| "height": 1, | ||
| "left": 0, | ||
| "marginTop": 9, | ||
| "right": 0, | ||
| } | ||
| } | ||
| /> | ||
| <Text | ||
| accessible={true} | ||
| allowFontScaling={true} | ||
| ellipsizeMode="tail" | ||
| h1={false} | ||
| h2={false} | ||
| h3={false} | ||
| h4={false} | ||
| h5={false} | ||
| onPress={null} | ||
| p={false} | ||
| style={ | ||
| Array [ | ||
| Object { | ||
| "color": "#222222", | ||
| "fontFamily": "HelveticaNeue", | ||
| "fontSize": 14, | ||
| "fontWeight": "500", | ||
| "lineHeight": 18, | ||
| }, | ||
| Object { | ||
| "textAlign": "center", | ||
| }, | ||
| ] | ||
| } | ||
| > | ||
| We can't find that | ||
| </Text> | ||
| <View | ||
| style={ | ||
| Object { | ||
| "height": 1, | ||
| "left": 0, | ||
| "marginTop": 19, | ||
| "right": 0, | ||
| } | ||
| } | ||
| /> | ||
| </View> | ||
| `; | ||
|
|
||
| exports[`Error w/ Try Again Button renders correctly 1`] = ` | ||
| <View | ||
| style={ | ||
| Array [ | ||
| Object { | ||
| "backgroundColor": "#E9EBEE", | ||
| "flex": 1, | ||
| "flexDirection": "column", | ||
| "position": "relative", | ||
| }, | ||
| Object { | ||
| "alignItems": "center", | ||
| "justifyContent": "center", | ||
| }, | ||
| ] | ||
| } | ||
| > | ||
| <Text | ||
| accessible={true} | ||
| allowFontScaling={false} | ||
| ellipsizeMode="tail" | ||
| style={ | ||
| Array [ | ||
| Object { | ||
| "color": "#CCC", | ||
| "fontSize": 50, | ||
| }, | ||
| undefined, | ||
| Object { | ||
| "fontFamily": "Ionicons", | ||
| "fontStyle": "normal", | ||
| "fontWeight": "normal", | ||
| }, | ||
| ] | ||
| } | ||
| > | ||
|  | ||
| </Text> | ||
| <View | ||
| style={ | ||
| Object { | ||
| "height": 1, | ||
| "left": 0, | ||
| "marginTop": 9, | ||
| "right": 0, | ||
| } | ||
| } | ||
| /> | ||
| <Text | ||
| accessible={true} | ||
| allowFontScaling={true} | ||
| ellipsizeMode="tail" | ||
| h1={false} | ||
| h2={false} | ||
| h3={false} | ||
| h4={false} | ||
| h5={false} | ||
| onPress={null} | ||
| p={false} | ||
| style={ | ||
| Array [ | ||
| Object { | ||
| "color": "#222222", | ||
| "fontFamily": "HelveticaNeue", | ||
| "fontSize": 14, | ||
| "fontWeight": "500", | ||
| "lineHeight": 18, | ||
| }, | ||
| Object { | ||
| "textAlign": "center", | ||
| }, | ||
| ] | ||
| } | ||
| > | ||
| Woops, Something went wrong. | ||
| </Text> | ||
| <View | ||
| style={ | ||
| Object { | ||
| "height": 1, | ||
| "left": 0, | ||
| "marginTop": 19, | ||
| "right": 0, | ||
| } | ||
| } | ||
| /> | ||
| <View | ||
| accessibilityComponentType={undefined} | ||
| accessibilityLabel={undefined} | ||
| accessibilityTraits={undefined} | ||
| accessible={true} | ||
| hasTVPreferredFocus={undefined} | ||
| hitSlop={undefined} | ||
| isTVSelectable={true} | ||
| onLayout={undefined} | ||
| onResponderGrant={[Function]} | ||
| onResponderMove={[Function]} | ||
| onResponderRelease={[Function]} | ||
| onResponderTerminate={[Function]} | ||
| onResponderTerminationRequest={[Function]} | ||
| onStartShouldSetResponder={[Function]} | ||
| style={ | ||
| Array [ | ||
| Object { | ||
| "backgroundColor": "transparent", | ||
| }, | ||
| undefined, | ||
| ] | ||
| } | ||
| testID={undefined} | ||
| tvParallaxProperties={undefined} | ||
| > | ||
| <View | ||
| style={ | ||
| Array [ | ||
| Object { | ||
| "alignItems": "center", | ||
| "backgroundColor": "#9E9E9E", | ||
| "flexDirection": "row", | ||
| "justifyContent": "center", | ||
| "marginLeft": 15, | ||
| "marginRight": 15, | ||
| "padding": 19, | ||
| }, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| Object { | ||
| "backgroundColor": "transparent", | ||
| }, | ||
| Object { | ||
| "borderRadius": 2, | ||
| }, | ||
| false, | ||
| Object { | ||
| "padding": 12, | ||
| }, | ||
| Object { | ||
| "borderColor": "#0E4EF8", | ||
| "borderWidth": 1, | ||
| "marginLeft": 0, | ||
| "marginRight": 0, | ||
| "padding": 8, | ||
| }, | ||
| undefined, | ||
| undefined, | ||
| ] | ||
| } | ||
| > | ||
| <Text | ||
| accessible={true} | ||
| allowFontScaling={true} | ||
| ellipsizeMode="tail" | ||
| style={ | ||
| Array [ | ||
| Object { | ||
| "fontFamily": undefined, | ||
| }, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| undefined, | ||
| Array [ | ||
| Object { | ||
| "color": "white", | ||
| "fontSize": 20, | ||
| }, | ||
| Object { | ||
| "color": "#0E4EF8", | ||
| }, | ||
| Object { | ||
| "fontSize": 17.5, | ||
| }, | ||
| Object { | ||
| "fontSize": 12, | ||
| }, | ||
| undefined, | ||
| Object { | ||
| "fontWeight": "bold", | ||
| }, | ||
| Object { | ||
| "fontFamily": "HelveticaNeue", | ||
| }, | ||
| ], | ||
| ] | ||
| } | ||
| > | ||
| Try again | ||
| </Text> | ||
| </View> | ||
| </View> | ||
| </View> | ||
| `; |
| @@ -0,0 +1,100 @@ | ||
| // Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
|
||
| exports[`Loading renders correctly 1`] = ` | ||
| <View | ||
| style={ | ||
| Array [ | ||
| Object { | ||
| "backgroundColor": "#E9EBEE", | ||
| "flex": 1, | ||
| "flexDirection": "column", | ||
| "position": "relative", | ||
| }, | ||
| Object { | ||
| "alignItems": "center", | ||
| "justifyContent": "center", | ||
| }, | ||
| false, | ||
| ] | ||
| } | ||
| > | ||
| <ActivityIndicator | ||
| animating={true} | ||
| color="#AAA" | ||
| hidesWhenStopped={true} | ||
| size="large" | ||
| /> | ||
| <View | ||
| style={ | ||
| Object { | ||
| "height": 1, | ||
| "left": 0, | ||
| "marginTop": 9, | ||
| "right": 0, | ||
| } | ||
| } | ||
| /> | ||
| </View> | ||
| `; | ||
|
|
||
| exports[`Loading w/ text renders correctly 1`] = ` | ||
| <View | ||
| style={ | ||
| Array [ | ||
| Object { | ||
| "backgroundColor": "#E9EBEE", | ||
| "flex": 1, | ||
| "flexDirection": "column", | ||
| "position": "relative", | ||
| }, | ||
| Object { | ||
| "alignItems": "center", | ||
| "justifyContent": "center", | ||
| }, | ||
| false, | ||
| ] | ||
| } | ||
| > | ||
| <ActivityIndicator | ||
| animating={true} | ||
| color="#AAA" | ||
| hidesWhenStopped={true} | ||
| size="large" | ||
| /> | ||
| <View | ||
| style={ | ||
| Object { | ||
| "height": 1, | ||
| "left": 0, | ||
| "marginTop": 9, | ||
| "right": 0, | ||
| } | ||
| } | ||
| /> | ||
| <Text | ||
| accessible={true} | ||
| allowFontScaling={true} | ||
| ellipsizeMode="tail" | ||
| h1={false} | ||
| h2={false} | ||
| h3={false} | ||
| h4={false} | ||
| h5={false} | ||
| onPress={null} | ||
| p={false} | ||
| style={ | ||
| Array [ | ||
| Object { | ||
| "color": "#222222", | ||
| "fontFamily": "HelveticaNeue", | ||
| "fontSize": 14, | ||
| "fontWeight": "500", | ||
| "lineHeight": 18, | ||
| }, | ||
| ] | ||
| } | ||
| > | ||
| Checking for Updates | ||
| </Text> | ||
| </View> | ||
| `; |
| @@ -0,0 +1,91 @@ | ||
| // Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
|
||
| exports[`Placeholder renders correctly 1`] = ` | ||
| <View | ||
| style={ | ||
| Array [ | ||
| Object { | ||
| "backgroundColor": "#E9EBEE", | ||
| "flex": 1, | ||
| "flexDirection": "column", | ||
| "position": "relative", | ||
| }, | ||
| Object { | ||
| "alignItems": "center", | ||
| "justifyContent": "center", | ||
| }, | ||
| ] | ||
| } | ||
| > | ||
| <Text | ||
| accessible={true} | ||
| allowFontScaling={true} | ||
| ellipsizeMode="tail" | ||
| h1={false} | ||
| h2={false} | ||
| h3={false} | ||
| h4={false} | ||
| h5={false} | ||
| onPress={null} | ||
| p={false} | ||
| style={ | ||
| Array [ | ||
| Object { | ||
| "color": "#222222", | ||
| "fontFamily": "HelveticaNeue", | ||
| "fontSize": 14, | ||
| "fontWeight": "500", | ||
| "lineHeight": 18, | ||
| }, | ||
| ] | ||
| } | ||
| > | ||
| Coming soon... | ||
| </Text> | ||
| </View> | ||
| `; | ||
|
|
||
| exports[`Placeholder w/ Text renders correctly 1`] = ` | ||
| <View | ||
| style={ | ||
| Array [ | ||
| Object { | ||
| "backgroundColor": "#E9EBEE", | ||
| "flex": 1, | ||
| "flexDirection": "column", | ||
| "position": "relative", | ||
| }, | ||
| Object { | ||
| "alignItems": "center", | ||
| "justifyContent": "center", | ||
| }, | ||
| ] | ||
| } | ||
| > | ||
| <Text | ||
| accessible={true} | ||
| allowFontScaling={true} | ||
| ellipsizeMode="tail" | ||
| h1={false} | ||
| h2={false} | ||
| h3={false} | ||
| h4={false} | ||
| h5={false} | ||
| onPress={null} | ||
| p={false} | ||
| style={ | ||
| Array [ | ||
| Object { | ||
| "color": "#222222", | ||
| "fontFamily": "HelveticaNeue", | ||
| "fontSize": 14, | ||
| "fontWeight": "500", | ||
| "lineHeight": 18, | ||
| }, | ||
| ] | ||
| } | ||
| > | ||
| Hello world! | ||
| </Text> | ||
| </View> | ||
| `; |
| @@ -0,0 +1,25 @@ | ||
| /** | ||
| * Test to check if the component renders correctly | ||
| */ | ||
| /* global it expect */ | ||
| import { Alert } from 'react-native'; | ||
| import React from 'react'; | ||
| import renderer from 'react-test-renderer'; | ||
|
|
||
| import Error from '@components/general/Error'; | ||
|
|
||
| it('Error renders correctly', () => { | ||
| const tree = renderer.create( | ||
| <Error text={'We can\'t find that'} />, | ||
| ).toJSON(); | ||
|
|
||
| expect(tree).toMatchSnapshot(); | ||
| }); | ||
|
|
||
| it('Error w/ Try Again Button renders correctly', () => { | ||
| const tree = renderer.create( | ||
| <Error tryAgain={() => { Alert.alert('Hey there'); }} />, | ||
| ).toJSON(); | ||
|
|
||
| expect(tree).toMatchSnapshot(); | ||
| }); |
| @@ -0,0 +1,25 @@ | ||
| /** | ||
| * Test to check if the component renders correctly | ||
| */ | ||
| /* global it expect */ | ||
| import 'react-native'; | ||
| import React from 'react'; | ||
| import renderer from 'react-test-renderer'; | ||
|
|
||
| import Loading from '@components/general/Loading'; | ||
|
|
||
| it('Loading renders correctly', () => { | ||
| const tree = renderer.create( | ||
| <Loading />, | ||
| ).toJSON(); | ||
|
|
||
| expect(tree).toMatchSnapshot(); | ||
| }); | ||
|
|
||
| it('Loading w/ text renders correctly', () => { | ||
| const tree = renderer.create( | ||
| <Loading text={'Checking for Updates'} />, | ||
| ).toJSON(); | ||
|
|
||
| expect(tree).toMatchSnapshot(); | ||
| }); |
| @@ -0,0 +1,25 @@ | ||
| /** | ||
| * Test to check if the component renders correctly | ||
| */ | ||
| /* global it expect */ | ||
| import 'react-native'; | ||
| import React from 'react'; | ||
| import renderer from 'react-test-renderer'; | ||
|
|
||
| import Placeholder from '@components/general/Placeholder'; | ||
|
|
||
| it('Placeholder renders correctly', () => { | ||
| const tree = renderer.create( | ||
| <Placeholder />, | ||
| ).toJSON(); | ||
|
|
||
| expect(tree).toMatchSnapshot(); | ||
| }); | ||
|
|
||
| it('Placeholder w/ Text renders correctly', () => { | ||
| const tree = renderer.create( | ||
| <Placeholder text={'Hello world!'} />, | ||
| ).toJSON(); | ||
|
|
||
| expect(tree).toMatchSnapshot(); | ||
| }); |