Skip to content

Commit 6cce09f

Browse files
committed
init commit
0 parents  commit 6cce09f

File tree

243 files changed

+14377
-0
lines changed

Some content is hidden

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

243 files changed

+14377
-0
lines changed

.babelrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["react-native"]
3+
}

.buckconfig

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
[android]
3+
target = Google Inc.:Google APIs:23
4+
5+
[maven_repositories]
6+
central = https://repo1.maven.org/maven2

.flowconfig

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[ignore]
2+
; We fork some components by platform
3+
.*/*[.]android.js
4+
5+
; Ignore "BUCK" generated dirs
6+
<PROJECT_ROOT>/\.buckd/
7+
8+
; Ignore unexpected extra "@providesModule"
9+
.*/node_modules/.*/node_modules/fbjs/.*
10+
11+
; Ignore duplicate module providers
12+
; For RN Apps installed via npm, "Libraries" folder is inside
13+
; "node_modules/react-native" but in the source repo it is in the root
14+
.*/Libraries/react-native/React.js
15+
.*/Libraries/react-native/ReactNative.js
16+
17+
[include]
18+
19+
[libs]
20+
node_modules/react-native/Libraries/react-native/react-native-interface.js
21+
node_modules/react-native/flow
22+
flow/
23+
24+
[options]
25+
module.system=haste
26+
27+
experimental.strict_type_args=true
28+
29+
munge_underscores=true
30+
31+
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
32+
33+
suppress_type=$FlowIssue
34+
suppress_type=$FlowFixMe
35+
suppress_type=$FixMe
36+
37+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-6]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
38+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-6]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
39+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
40+
41+
unsafe.enable_getters_and_setters=true
42+
43+
[version]
44+
^0.36.0

.gitignore

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
project.xcworkspace
24+
25+
# Android/IntelliJ
26+
#
27+
build/
28+
.idea
29+
.gradle
30+
local.properties
31+
*.iml
32+
33+
# node.js
34+
#
35+
node_modules/
36+
npm-debug.log
37+
38+
# BUCK
39+
buck-out/
40+
\.buckd/
41+
android/app/libs
42+
43+
# fastlane
44+
#
45+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
46+
# screenshots whenever they are needed.
47+
# For more information about the recommended setup visit:
48+
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
49+
50+
fastlane/report.xml
51+
fastlane/Preview.html
52+
fastlane/screenshots
53+
54+
# SublimeText
55+
#
56+
*.sublime-*

.watchmanconfig

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2016 Jagger Wang
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# 在球场Demo
2+
3+
本应用可作为开发React Native应用的参考,其中包含了页面导航、定位、图片浏览和视频播放等功能。
4+
5+
## 第三方库
6+
7+
|库名|用途|
8+
|-------|-----------|
9+
|[react-native](https://github.com/facebook/react-native)|React Native|
10+
|[react](https://github.com/facebook/react)|React|
11+
|[redux](http://redux.js.org/)|应用状态管理|
12+
|[redux-persist](https://github.com/rt2zz/redux-persist)|应用状态持久化|
13+
|[react-navigation](https://github.com/react-community/react-navigation)|页面导航|
14+
|[react-native-code-push](react-native-code-push)|代码热更新|
15+
|[react-native-image-crop-picker](https://github.com/ivpusic/react-native-image-crop-picker)|访问相册和相机|
16+
|[react-native-video](https://github.com/react-native-community/react-native-video)|视频播放|
17+
|[react-native-vector-icons](https://github.com/oblador/react-native-vector-icons)|开源矢量图标引用|
18+
19+
## 如何运行
20+
21+
首先参考官方文档 [Getting Started](https://facebook.github.io/react-native/docs/getting-started.html) 安装相关开发工具。
22+
23+
### iOS
24+
25+
仅支持macOS平台,需要先安装Xcode。
26+
27+
Clone代码到本地,然后执行下面的命令。
28+
```
29+
> cd react-native-demo
30+
> npm i
31+
> react-native run-ios
32+
```
33+
34+
### Android
35+
36+
macOS和Windows平台均支持,需要先安装Android Studio,并确保在Android Studio里编译通过(主要是根据提示更新“buildToolsVersion”)。如果要使用模拟器来运行,在Android Studio里打开AVD Manager,创建一个模拟器并启动。如果要使用真实设备来运行,确保真实设备已通过数据线连接到电脑,并且设备已打开开发模式。
37+
38+
Clone代码到本地,然后执行下面的命令。
39+
```
40+
> cd react-native-demo
41+
> npm i
42+
> react-native run-android
43+
```
44+
45+
所有包含原生工程的包都已使用 `react-native link` 链接过,因此无需再次执行。
46+
47+
## 生成Release包
48+
49+
### iOS
50+
51+
在Xcode里打开项目下的ios工程,依次选择 Product => Archive,按照提示操作即可。
52+
53+
### Android
54+
55+
首先执行下面的命令生成密钥文件。提示输入密码时请统一输入“zaiqiuchang”,否则请同步修改“android/app/build.gradle”文件里的“storePassword”和“keyPassword”属性的值。
56+
57+
```
58+
> cd android/app
59+
> keytool -genkey -v -keystore release.keystore -alias release -keyalg RSA -keysize 2048 -validity 10000
60+
```
61+
62+
然后执行下面的命令来打包。生成的签名APK文件路径为“android/app/build/outputs/apk/app-release.apk”。
63+
```
64+
> cd android
65+
> ./gradlew assembleRelease
66+
```

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