Skip to content

Commit 624fb54

Browse files
author
Augsorn Chanklad
committed
Merge branch 'develop'
2 parents bced0cd + 6146260 commit 624fb54

File tree

172 files changed

+3843
-346
lines changed

Some content is hidden

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

172 files changed

+3843
-346
lines changed

.babelrc

+17-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
{
2-
"presets": ["babel-preset-expo"],
3-
"plugins": [ [ "babel-plugin-root-import", [ { "rootPathSuffix": "src" } ] ] ],
2+
"presets": [
3+
"babel-preset-react-native-stage-0/decorator-support"
4+
],
5+
"plugins": [
6+
[
7+
"babel-plugin-root-import",
8+
[
9+
{
10+
"rootPathSuffix": "src"
11+
}
12+
]
13+
]
14+
],
415
"env": {
516
"development": {
6-
"plugins": ["transform-react-jsx-source"]
17+
"plugins": [
18+
"transform-react-jsx-source"
19+
]
720
}
821
}
9-
}
22+
}

App.js

-18
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import appStore from './src/app/appStore'
66
import { PersistGate } from 'redux-persist/integration/react'
77
import { StyleProvider } from 'native-base'
88
import { View } from 'react-native'
9-
import { Font } from 'expo';
109
import StorybookUI from './storybook';
1110
import { COLOR, ThemeProvider } from 'react-native-material-ui';
1211

@@ -25,26 +24,9 @@ const uiTheme = {
2524
class App extends React.Component {
2625
constructor(props) {
2726
super(props)
28-
this.state = {
29-
fontLoaded: false
30-
};
31-
}
32-
33-
async componentDidMount() {
34-
await Font.loadAsync({
35-
'Roboto': require('native-base/Fonts/Roboto.ttf'),
36-
'Roboto_medium': require('native-base/Fonts/Roboto_medium.ttf'),
37-
});
38-
39-
this.setState({ fontLoaded: true });
4027
}
4128

4229
render () {
43-
44-
if(!this.state.fontLoaded) {
45-
return (<View />)
46-
}
47-
4830
return (
4931
<ThemeProvider uiTheme={uiTheme}>
5032
<Provider store={appStore().store}>

README.md

+16-24
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ New VocaDB app with React native.
88
## Download
99

1010
- [Playstore](https://play.google.com/store/apps/details?id=com.coolappz.Vocadb)
11-
- [Alpha/Beta](https://play.google.com/apps/testing/com.coolappz.Vocadb)
11+
- [Playstore (Alpha/Beta)](https://play.google.com/apps/testing/com.coolappz.Vocadb)
1212

1313
## Setup on local
1414

1515
### Prerequisite
1616
- [NodeJS](https://nodejs.org/en/)
17-
- [Expo Client](https://expo.io) (Availiable on both [iOS](https://itunes.apple.com/app/apple-store/id982107779?ct=www&mt=8) and [Android](https://play.google.com/store/apps/details?id=host.exp.exponent&referrer=www))
17+
- [react-native-cli](https://www.npmjs.com/package/react-native-cli)
1818
- [Storybook](https://storybook.js.org) like a component dictionary.
1919

2020
### Install
@@ -40,38 +40,20 @@ $ npm run storybook
4040

4141
### Run App
4242

43-
There was several ways to run app.
44-
4543
#### iOS
4644
Mac OS Only. You must have Xcode installed first.
4745

4846
```shell
49-
$ npm run ios
47+
$ react-native run-ios
5048
```
5149

5250
#### Android
5351

54-
I never tried this before but you can try if you have android emulator or with actual device.
55-
```shell
56-
$ npm run android
57-
```
58-
59-
#### Default Expo
60-
6152
```shell
62-
$ npm start
53+
$ react-native run-android
6354
```
6455

65-
Now you can use Expo app to scan QR code that display in terminal (make sure you are in the same network with your PC)
66-
67-
#### Expo XDE
68-
[Expo XDE](https://docs.expo.io/versions/latest/introduction/installation.html) is required.
69-
70-
- Open Expo XDE
71-
- Open Project
72-
- Locate to VocaDB-App directory
73-
- Wait for building script
74-
- When done. You can sacn QR code from `Share` button via `Expo Client` from your phone.
56+
Getting started instruction is [here](https://facebook.github.io/react-native/docs/getting-started.html)
7557

7658
#### Using storybook
7759

@@ -81,4 +63,14 @@ See in `App.js` file.
8163
- Export `App` if you want to test real app.
8264

8365
### Config
84-
in *src/constants/config* you can switch **useMock** to **false** to fetch real data from VocaDB API instead of mock.
66+
in *src/constants/config* you can switch **useMock** to **false** to fetch real data from VocaDB API instead of mock.
67+
68+
## Assets
69+
70+
Icon and splash images are inside *resources* directory.
71+
72+
- Icon 1024x1024 px
73+
74+
- Splash 2208x2208 px
75+
76+
Generated with [React Native Toolbox](https://github.com/bamlab/generator-rn-toolbox)

android/.gitignore

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Built application files
2+
*.apk
3+
*.ap_
4+
5+
# Files for the ART/Dalvik VM
6+
*.dex
7+
8+
# Java class files
9+
*.class
10+
11+
# Generated files
12+
bin/
13+
gen/
14+
out/
15+
16+
# Gradle files
17+
.gradle/
18+
build/
19+
20+
# Local configuration file (sdk path, etc)
21+
local.properties
22+
23+
# Proguard folder generated by Eclipse
24+
proguard/
25+
26+
# Log Files
27+
*.log
28+
29+
# Android Studio Navigation editor temp files
30+
.navigation/
31+
32+
# Android Studio captures folder
33+
captures/
34+
35+
# IntelliJ
36+
*.iml
37+
.idea/workspace.xml
38+
.idea/tasks.xml
39+
.idea/gradle.xml
40+
.idea/assetWizardSettings.xml
41+
.idea/dictionaries
42+
.idea/libraries
43+
.idea/caches
44+
45+
# Keystore files
46+
# Uncomment the following line if you do not want to check your keystore files in.
47+
#*.jks
48+
49+
# External native build folder generated in Android Studio 2.2 and later
50+
.externalNativeBuild
51+
52+
# Google Services (e.g. APIs or Firebase)
53+
google-services.json
54+
55+
# Freeline
56+
freeline.py
57+
freeline/
58+
freeline_project_description.json
59+
60+
# fastlane
61+
fastlane/report.xml
62+
fastlane/Preview.html
63+
fastlane/screenshots
64+
fastlane/test_output
65+
fastlane/readme.md

android/app/BUCK

+65
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.vocadb",
49+
)
50+
51+
android_resource(
52+
name = "res",
53+
package = "com.vocadb",
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+
)

0 commit comments

Comments
 (0)