Skip to content
This repository was archived by the owner on May 7, 2022. It is now read-only.

Commit daceadd

Browse files
committed
Code cleanup
1 parent dfeb173 commit daceadd

File tree

13 files changed

+107
-106
lines changed

13 files changed

+107
-106
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v2.2.0
14+
- uses: actions/checkout@v2
1515

1616
- name: Setup Node.js environment
17-
uses: actions/setup-node@v1.4.2
17+
uses: actions/setup-node@v1
1818
with:
1919
node-version: 14.x
2020

2121
- name: Restore cache
2222
id: cache
23-
uses: actions/cache@v2.0.0
23+
uses: actions/cache@v2
2424
with:
2525
path: node_modules
2626
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ build/
2929
.gradle
3030
local.properties
3131
*.iml
32-
gradlew
33-
gradlew.bat
34-
gradle/
32+
/android/gradlew
33+
/android/gradlew.bat
34+
/android/gradle/
3535

3636
# Visual Studio Code
3737
#

android/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="chat.flyer.rnandroiduripath">
3-
</manifest>
2+
package="chat.flyer.rnandroiduripath"></manifest>

android/src/main/java/chat/flyer/rnandroiduripath/RNAndroidURIPathModule.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class RNAndroidURIPathModule(reactContext: ReactApplicationContext) : ReactConte
1818
fun getPath(uriString: String): String {
1919
val uri = Uri.parse(uriString)
2020
val cursor = reactApplicationContext.contentResolver.query(uri, null, null, null, null)
21-
cursor ?: return ""
21+
cursor ?: return uriString
2222

2323
val nameIndex = cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME)
2424
cursor.moveToFirst()
@@ -40,6 +40,6 @@ class RNAndroidURIPathModule(reactContext: ReactApplicationContext) : ReactConte
4040
e.printStackTrace()
4141
}
4242

43-
return ""
43+
return uriString
4444
}
4545
}

example/android/app/build.gradle

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
apply plugin: "com.android.application"
2-
apply plugin: "kotlin-android"
1+
apply plugin: 'com.android.application'
2+
apply plugin: 'kotlin-android'
33

44
import com.android.build.OutputFile
55

@@ -82,7 +82,7 @@ project.ext.react = [
8282
enableHermes: false, // clean and rebuild if changing
8383
]
8484

85-
apply from: "../../node_modules/react-native/react.gradle"
85+
apply from: '../../node_modules/react-native/react.gradle'
8686

8787
/**
8888
* Set this to true to create two separate APKs instead of one:
@@ -119,7 +119,7 @@ def jscFlavor = 'org.webkit:android-jsc:+'
119119
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
120120
* and the benefits of using Hermes will therefore be sharply reduced.
121121
*/
122-
def enableHermes = project.ext.react.get("enableHermes", false);
122+
def enableHermes = project.ext.react.get('enableHermes', false);
123123

