@aks-dev/easyui 1.0.37 → 1.0.40
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.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: shiguo
|
|
3
3
|
* @Date: 2022-05-05 13:57:25
|
|
4
4
|
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-05-
|
|
5
|
+
* @LastEditTime: 2022-05-25 11:47:17
|
|
6
6
|
* @FilePath: /@aks-dev/easyui/android/src/main/java/com/easyui/UpgradeModule.java
|
|
7
7
|
*/
|
|
8
8
|
package com.easyui;
|
|
@@ -25,6 +25,7 @@ import android.os.Environment;
|
|
|
25
25
|
import android.os.Handler;
|
|
26
26
|
import android.os.Looper;
|
|
27
27
|
import android.os.PowerManager;
|
|
28
|
+
import android.util.DisplayMetrics;
|
|
28
29
|
import android.view.Display;
|
|
29
30
|
import android.view.View;
|
|
30
31
|
import android.view.Window;
|
|
@@ -134,10 +135,14 @@ public class UpgradeModule extends ReactContextBaseJavaModule {
|
|
|
134
135
|
final AlertDialog dialog = builder.show();
|
|
135
136
|
|
|
136
137
|
WindowManager m = currentActivity.getWindowManager();
|
|
137
|
-
Display d = m.getDefaultDisplay();
|
|
138
138
|
WindowManager.LayoutParams p = dialog.getWindow().getAttributes();
|
|
139
|
-
|
|
139
|
+
DisplayMetrics metrics = new DisplayMetrics();
|
|
140
|
+
m.getDefaultDisplay().getMetrics(metrics);
|
|
141
|
+
int widthPixels = metrics.widthPixels;
|
|
142
|
+
p.width = (int) (widthPixels * 0.90);
|
|
140
143
|
p.height = p.width * 780 / 680;
|
|
144
|
+
|
|
145
|
+
|
|
141
146
|
dialog.getWindow().setAttributes(p);
|
|
142
147
|
Window window = dialog.getWindow();
|
|
143
148
|
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
package/ios/UpgradeModule.m
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: shiguo
|
|
3
3
|
* @Date: 2022-05-05 14:19:39
|
|
4
4
|
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-05-24
|
|
5
|
+
* @LastEditTime: 2022-05-24 14:08:49
|
|
6
6
|
* @FilePath: /@aks-dev/easyui/jsbridge/UpgradeModule.tsx
|
|
7
7
|
*/
|
|
8
8
|
import { NativeModules, PermissionsAndroid, Platform } from 'react-native';
|
|
@@ -14,8 +14,8 @@ import type { UpgradeOptions } from '.'
|
|
|
14
14
|
export const getAppVersion = () => UpgradeModule.getAppVersion();
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
export const upgrade = async (
|
|
18
|
-
const { title = '提示' } =
|
|
17
|
+
export const upgrade = async (options: UpgradeOptions ) => {
|
|
18
|
+
const { title = '提示' } = options
|
|
19
19
|
|
|
20
20
|
if (Platform.OS == 'android') {
|
|
21
21
|
try {
|
|
@@ -27,15 +27,15 @@ export const upgrade = async (props: UpgradeOptions) => {
|
|
|
27
27
|
buttonPositive: "确定"
|
|
28
28
|
})
|
|
29
29
|
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
|
|
30
|
-
return UpgradeModule.upgrade(
|
|
31
|
-
} else {
|
|
32
|
-
return Promise.reject("没有应用升级权限!")
|
|
30
|
+
return UpgradeModule.upgrade(options)
|
|
33
31
|
}
|
|
32
|
+
|
|
33
|
+
return Promise.reject("没有应用升级权限!")
|
|
34
34
|
} catch (err) {
|
|
35
35
|
return Promise.reject("请求权限异常!")
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
return UpgradeModule.upgrade(
|
|
40
|
+
return UpgradeModule.upgrade(options)
|
|
41
41
|
}
|
package/jsbridge/index.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: shiguo
|
|
3
3
|
* @Date: 2022-04-19 10:23:01
|
|
4
4
|
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-05-
|
|
5
|
+
* @LastEditTime: 2022-05-24 14:08:39
|
|
6
6
|
* @FilePath: /@aks-dev/easyui/jsbridge/index.ts
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
@@ -25,4 +25,4 @@
|
|
|
25
25
|
* @description: app升级
|
|
26
26
|
* @return {*}
|
|
27
27
|
*/
|
|
28
|
-
export declare const upgrade: (
|
|
28
|
+
export declare const upgrade: (options: UpgradeOptions) => Promise<string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aks-dev/easyui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.40",
|
|
4
4
|
"description": "爱科森开发工具包(react-native)",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"typings": "./src/index.d.ts",
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
"/screen",
|
|
24
24
|
"/jsbridge",
|
|
25
25
|
"/utils",
|
|
26
|
-
"/lib/Echarts/echarts.min.js",
|
|
27
26
|
"/**/*.png",
|
|
28
27
|
"!/tsconfig.json",
|
|
29
28
|
"!/tsconfig.md"
|