@aks-dev/easyui 1.1.5 → 1.2.0
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.
- package/android/build.gradle +43 -28
- package/android/src/main/java/com/easyui/{UpgradeModule.java → RNEasyuiModuleImpl.java} +71 -28
- package/android/src/main/java/com/easyui/RNEasyuiPackage.java +31 -19
- package/android/src/newarch/com/easyui/RNEasyuiModule.java +76 -0
- package/android/src/oldarch/com/easyui/RNEasyuiModule.java +79 -0
- package/dist/components/AnimationModal/AnimationModal.d.ts +5 -6
- package/dist/components/AnimationModal/AnimationModal.d.ts.map +1 -1
- package/dist/components/Hud/AlertBottomView/AlertBottomView.d.ts.map +1 -1
- package/dist/components/Hud/AlertBottomView/AlertBottomView.js +7 -12
- package/dist/components/Hud/AlertBottomView/AlertBottomView.md +245 -0
- package/dist/components/Hud/AlertSheetView/AlertSheetView.d.ts.map +1 -1
- package/dist/components/Hud/AlertSheetView/AlertSheetView.js +7 -12
- package/dist/components/Hud/AlertSheetView/AlertSheetView.md +180 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/jsbridge/RNEasyui.d.ts +28 -3
- package/dist/jsbridge/RNEasyui.d.ts.map +1 -1
- package/dist/jsbridge/RNEasyui.js +36 -1
- package/dist/jsbridge/UpgradeModule.d.ts +3 -3
- package/dist/jsbridge/UpgradeModule.d.ts.map +1 -1
- package/dist/specs/NativeRNEasyui.d.ts +18 -0
- package/dist/specs/NativeRNEasyui.d.ts.map +1 -0
- package/dist/specs/NativeRNEasyui.js +2 -0
- package/package.json +11 -2
- package/src/specs/NativeRNEasyui.ts +20 -0
- package/android/src/main/java/com/easyui/RNEasyuiModule.java +0 -86
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aks-dev/easyui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "工具箱",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"!/tsconfig.md",
|
|
37
37
|
"!/i.sh",
|
|
38
38
|
"!/src/**/assets/*",
|
|
39
|
-
"!/docs"
|
|
39
|
+
"!/docs",
|
|
40
|
+
"/src/specs"
|
|
40
41
|
],
|
|
41
42
|
"homepage": "https://gitee.com/the_period_of_the_ten_kingdoms",
|
|
42
43
|
"repository": {
|
|
@@ -72,5 +73,13 @@
|
|
|
72
73
|
},
|
|
73
74
|
"publishConfig": {
|
|
74
75
|
"registry": "https://registry.npmjs.org/"
|
|
76
|
+
},
|
|
77
|
+
"codegenConfig": {
|
|
78
|
+
"name": "RNEasyuiSpec",
|
|
79
|
+
"type": "modules",
|
|
80
|
+
"jsSrcsDir": "./src/specs",
|
|
81
|
+
"android": {
|
|
82
|
+
"javaPackageName": "com.easyui"
|
|
83
|
+
}
|
|
75
84
|
}
|
|
76
85
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
3
|
+
type UpgradeOptions = {
|
|
4
|
+
title?: string;
|
|
5
|
+
version: string;
|
|
6
|
+
downloadUrl: string;
|
|
7
|
+
note: string;
|
|
8
|
+
force: boolean;
|
|
9
|
+
};
|
|
10
|
+
export interface Spec extends TurboModule {
|
|
11
|
+
getAppVersion(): Promise<string>;
|
|
12
|
+
getOSVersion(): Promise<string>;
|
|
13
|
+
getDeviceBrand(): Promise<string>;
|
|
14
|
+
gotoDesktop():void;
|
|
15
|
+
upgrade: (options: UpgradeOptions) => Promise<string>
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default TurboModuleRegistry.getEnforcing<Spec>(
|
|
19
|
+
'RNEasyui',
|
|
20
|
+
) as Spec;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: shiguo
|
|
3
|
-
* @Date: 2022-04-25 17:57:29
|
|
4
|
-
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-10-24 16:08:50
|
|
6
|
-
* @FilePath: /@aks-dev/easyui/android/src/main/java/com/easyui/RNEasyuiModule.java
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
package com.easyui;
|
|
10
|
-
|
|
11
|
-
import android.content.Intent;
|
|
12
|
-
|
|
13
|
-
import androidx.core.app.ActivityCompat;
|
|
14
|
-
|
|
15
|
-
import com.facebook.react.bridge.Promise;
|
|
16
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
17
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
18
|
-
import com.facebook.react.bridge.ReactMethod;
|
|
19
|
-
import android.os.Build;
|
|
20
|
-
|
|
21
|
-
public class RNEasyuiModule extends ReactContextBaseJavaModule {
|
|
22
|
-
|
|
23
|
-
private final ReactApplicationContext context;
|
|
24
|
-
|
|
25
|
-
public RNEasyuiModule(ReactApplicationContext reactContext) {
|
|
26
|
-
super(reactContext);
|
|
27
|
-
this.context = reactContext;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@Override
|
|
31
|
-
public String getName() {
|
|
32
|
-
return "RNEasyui";
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
@ReactMethod
|
|
37
|
-
public void getDeviceBrand(Promise promise) {
|
|
38
|
-
promise.resolve( Build.BRAND+ Build.MODEL);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
@Deprecated
|
|
42
|
-
@ReactMethod
|
|
43
|
-
public void getStatusBarHeight(final Promise promise) {
|
|
44
|
-
|
|
45
|
-
// int status_bar_height = context.getResources().getDimensionPixelSize(context.getResources().getIdentifier("status_bar_height", "dimen", "android"));
|
|
46
|
-
// promise.resolve(status_bar_height);
|
|
47
|
-
int result = 0;
|
|
48
|
-
int resId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
|
|
49
|
-
if (resId > 0) {
|
|
50
|
-
result = context.getResources().getDimensionPixelSize(resId);
|
|
51
|
-
}
|
|
52
|
-
promise.resolve(result);
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
@Deprecated
|
|
61
|
-
@ReactMethod
|
|
62
|
-
public void getNavigationBarHeight(final Promise promise) {
|
|
63
|
-
|
|
64
|
-
// int navigation_bar_height = context.getResources().getDimensionPixelSize(context.getResources().getIdentifier("navigation_bar_height", "dimen", "android"));
|
|
65
|
-
// promise.resolve(navigation_bar_height);
|
|
66
|
-
|
|
67
|
-
int resourceId = 0;
|
|
68
|
-
int rid = context.getResources().getIdentifier("config_showNavigationBar", "bool", "android");
|
|
69
|
-
if (rid != 0) {
|
|
70
|
-
resourceId = context.getResources().getIdentifier("navigation_bar_height", "dimen", "android");
|
|
71
|
-
int result = context.getResources().getDimensionPixelSize(resourceId);
|
|
72
|
-
promise.resolve(result);
|
|
73
|
-
} else {
|
|
74
|
-
promise.resolve(0);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
@ReactMethod
|
|
80
|
-
public void gotoDesktop() {
|
|
81
|
-
//启动一个意图,回到桌面
|
|
82
|
-
Intent desktop = new Intent(Intent.ACTION_MAIN);
|
|
83
|
-
desktop.addCategory(Intent.CATEGORY_HOME);
|
|
84
|
-
ActivityCompat.startActivity(getCurrentActivity(), desktop, null);
|
|
85
|
-
}
|
|
86
|
-
}
|