124124
android {
125125
compileSdkVersion rootProject.ext.compileSdkVersion
@@ -130,18 +130,18 @@ android {
130130
}
131131

132132
defaultConfig {
133-
applicationId "com.example"
133+
applicationId 'com.example'
134134
minSdkVersion rootProject.ext.minSdkVersion
135135
targetSdkVersion rootProject.ext.targetSdkVersion
136136
versionCode 1
137-
versionName "1.0"
137+
versionName '1.0'
138138
}
139139
splits {
140140
abi {
141141
reset()
142142
enable enableSeparateBuildPerCPUArchitecture
143143
universalApk false // If true, also generate a universal APK
144-
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
144+
include 'armeabi-v7a', 'x86', 'arm64-v8a', 'x86_64'
145145
}
146146
}
147147
signingConfigs {
@@ -161,7 +161,7 @@ android {
161161
// see https://reactnative.dev/docs/signed-apk-android.
162162
signingConfig signingConfigs.debug
163163
minifyEnabled enableProguardInReleaseBuilds
164-
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
164+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
165165
}
166166
}
167167

@@ -170,7 +170,7 @@ android {
170170
variant.outputs.each { output ->
171171
// For each separate APK per architecture, set a unique version code as described here:
172172
// https://developer.android.com/studio/build/configure-apk-splits.html
173-
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
173+
def versionCodes = ['armeabi-v7a': 1, 'x86': 2, 'arm64-v8a': 3, 'x86_64': 4]
174174
def abi = output.getFilter(OutputFile.ABI)
175175
if (abi != null) { // null for the universal-debug, universal-release variants
176176
output.versionCodeOverride =
@@ -183,11 +183,11 @@ android {
183183

184184
dependencies {
185185
implementation project(':react-native-android-uri-path')
186-
implementation fileTree(dir: "libs", include: ["*.jar"])
186+
implementation fileTree(dir: 'libs', include: ['*.jar'])
187187
//noinspection GradleDynamicVersion
188-
implementation "com.facebook.react:react-native:+" // From node_modules
188+
implementation 'com.facebook.react:react-native:+' // From node_modules
189189

190-
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
190+
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
191191

192192
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
193193
exclude group: 'com.facebook.fbjni'
@@ -203,9 +203,9 @@ dependencies {
203203
}
204204

205205
if (enableHermes) {
206-
def hermesPath = "../../node_modules/hermes-engine/android/";
207-
debugImplementation files(hermesPath + "hermes-debug.aar")
208-
releaseImplementation files(hermesPath + "hermes-release.aar")
206+
def hermesPath = '../../node_modules/hermes-engine/android/';
207+
debugImplementation files(hermesPath + 'hermes-debug.aar')
208+
releaseImplementation files(hermesPath + 'hermes-release.aar')
209209
} else {
210210
implementation jscFlavor
211211
}
@@ -218,4 +218,4 @@ task copyDownloadableDepsToLibs(type: Copy) {
218218
into 'libs'
219219
}
220220

221-
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
221+
apply from: file('../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle'); applyNativeModulesAppBuildGradle(project)
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.example">
2+
package="com.example">
33

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

66
<application
7-
android:name=".MainApplication"
8-
android:label="@string/app_name"
9-
android:icon="@mipmap/ic_launcher"
10-
android:roundIcon="@mipmap/ic_launcher_round"
11-
android:allowBackup="false"
12-
android:theme="@style/AppTheme">
13-
<activity
14-
android:name=".MainActivity"
7+
android:name=".MainApplication"
8+
android:allowBackup="false"
9+
android:icon="@mipmap/ic_launcher"
1510
android:label="@string/app_name"
16-
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
17-
android:launchMode="singleTask"
18-
android:windowSoftInputMode="adjustResize">
19-
<intent-filter>
20-
<action android:name="android.intent.action.MAIN" />
21-
<category android:name="android.intent.category.LAUNCHER" />
22-
</intent-filter>
23-
</activity>
24-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
11+
android:roundIcon="@mipmap/ic_launcher_round"
12+
android:theme="@style/AppTheme">
13+
<activity
14+
android:name=".MainActivity"
15+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
16+
android:label="@string/app_name"
17+
android:launchMode="singleTask"
18+
android:windowSoftInputMode="adjustResize">
19+
<intent-filter>
20+
<action android:name="android.intent.action.MAIN" />
21+
<category android:name="android.intent.category.LAUNCHER" />
22+
</intent-filter>
23+
</activity>
24+
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
2525
</application>
2626

2727
</manifest>

example/android/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
buildscript {
44
ext {
5-
buildToolsVersion = "29.0.3"
5+
buildToolsVersion = '29.0.3'
66
minSdkVersion = 16
77
compileSdkVersion = 29
88
targetSdkVersion = 29
9-
kotlinVersion = "1.4.10"
9+
kotlinVersion = '1.4.10'
1010
}
1111
repositories {
1212
google()
@@ -26,15 +26,15 @@ allprojects {
2626
mavenLocal()
2727
maven {
2828
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
29-
url("$rootDir/../node_modules/react-native/android")
29+
url "$rootDir/../node_modules/react-native/android"
3030
}
3131
maven {
3232
// Android JSC is installed from npm
33-
url("$rootDir/../node_modules/jsc-android/dist")
33+
url "$rootDir/../node_modules/jsc-android/dist"
3434
}
3535

3636
google()
3737
jcenter()
38-
maven { url 'https://www.jitpack.io' }
38+
maven { url 'https://jitpack.io' }
3939
}
4040
}

example/ios/example.xcodeproj/project.pbxproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
83CBB9F71A601CBA00E9B192 /* Project object */ = {
130130
isa = PBXProject;
131131
attributes = {
132-
LastUpgradeCheck = 1110;
132+
LastUpgradeCheck = 1200;
133133
ORGANIZATIONNAME = Facebook;
134134
TargetAttributes = {
135135
13B07F861A680F5B00A75B9A = {
@@ -368,6 +368,7 @@
368368
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
369369
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
370370
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
371+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
371372
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
372373
CLANG_WARN_STRICT_PROTOTYPES = YES;
373374
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -423,6 +424,7 @@
423424
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
424425
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
425426
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
427+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
426428
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
427429
CLANG_WARN_STRICT_PROTOTYPES = YES;
428430
CLANG_WARN_SUSPICIOUS_MOVE = YES;

example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1140"
3+
LastUpgradeVersion = "1200"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

example/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
"@babel/runtime": "^7.11.2",
2121
"@react-native-community/eslint-config": "^2.0.0",
2222
"@types/jest": "^26.0.14",
23-
"@types/react-native": "^0.63.18",
23+
"@types/react-native": "^0.63.19",
2424
"@types/react-test-renderer": "^16.9.3",
2525
"babel-jest": "^26.3.0",
2626
"eslint": "^7.9.0",
2727
"eslint-plugin-simple-import-sort": "^5.0.3",
2828
"jest": "^26.4.2",
2929
"metro-react-native-babel-preset": "^0.63.0",
3030
"react-test-renderer": "^16.13.1",
31-
"typescript": "^4.0.2"
31+
"typescript": "^4.0.3"
3232
},
3333
"jest": {
3434
"preset": "react-native",

example/yarn.lock

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,9 +1263,9 @@
12631263
integrity sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==
12641264

12651265
"@types/node@*":
1266-
version "14.10.2"
1267-
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.10.2.tgz#9b47a2c8e4dabd4db73b57e750b24af689600514"
1268-
integrity sha512-IzMhbDYCpv26pC2wboJ4MMOa9GKtjplXfcAqrMeNJpUUwpM/2ATt2w1JPUXwS6spu856TvKZL2AOmeU2rAxskw==
1266+
version "14.11.1"
1267+
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.11.1.tgz#56af902ad157e763f9ba63d671c39cda3193c835"
1268+
integrity sha512-oTQgnd0hblfLsJ6BvJzzSL+Inogp3lq9fGgqRkMB/ziKMgEUaFl801OncOzUmalfzt14N0oPHMK47ipl+wbTIw==
12691269

12701270
"@types/normalize-package-data@^2.4.0":
12711271
version "2.4.0"
@@ -1282,10 +1282,10 @@
12821282
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7"
12831283
integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==
12841284

1285-
"@types/react-native@^0.63.18":
1286-
version "0.63.18"
1287-
resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.63.18.tgz#748d82c6453befe97285393ad9530472d8de56af"
1288-
integrity sha512-WwEWqmHiqFn61M1FZR/+frj+E8e2o8i5cPqu9mjbjtZS/gBfCKVESF2ai/KAlaQECkkWkx/nMJeCc5eHMmLQgw==
1285+
"@types/react-native@^0.63.19":
1286+
version "0.63.19"
1287+
resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.63.19.tgz#5302f3fecd47ea83626b0bafacbb0d9f2892a242"
1288+
integrity sha512-iUcejWDCw5gBIezDtSWBpkbB3piIMZau7FAfQqhObCJpCm/7QgVof/aKIP0fCkADYz/qGmIZATMX8kjAS7TVbw==
12891289
dependencies:
12901290
"@types/react" "*"
12911291

@@ -2299,9 +2299,9 @@ data-urls@^2.0.0:
22992299
whatwg-url "^8.0.0"
23002300

23012301
dayjs@^1.8.15:
2302-
version "1.8.35"
2303-
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.8.35.tgz#67118378f15d31623f3ee2992f5244b887606888"
2304-
integrity sha512-isAbIEenO4ilm6f8cpqvgjZCsuerDAz2Kb7ri201AiNn58aqXuaLJEnCtfIMdCvERZHNGRY5lDMTr/jdAnKSWQ==
2302+
version "1.8.36"
2303+
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.8.36.tgz#be36e248467afabf8f5a86bae0de0cdceecced50"
2304+
integrity sha512-3VmRXEtw7RZKAf+4Tv1Ym9AGeo8r8+CjDi26x+7SYQil1UqtqdaokhzoEJohqlzt0m5kacJSDhJQkG/LWhpRBw==
23052305

23062306
[email protected], debug@^2.2.0, debug@^2.3.3:
23072307
version "2.6.9"
@@ -2311,11 +2311,11 @@ [email protected], debug@^2.2.0, debug@^2.3.3:
23112311
ms "2.0.0"
23122312

23132313
debug@^4.0.1, debug@^4.1.0, debug@^4.1.1:
2314-
version "4.1.1"
2315-
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
2316-
integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==
2314+
version "4.2.0"
2315+
resolved "https://registry.yarnpkg.com/debug/-/debug-4.2.0.tgz#7f150f93920e94c58f5574c2fd01a3110effe7f1"
2316+
integrity sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==
23172317
dependencies:
2318-
ms "^2.1.1"
2318+
ms "2.1.2"
23192319

23202320
decamelize@^1.2.0:
23212321
version "1.2.0"
@@ -5013,7 +5013,7 @@ [email protected]:
50135013
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"
50145014
integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==
50155015

5016-
ms@^2.1.1:
5016+
50175017
version "2.1.2"
50185018
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
50195019
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
@@ -5775,9 +5775,9 @@ regexpp@^3.0.0, regexpp@^3.1.0:
57755775
integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==
57765776

57775777
regexpu-core@^4.7.0:
5778-
version "4.7.0"
5779-
resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.7.0.tgz#fcbf458c50431b0bb7b45d6967b8192d91f3d938"
5780-
integrity sha512-TQ4KXRnIn6tz6tjnrXEkD/sshygKH/j5KzK86X8MkeHyZ8qst/LZ89j3X4/8HEIfHANTFIP/AbXakeRhWIl5YQ==
5778+
version "4.7.1"
5779+
resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.7.1.tgz#2dea5a9a07233298fbf0db91fa9abc4c6e0f8ad6"
5780+
integrity sha512-ywH2VUraA44DZQuRKzARmw6S66mr48pQVva4LBeRhcOltJ6hExvWly5ZjFLYo67xbIxb6W1q4bAGtgfEl20zfQ==
57815781
dependencies:
57825782
regenerate "^1.4.0"
57835783
regenerate-unicode-properties "^8.2.0"
@@ -6284,9 +6284,9 @@ spdx-expression-parse@^3.0.0:
62846284
spdx-license-ids "^3.0.0"
62856285

62866286
spdx-license-ids@^3.0.0:
6287-
version "3.0.5"
6288-
resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz#3694b5804567a458d3c8045842a6358632f62654"
6289-
integrity sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==
6287+
version "3.0.6"
6288+
resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz#c80757383c28abf7296744998cbc106ae8b854ce"
6289+
integrity sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw==
62906290

62916291
split-string@^3.0.1, split-string@^3.0.2:
62926292
version "3.1.0"
@@ -6732,10 +6732,10 @@ typedarray@^0.0.6:
67326732
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
67336733
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
67346734

6735-
typescript@^4.0.2:
6736-
version "4.0.2"
6737-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.2.tgz#7ea7c88777c723c681e33bf7988be5d008d05ac2"
6738-
integrity sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==
6735+
typescript@^4.0.3:
6736+
version "4.0.3"
6737+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.3.tgz#153bbd468ef07725c1df9c77e8b453f8d36abba5"
6738+
integrity sha512-tEu6DGxGgRJPb/mVPIZ48e69xCn2yRmCgYmDugAVwmJ6o+0u1RI18eO7E7WBTLYLaEVVOhwQmcdhQHweux/WPg==
67396739

67406740
ua-parser-js@^0.7.18:
67416741
version "0.7.22"

0 commit comments

Comments
 (0)