Skip to content

Commit 9fcbaab

Browse files
authored
Add files via upload
1 parent e2835b1 commit 9fcbaab

Some content is hidden

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

47 files changed

+2396
-266
lines changed

mobile/android/app/BUCK

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12+
13+
lib_deps = []
14+
15+
create_aar_targets(glob(["libs/*.aar"]))
16+
17+
create_jar_targets(glob(["libs/*.jar"]))
18+
19+
android_library(
20+
name = "all-libs",
21+
exported_deps = lib_deps,
22+
)
23+
24+
android_library(
25+
name = "app-code",
26+
srcs = glob([
27+
"src/main/java/**/*.java",
28+
]),
29+
deps = [
30+
":all-libs",
31+
":build_config",
32+
":res",
33+
],
34+
)
35+
36+
android_build_config(
37+
name = "build_config",
38+
package = "com.mobile",
39+
)
40+
41+
android_resource(
42+
name = "res",
43+
package = "com.mobile",
44+
res = "src/main/res",
45+
)
46+
47+
android_binary(
48+
name = "app",
49+
keystore = "//android/keystores:debug",
50+
manifest = "src/main/AndroidManifest.xml",
51+
package_type = "debug",
52+
deps = [
53+
":app-code",
54+
],
55+
)

mobile/android/app/build.gradle

+6-31
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ import com.android.build.OutputFile
1515
* // the name of the generated asset file containing your JS bundle
1616
* bundleAssetName: "index.android.bundle",
1717
*
18-
* // the entry file for bundle generation. If none specified and
19-
* // "index.android.js" exists, it will be used. Otherwise "index.js" is
20-
* // default. Can be overridden with ENTRY_FILE environment variable.
18+
* // the entry file for bundle generation
2119
* entryFile: "index.android.js",
2220
*
2321
* // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format
@@ -78,6 +76,7 @@ import com.android.build.OutputFile
7876
*/
7977

8078
project.ext.react = [
79+
entryFile: "index.js",
8180
enableHermes: false, // clean and rebuild if changing
8281
]
8382

@@ -129,7 +128,7 @@ android {
129128
}
130129

