react-native-debug-toolkit 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,34 @@
1
+ apply plugin: 'com.android.library'
2
+
3
+ android {
4
+ compileSdkVersion rootProject.ext.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 30
5
+ buildToolsVersion rootProject.ext.hasProperty('buildToolsVersion') ? rootProject.ext.buildToolsVersion : "30.0.3"
6
+
7
+ defaultConfig {
8
+ minSdkVersion rootProject.ext.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 21
9
+ targetSdkVersion rootProject.ext.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 30
10
+ versionCode 1
11
+ versionName "1.0"
12
+ }
13
+
14
+ compileOptions {
15
+ sourceCompatibility JavaVersion.VERSION_1_8
16
+ targetCompatibility JavaVersion.VERSION_1_8
17
+ }
18
+ }
19
+
20
+ repositories {
21
+ mavenCentral()
22
+ maven { url "https://jitpack.io" }
23
+ google()
24
+ }
25
+
26
+ dependencies {
27
+ implementation "com.facebook.react:react-native:+"
28
+ // implementation 'com.didichuxing.doraemonkit:dokit:3.7.1'
29
+ debugImplementation 'io.github.didi.dokit:dokitx:3.7.1'
30
+ releaseImplementation 'io.github.didi.dokit:dokitx-no-op:3.7.1'
31
+ // implementation 'io.github.didi.dokit:dokitx:3.7.1'
32
+ implementation 'com.android.volley:volley:1.2.0'
33
+
34
+ }
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ package="com.reactnative.debuglibs">
4
+
5
+ <uses-permission android:name="android.permission.INTERNET" />
6
+ <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
7
+
8
+ </manifest>
@@ -1,6 +1,7 @@
1
1
  package com.reactnative.debuglibs;
2
2
 
3
3
  import android.app.Application;
4
+ import android.widget.Toast;
4
5
  import androidx.annotation.NonNull;
5
6
 
6
7
  import com.facebook.react.bridge.ReactApplicationContext;
@@ -42,24 +43,28 @@ public class RNDebugLibsModule extends ReactContextBaseJavaModule {
42
43
  // FLEX is iOS only
43
44
  }
44
45
 
45
- @ReactMethod
46
- public void installDoraemonKit(String productId) {
47
- Application app = (Application) reactContext.getApplicationContext();
48
- List<AbstractKit> kits = new ArrayList<>();
49
- // Initialize DoKit with custom kits if needed
50
- DoKit.Builder(app)
51
- .productId(productId)
52
- .customKits(kits)
53
- .build();
54
- }
46
+ // @ReactMethod
47
+ // public void installDoraemonKit(String productId) {
48
+ // Application app = (Application) reactContext.getApplicationContext();
49
+ // List<AbstractKit> kits = new ArrayList<>();
50
+ // // Initialize DoKit with custom kits if needed
51
+ // DoKit.Builder(app)
52
+ // .productId(productId)
53
+ // .customKits(kits)
54
+ // .build();
55
+ // }
55
56
 
56
57
  @ReactMethod
57
58
  public void showDoraemonKit() {
58
59
  DoKit.showToolPanel();
60
+ DoKit.show();
61
+
59
62
  }
60
63
 
61
64
  @ReactMethod
62
65
  public void hideDoraemonKit() {
63
- DoKit.hideToolPanel();
66
+ // Toast.makeText(reactContext, "hideDoraemonKit被调用", Toast.LENGTH_SHORT).show();
67
+ // DoKit.hideToolPanel();
68
+ DoKit.hide();
64
69
  }
65
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-debug-toolkit",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "A simple yet powerful debugging toolkit for React Native with a convenient floating UI for development",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -8,6 +8,9 @@ module.exports = {
8
8
  ios: {
9
9
  podspecPath: "./react-native-debug-toolkit.podspec",
10
10
  sourceDir: "./ios"
11
+ },
12
+ android: {
13
+ sourceDir: "./android"
11
14
  }
12
15
  }
13
16
  }
@@ -1,44 +0,0 @@
1
- package com.debugtoolkit;
2
-
3
- import com.facebook.react.bridge.ReactApplicationContext;
4
- import com.facebook.react.bridge.ReactContextBaseJavaModule;
5
- import com.facebook.react.bridge.ReactMethod;
6
- import com.facebook.react.bridge.Promise;
7
-
8
- import java.util.HashMap;
9
- import java.util.Map;
10
-
11
- public class BuildTypeModule extends ReactContextBaseJavaModule {
12
- private final ReactApplicationContext reactContext;
13
-
14
- public BuildTypeModule(ReactApplicationContext reactContext) {
15
- super(reactContext);
16
- this.reactContext = reactContext;
17
- }
18
-
19
- @Override
20
- public String getName() {
21
- return "BuildTypeModule";
22
- }
23
-
24
- @Override
25
- public Map<String, Object> getConstants() {
26
- final Map<String, Object> constants = new HashMap<>();
27
- constants.put("buildType", BuildConfig.DEBUG ? "debug" : "release");
28
- return constants;
29
- }
30
-
31
- @ReactMethod(isBlockingSynchronousMethod = true)
32
- public String getBuildTypeSync() {
33
- return BuildConfig.DEBUG ? "debug" : "release";
34
- }
35
-
36
- @ReactMethod
37
- public void getBuildType(Promise promise) {
38
- try {
39
- promise.resolve(BuildConfig.DEBUG ? "debug" : "release");
40
- } catch (Exception e) {
41
- promise.reject("ERR_UNEXPECTED", e.getMessage(), e);
42
- }
43
- }
44
- }
@@ -1,24 +0,0 @@
1
- package com.debugtoolkit;
2
-
3
- import com.facebook.react.ReactPackage;
4
- import com.facebook.react.bridge.NativeModule;
5
- import com.facebook.react.bridge.ReactApplicationContext;
6
- import com.facebook.react.uimanager.ViewManager;
7
-
8
- import java.util.ArrayList;
9
- import java.util.Collections;
10
- import java.util.List;
11
-
12
- public class BuildTypePackage implements ReactPackage {
13
- @Override
14
- public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
15
- List<NativeModule> modules = new ArrayList<>();
16
- modules.add(new BuildTypeModule(reactContext));
17
- return modules;
18
- }
19
-
20
- @Override
21
- public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
22
- return Collections.emptyList();
23
- }
24
- }