Skip to content
This repository was archived by the owner on Feb 25, 2020. It is now read-only.

Commit dd4e0c3

Browse files
committed
chore: eject app
1 parent b5eccaa commit dd4e0c3

53 files changed

Lines changed: 4256 additions & 1247 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

example/App.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import ImageStack from './src/ImageStack';
1919
import TransparentStack from './src/TransparentStack';
2020
import ModalStack from './src/ModalStack';
2121
import ModalPresentation from './src/ModalPresentation';
22-
import LifecycleInteraction from './src/LifecycleInteraction';
23-
import GestureInteraction from './src/GestureInteraction';
22+
//import LifecycleInteraction from './src/LifecycleInteraction';
23+
//import GestureInteraction from './src/GestureInteraction';
2424
import SwitchWithStacks from './src/SwitchWithStacks';
2525
import StackWithDrawer from './src/StackWithDrawer';
2626
import StackWithInput from './src/StackWithInput';
@@ -51,21 +51,21 @@ const data = [
5151
routeName: 'ModalPresentation',
5252
},
5353
{ component: FullScreen, title: 'Full Screen', routeName: 'FullScreen' },
54-
{
55-
component: LifecycleInteraction,
56-
title: 'Lifecycle',
57-
routeName: 'LifecycleStack',
58-
},
54+
// {
55+
// component: LifecycleInteraction,
56+
// title: 'Lifecycle',
57+
// routeName: 'LifecycleStack',
58+
// },
5959
{
6060
component: TransparentStack,
6161
title: 'Transparent',
6262
routeName: 'TransparentStack',
6363
},
64-
{
65-
component: GestureInteraction,
66-
title: 'Gesture Interaction',
67-
routeName: 'GestureInteraction',
68-
},
64+
// {
65+
// component: GestureInteraction,
66+
// title: 'Gesture Interaction',
67+
// routeName: 'GestureInteraction',
68+
// },
6969
{
7070
component: SwitchWithStacks,
7171
title: 'Switch with Stacks',

example/android/app/BUCK

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# To learn about Buck see [Docs](https://buckbuild.com/).
2+
# To run your application with Buck:
3+
# - install Buck
4+
# - `npm start` - to start the packager
5+
# - `cd android`
6+
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
7+
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
8+
# - `buck install -r android/app` - compile, install and run application
9+
#
10+
11+
lib_deps = []
12+
13+
for jarfile in glob(['libs/*.jar']):
14+
name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
15+
lib_deps.append(':' + name)
16+
prebuilt_jar(
17+
name = name,
18+
binary_jar = jarfile,
19+
)
20+
21+
for aarfile in glob(['libs/*.aar']):
22+
name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
23+
lib_deps.append(':' + name)
24+
android_prebuilt_aar(
25+
name = name,
26+
aar = aarfile,
27+
)
28+
29+
android_library(
30+
name = "all-libs",
31+
exported_deps = lib_deps,
32+
)
33+
34+
android_library(
35+
name = "app-code",
36+
srcs = glob([
37+
"src/main/java/**/*.java",
38+
]),
39+
deps = [
40+
":all-libs",
41+
":build_config",
42+
":res",
43+
],
44+
)
45+
46+
android_build_config(
47+
name = "build_config",
48+
package = "com.stackexample",
49+
)
50+
51+
android_resource(
52+
name = "res",
53+
package = "com.stackexample",
54+
res = "src/main/res",
55+
)
56+
57+
android_binary(
58+
name = "app",
59+
keystore = "//android/keystores:debug",
60+
manifest = "src/main/AndroidManifest.xml",
61+
package_type = "debug",
62+
deps = [
63+
":app-code",
64+
],
65+
)

example/android/app/app.iml

Lines changed: 220 additions & 0 deletions
Large diffs are not rendered by default.

example/android/app/build.gradle

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
apply plugin: "com.android.application"
2+
apply from: '../../node_modules/react-native-unimodules/gradle.groovy'
3+
4+
import com.android.build.OutputFile
5+
6+
/**
7+
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
8+
* and bundleReleaseJsAndAssets).
9+
* These basically call `react-native bundle` with the correct arguments during the Android build
10+
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
11+
* bundle directly from the development server. Below you can see all the possible configurations
12+
* and their defaults. If you decide to add a configuration block, make sure to add it before the
13+
* `apply from: "../../node_modules/react-native/react.gradle"` line.
14+
*
15+
* project.ext.react = [
16+
* // the name of the generated asset file containing your JS bundle
17+
* bundleAssetName: "index.android.bundle",
18+
*
19+
* // the entry file for bundle generation
20+
* entryFile: "index.android.js",
21+
*
22+
* // whether to bundle JS and assets in debug mode
23+
* bundleInDebug: false,
24+
*
25+
* // whether to bundle JS and assets in release mode
26+
* bundleInRelease: true,
27+
*
28+
* // whether to bundle JS and assets in another build variant (if configured).
29+
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
30+
* // The configuration property can be in the following formats
31+
* // 'bundleIn${productFlavor}${buildType}'
32+
* // 'bundleIn${buildType}'
33+
* // bundleInFreeDebug: true,
34+
* // bundleInPaidRelease: true,
35+
* // bundleInBeta: true,
36+
*
37+
* // whether to disable dev mode in custom build variants (by default only disabled in release)
38+
* // for example: to disable dev mode in the staging build type (if configured)
39+
* devDisabledInStaging: true,
40+
* // The configuration property can be in the following formats
41+
* // 'devDisabledIn${productFlavor}${buildType}'
42+
* // 'devDisabledIn${buildType}'
43+
*
44+
* // the root of your project, i.e. where "package.json" lives
45+
* root: "../../",
46+
*
47+
* // where to put the JS bundle asset in debug mode
48+
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
49+
*
50+
* // where to put the JS bundle asset in release mode
51+
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
52+
*
53+
* // where to put drawable resources / React Native assets, e.g. the ones you use via
54+
* // require('./image.png')), in debug mode
55+
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
56+
*
57+
* // where to put drawable resources / React Native assets, e.g. the ones you use via
58+
* // require('./image.png')), in release mode
59+
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
60+
*
61+
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
62+
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
63+
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
64+
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
65+
* // for example, you might want to remove it from here.
66+
* inputExcludes: ["android/**", "ios/**"],
67+
*
68+
* // override which node gets called and with what additional arguments
69+
* nodeExecutableAndArgs: ["node"],
70+
*
71+
* // supply additional arguments to the packager
72+
* extraPackagerArgs: []
73+
* ]
74+
*/
75+
76+
project.ext.react = [
77+
entryFile: "index.js",
78+
]
79+
80+
apply from: '../../node_modules/react-native-unimodules/gradle.groovy'
81+
apply from: "../../node_modules/react-native/react.gradle"
82+
83+
/**
84+
* Set this to true to create two separate APKs instead of one:
85+
* - An APK that only works on ARM devices
86+
* - An APK that only works on x86 devices
87+
* The advantage is the size of the APK is reduced by about 4MB.
88+
* Upload all the APKs to the Play Store and people will download
89+
* the correct one based on the CPU architecture of their device.
90+
*/
91+
def enableSeparateBuildPerCPUArchitecture = false
92+
93+
/**
94+
* Run Proguard to shrink the Java bytecode in release builds.
95+
*/
96+
def enableProguardInReleaseBuilds = false
97+
98+
android {
99+
compileSdkVersion rootProject.ext.compileSdkVersion
100+
buildToolsVersion rootProject.ext.buildToolsVersion
101+
102+
defaultConfig {
103+
applicationId "com.stackexample"
104+
minSdkVersion rootProject.ext.minSdkVersion
105+
targetSdkVersion rootProject.ext.targetSdkVersion
106+
versionCode 1
107+
versionName "1.0"
108+
vectorDrawables.useSupportLibrary = true
109+
}
110+
splits {
111+
abi {
112+
reset()
113+
enable enableSeparateBuildPerCPUArchitecture
114+
universalApk false // If true, also generate a universal APK
115+
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
116+
}
117+
}
118+
buildTypes {
119+
release {
120+
minifyEnabled enableProguardInReleaseBuilds
121+
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
122+
}
123+
}
124+
// applicationVariants are e.g. debug, release
125+
applicationVariants.all { variant ->
126+
variant.outputs.each { output ->
127+
// For each separate APK per architecture, set a unique version code as described here:
128+
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
129+
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
130+
def abi = output.getFilter(OutputFile.ABI)
131+
if (abi != null) { // null for the universal-debug, universal-release variants
132+
output.versionCodeOverride =
133+
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
134+
}
135+
}
136+
}
137+
compileOptions {
138+
sourceCompatibility JavaVersion.VERSION_1_8
139+
targetCompatibility JavaVersion.VERSION_1_8
140+
}
141+
}
142+
143+
dependencies {
144+
implementation project(':react-native-screens')
145+
implementation project(':react-native-reanimated')
146+
implementation project(':react-native-gesture-handler')
147+
implementation fileTree(dir: "libs", include: ["*.jar"])
148+
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
149+
implementation "com.facebook.react:react-native:+" // From node_modules
150+
implementation "com.google.android.gms:play-services-base:+"
151+
implementation 'org.webkit:android-jsc:+'
152+
addUnimodulesDependencies()
153+
}
154+
155+
// Run this once to be able to run the application with BUCK
156+
// puts all compile dependencies into folder libs for BUCK to use
157+
task copyDownloadableDepsToLibs(type: Copy) {
158+
from configurations.compile
159+
into 'libs'
160+
}

example/android/app/build_defs.bzl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""Helper definitions to glob .aar and .jar targets"""
2+
3+
def create_aar_targets(aarfiles):
4+
for aarfile in aarfiles:
5+
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
6+
lib_deps.append(":" + name)
7+
android_prebuilt_aar(
8+
name = name,
9+
aar = aarfile,
10+
)
11+
12+
def create_jar_targets(jarfiles):
13+
for jarfile in jarfiles:
14+
name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
15+
lib_deps.append(":" + name)
16+
prebuilt_jar(
17+
name = name,
18+
binary_jar = jarfile,
19+
)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.stackexample">
3+
4+
<uses-permission android:name="android.permission.INTERNET" />
5+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6+
7+
<!-- OPTIONAL PERMISSIONS, REMOVE WHATEVER YOU DO NOT NEED -->
8+
<uses-permission android:name="android.permission.MANAGE_DOCUMENTS" />
9+
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />
10+
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
11+
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
12+
<uses-permission android:name="android.permission.VIBRATE" />
13+
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
14+
15+
<!-- These require runtime permissions on M -->
16+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
17+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
18+
<uses-permission android:name="android.permission.CAMERA" />
19+
<uses-permission android:name="android.permission.READ_CONTACTS" />
20+
<uses-permission android:name="android.permission.READ_CALENDAR" />
21+
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
22+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
23+
<uses-permission android:name="android.permission.RECORD_AUDIO" />
24+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
25+
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
26+
<!-- END OPTIONAL PERMISSIONS -->
27+
28+
<application
29+
android:networkSecurityConfig="@xml/network_security_config"
30+
android:name=".MainApplication"
31+
android:label="@string/app_name"
32+
android:icon="@mipmap/ic_launcher"
33+
android:roundIcon="@mipmap/ic_launcher_round"
34+
android:allowBackup="false"
35+
android:theme="@style/AppTheme">
36+
<activity
37+
android:name=".MainActivity"
38+
android:label="@string/app_name"
39+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
40+
android:windowSoftInputMode="adjustResize">
41+
<intent-filter>
42+
<action android:name="android.intent.action.MAIN" />
43+
<category android:name="android.intent.category.LAUNCHER" />
44+
</intent-filter>
45+
</activity>
46+
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
47+
</application>
48+
49+
</manifest>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.stackexample;
2+
3+
import com.facebook.react.ReactActivity;
4+
import com.facebook.react.ReactActivityDelegate;
5+
import com.facebook.react.ReactRootView;
6+
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
7+
8+
public class MainActivity extends ReactActivity {
9+
10+
/**
11+
* Returns the name of the main component registered from JavaScript.
12+
* This is used to schedule rendering of the component.
13+
*/
14+
@Override
15+
protected String getMainComponentName() {
16+
return "stackexample";
17+
}
18+
19+
@Override
20+
protected ReactActivityDelegate createReactActivityDelegate() {
21+
return new ReactActivityDelegate(this, getMainComponentName()) {
22+
@Override
23+
protected ReactRootView createRootView() {
24+
return new RNGestureHandlerEnabledRootView(MainActivity.this);
25+
}
26+
};
27+
}
28+
}

0 commit comments

Comments
 (0)