131130
defaultConfig {
132-
applicationId "com.appgobarber"
131+
applicationId "com.mobile"
133132
minSdkVersion rootProject.ext.minSdkVersion
134133
targetSdkVersion rootProject.ext.targetSdkVersion
135134
versionCode 1
@@ -163,14 +162,6 @@ android {
163162
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
164163
}
165164
}
166-
167-
packagingOptions {
168-
pickFirst "lib/armeabi-v7a/libc++_shared.so"
169-
pickFirst "lib/arm64-v8a/libc++_shared.so"
170-
pickFirst "lib/x86/libc++_shared.so"
171-
pickFirst "lib/x86_64/libc++_shared.so"
172-
}
173-
174165
// applicationVariants are e.g. debug, release
175166
applicationVariants.all { variant ->
176167
variant.outputs.each { output ->
@@ -189,23 +180,8 @@ android {
189180

190181
dependencies {
191182
implementation fileTree(dir: "libs", include: ["*.jar"])
192-
//noinspection GradleDynamicVersion
193183
implementation "com.facebook.react:react-native:+" // From node_modules
194184

195-
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
196-
197-
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
198-
exclude group:'com.facebook.fbjni'
199-
}
200-
201-
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
202-
exclude group:'com.facebook.flipper'
203-
}
204-
205-
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
206-
exclude group:'com.facebook.flipper'
207-
}
208-
209185
if (enableHermes) {
210186
def hermesPath = "../../node_modules/hermes-engine/android/";
211187
debugImplementation files(hermesPath + "hermes-debug.aar")
@@ -222,10 +198,9 @@ task copyDownloadableDepsToLibs(type: Copy) {
222198
into 'libs'
223199
}
224200

225-
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
226-
227201
project.ext.vectoricons = [
228-
iconFontName: ['Feather.ttf']
229-
];
202+
iconFontNames: [ 'MaterialIcons.ttf' ] // Name of the font files you want to copy
203+
]
230204

231205
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
206+
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

mobile/android/app/src/main/AndroidManifest.xml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.appgobarber">
2+
package="com.mobile">
33

44
<uses-permission android:name="android.permission.INTERNET" />
55

@@ -13,8 +13,7 @@
1313
<activity
1414
android:name=".MainActivity"
1515
android:label="@string/app_name"
16-
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
17-
android:launchMode="singleTask"
16+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
1817
android:windowSoftInputMode="adjustResize">
1918
<intent-filter>
2019
<action android:name="android.intent.action.MAIN" />

mobile/android/app/src/main/assets/index.android.bundle

+395
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.mobile;
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. This is used to schedule
12+
* rendering of the component.
13+
*/
14+
@Override
15+
protected String getMainComponentName() {
16+
return "mobile";
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+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
package com.mobile;
2+
3+
import android.app.Application;
4+
import android.content.Context;
5+
import com.facebook.react.PackageList;
6+
import com.facebook.react.ReactApplication;
7+
import com.facebook.react.ReactNativeHost;
8+
import com.facebook.react.ReactPackage;
9+
import com.facebook.soloader.SoLoader;
10+
import java.lang.reflect.InvocationTargetException;
11+
import java.util.List;
12+
13+
public class MainApplication extends Application implements ReactApplication {
14+
15+
private final ReactNativeHost mReactNativeHost =
16+
new ReactNativeHost(this) {
17+
@Override
18+
public boolean getUseDeveloperSupport() {
19+
return BuildConfig.DEBUG;
20+
}
21+
22+
@Override
23+
protected List<ReactPackage> getPackages() {
24+
@SuppressWarnings("UnnecessaryLocalVariable")
25+
List<ReactPackage> packages = new PackageList(this).getPackages();
26+
// Packages that cannot be autolinked yet can be added manually here, for example:
27+
// packages.add(new MyReactNativePackage());
28+
return packages;
29+
}
30+
31+
@Override
32+
protected String getJSMainModuleName() {
33+
return "index";
34+
}
35+
};
36+
37+
@Override
38+
public ReactNativeHost getReactNativeHost() {
39+
return mReactNativeHost;
40+
}
41+
42+
@Override
43+
public void onCreate() {
44+
super.onCreate();
45+
SoLoader.init(this, /* native exopackage */ false);
46+
initializeFlipper(this); // Remove this line if you don't want Flipper enabled
47+
}
48+
49+
/**
50+
* Loads Flipper in React Native templates.
51+
*
52+
* @param context
53+
*/
54+
private static void initializeFlipper(Context context) {
55+
if (BuildConfig.DEBUG) {
56+
try {
57+
/*
58+
We use reflection here to pick up the class that initializes Flipper,
59+
since Flipper library is not available in release mode
60+
*/
61+
Class<?> aClass = Class.forName("com.facebook.flipper.ReactNativeFlipper");
62+
aClass.getMethod("initializeFlipper", Context.class).invoke(null, context);
63+
} catch (ClassNotFoundException e) {
64+
e.printStackTrace();
65+
} catch (NoSuchMethodException e) {
66+
e.printStackTrace();
67+
} catch (IllegalAccessException e) {
68+
e.printStackTrace();
69+
} catch (InvocationTargetException e) {
70+
e.printStackTrace();
71+
}
72+
}
73+
}
74+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "mobile",
3+
"displayName": "mobile"
4+
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<resources>
2-
<string name="app_name">appgobarber</string>
2+
<string name="app_name">mobile</string>
33
</resources>

mobile/android/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ buildscript {
1212
jcenter()
1313
}
1414
dependencies {
15-
classpath("com.android.tools.build:gradle:3.5.2")
15+
classpath("com.android.tools.build:gradle:3.4.2")
1616

1717
// NOTE: Do not place your application dependencies here; they belong
1818
// in the individual module build.gradle files
@@ -33,6 +33,6 @@ allprojects {
3333

3434
google()
3535
jcenter()
36-
maven { url 'https://www.jitpack.io' }
36+
maven { url 'https://jitpack.io' }
3737
}
3838
}

mobile/android/gradle.properties

-7
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,5 @@
1717
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1818
# org.gradle.parallel=true
1919

20-
# AndroidX package structure to make it clearer which packages are bundled with the
21-
# Android operating system, and which are packaged with your app's APK
22-
# https://developer.android.com/topic/libraries/support-library/androidx-rn
2320
android.useAndroidX=true
24-
# Automatically convert third-party libraries to use AndroidX
2521
android.enableJetifier=true
26-
27-
# Version of flipper SDK to use with React Native
28-
FLIPPER_VERSION=0.33.1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

mobile/android/gradlew

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# you may not use this file except in compliance with the License.
88
# You may obtain a copy of the License at
99
#
10-
# https://www.apache.org/licenses/LICENSE-2.0
10+
# http://www.apache.org/licenses/LICENSE-2.0
1111
#
1212
# Unless required by applicable law or agreed to in writing, software
1313
# distributed under the License is distributed on an "AS IS" BASIS,
@@ -125,8 +125,8 @@ if $darwin; then
125125
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
126126
fi
127127

128-
# For Cygwin or MSYS, switch paths to Windows format before running java
129-
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
128+
# For Cygwin, switch paths to Windows format before running java
129+
if $cygwin ; then
130130
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131131
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
132132
JAVACMD=`cygpath --unix "$JAVACMD"`

0 commit comments

Comments
 (0)