Commit 4047779fb27f19d7fff7ddc314e506b5aa4aea76
dx: remove rn-bluetooth-status and rn-android-wifi
Andre Staltz committed on 1/4/2020, 2:37:13 PMParent: 3a3e0ac54766595cc6a9614997bbf324f7b2d366
Files changed
android/app/build.gradle | changed |
android/app/src/main/java/se/manyver/MainApplication.java | changed |
android/settings.gradle | changed |
package-lock.json | changed |
package.json | changed |
react-native.config.js | changed |
src/frontend/drivers/network.ts | changed |
android/app/build.gradle | ||
---|---|---|
@@ -230,17 +230,15 @@ | ||
230 | 230 | implementation "ch.acra:acra-dialog:$acraVersion" |
231 | 231 | implementation project(':nodejs-mobile-react-native') |
232 | 232 | implementation project(':@react-native-community_async-storage') |
233 | 233 | implementation project(':react-native-bluetooth-socket-bridge') |
234 | - implementation project(':react-native-bluetooth-status') | |
235 | 234 | implementation project(':react-native-dialogs') |
236 | 235 | implementation project(':react-native-vector-icons') |
237 | 236 | implementation project(':react-native-os-staltz') |
238 | 237 | implementation project(':react-native-randombytes') |
239 | 238 | implementation project(':react-native-image-crop-picker') |
240 | 239 | implementation project(':react-native-navigation') |
241 | 240 | implementation project(':react-native-android-local-notification') |
242 | - implementation project(':react-native-android-wifi') | |
243 | 241 | implementation project(':react-native-has-internet') |
244 | 242 | implementation project(':react-native-flag-secure-android') |
245 | 243 | implementation project(':react-native-orientation-locker') |
246 | 244 | implementation project(':react-native-fs') |
android/app/src/main/java/se/manyver/MainApplication.java | ||
---|---|---|
@@ -20,16 +20,14 @@ | ||
20 | 20 | import com.facebook.soloader.SoLoader; |
21 | 21 | import com.reactnativenavigation.NavigationApplication; |
22 | 22 | import com.reactnativenavigation.react.NavigationReactNativeHost; |
23 | 23 | import com.reactnativenavigation.react.ReactGateway; |
24 | -import com.solinor.bluetoothstatus.RNBluetoothManagerPackage; | |
25 | 24 | import com.scuttlebutt.bluetoothbridge.BluetoothSocketBridgeConfiguration; |
26 | 25 | import com.scuttlebutt.bluetoothbridge.BluetoothSocketBridgePackage; |
27 | 26 | import com.staltz.reactnativeandroidlocalnotification.NotificationPackage; |
28 | 27 | import com.staltz.reactnativehasinternet.HasInternetPackage; |
29 | 28 | import com.staltz.flagsecure.FlagSecurePackage; |
30 | 29 | import com.reactnativecommunity.asyncstorage.AsyncStoragePackage; |
31 | -import com.devstepbcn.wifi.AndroidWifiPackage; | |
32 | 30 | import com.reactnative.ivpusic.imagepicker.PickerPackage; |
33 | 31 | import org.wonday.orientation.OrientationPackage; |
34 | 32 | import com.rnfs.RNFSPackage; |
35 | 33 | import org.devio.rn.splashscreen.SplashScreenReactPackage; |
@@ -87,13 +85,11 @@ | ||
87 | 85 | |
88 | 86 | List<ReactPackage> packages = new ArrayList<>(); |
89 | 87 | packages.add(new BuildConfigPackage()); |
90 | 88 | packages.add(new AsyncStoragePackage()); |
91 | - packages.add(new RNBluetoothManagerPackage()); | |
92 | 89 | packages.add(new BluetoothSocketBridgePackage(bluetoothConfig)); |
93 | 90 | packages.add(new PickerPackage()); |
94 | 91 | packages.add(new HasInternetPackage()); |
95 | - packages.add(new AndroidWifiPackage()); | |
96 | 92 | packages.add(new RandomBytesPackage()); |
97 | 93 | packages.add(new RNNodeJsMobilePackage()); |
98 | 94 | packages.add(new ReactNativeDialogsPackage()); |
99 | 95 | packages.add(new VectorIconsPackage()); |
android/settings.gradle | ||
---|---|---|
@@ -1,10 +1,8 @@ | ||
1 | 1 | rootProject.name = 'Manyverse' |
2 | 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) |
3 | 3 | include ':@react-native-community_async-storage' |
4 | 4 | project(':@react-native-community_async-storage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/async-storage/android') |
5 | -include ':react-native-bluetooth-status' | |
6 | -project(':react-native-bluetooth-status').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-bluetooth-status/android') | |
7 | 5 | include ':react-native-bluetooth-socket-bridge' |
8 | 6 | project(':react-native-bluetooth-socket-bridge').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-bluetooth-socket-bridge/android') |
9 | 7 | include ':react-native-image-crop-picker' |
10 | 8 | project(':react-native-image-crop-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-crop-picker/android') |
@@ -21,10 +19,8 @@ | ||
21 | 19 | include ':react-native-navigation' |
22 | 20 | project(':react-native-navigation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-navigation/lib/android/app/') |
23 | 21 | include ':react-native-android-local-notification' |
24 | 22 | project(':react-native-android-local-notification').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-android-local-notification/android') |
25 | -include ':react-native-android-wifi' | |
26 | -project(':react-native-android-wifi').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-android-wifi/android') | |
27 | 23 | include ':react-native-has-internet' |
28 | 24 | project(':react-native-has-internet').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-has-internet/android') |
29 | 25 | include ':react-native-flag-secure-android' |
30 | 26 | project(':react-native-flag-secure-android').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-flag-secure-android/android') |
package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 758395 bytes New file size: 757454 bytes |
package.json | ||
---|---|---|
@@ -59,11 +59,9 @@ | ||
59 | 59 | "react-human-time": "^1.1.0", |
60 | 60 | "react-markdown": "4.0.2", |
61 | 61 | "react-native": "0.61.5", |
62 | 62 | "react-native-android-local-notification": "3.0.0", |
63 | - "react-native-android-wifi": "0.0.41", | |
64 | 63 | "react-native-bluetooth-socket-bridge": "1.2.0", |
65 | - "react-native-bluetooth-status": "1.3.0", | |
66 | 64 | "react-native-dialogs": "1.1.0", |
67 | 65 | "react-native-flag-secure-android": "1.0.2", |
68 | 66 | "react-native-floating-action": "1.19.1", |
69 | 67 | "react-native-fs": "~2.16.2", |
react-native.config.js | ||
---|---|---|
@@ -16,12 +16,6 @@ | ||
16 | 16 | // On iOS, we are postponing the support for Bluetooth as a transport |
17 | 17 | ios: null, |
18 | 18 | }, |
19 | 19 | }, |
20 | - 'react-native-system-setting': { | |
21 | - platforms: { | |
22 | - // On Android, we use react-native-android-wifi, so we don't need this | |
23 | - android: null, | |
24 | - }, | |
25 | - }, | |
26 | 20 | }, |
27 | 21 | }; |
src/frontend/drivers/network.ts | ||
---|---|---|
@@ -4,11 +4,9 @@ | ||
4 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | 6 | |
7 | 7 | import xs, {Stream, Listener} from 'xstream'; |
8 | -import {BluetoothStatus} from 'react-native-bluetooth-status'; | |
9 | 8 | import {Platform} from 'react-native'; |
10 | -const wifi = require('react-native-android-wifi'); | |
11 | 9 | const SystemSetting = require('react-native-system-setting').default; |
12 | 10 | const hasInternet = require('react-native-has-internet'); |
13 | 11 | |
14 | 12 | export class NetworkSource { |
@@ -23,9 +21,9 @@ | ||
23 | 21 | return; |
24 | 22 | } |
25 | 23 | |
26 | 24 | try { |
27 | - listener.next(await BluetoothStatus.state()); | |
25 | + listener.next(await SystemSetting.isBluetoothEnabled()); | |
28 | 26 | listener.complete(); |
29 | 27 | } catch (e) { |
30 | 28 | listener.error(e); |
31 | 29 | } |
@@ -35,20 +33,11 @@ | ||
35 | 33 | } |
36 | 34 | |
37 | 35 | public wifiIsEnabled(): Stream<boolean> { |
38 | 36 | return xs.create({ |
39 | - start(listener: Listener<boolean>) { | |
40 | - if (Platform.OS === 'android') { | |
41 | - wifi.isEnabled((isEnabled: boolean) => { | |
42 | - listener.next(isEnabled); | |
43 | - listener.complete(); | |
44 | - }); | |
45 | - } else { | |
46 | - SystemSetting.isWifiEnabled().then((isEnabled: boolean) => { | |
47 | - listener.next(isEnabled); | |
48 | - listener.complete(); | |
49 | - }); | |
50 | - } | |
37 | + async start(listener: Listener<boolean>) { | |
38 | + listener.next(await SystemSetting.isWifiEnabled()); | |
39 | + listener.complete(); | |
51 | 40 | }, |
52 | 41 | stop() {}, |
53 | 42 | }); |
54 | 43 | } |
Built with git-ssb-web