@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.
Files changed (27) hide show
  1. package/android/build.gradle +43 -28
  2. package/android/src/main/java/com/easyui/{UpgradeModule.java → RNEasyuiModuleImpl.java} +71 -28
  3. package/android/src/main/java/com/easyui/RNEasyuiPackage.java +31 -19
  4. package/android/src/newarch/com/easyui/RNEasyuiModule.java +76 -0
  5. package/android/src/oldarch/com/easyui/RNEasyuiModule.java +79 -0
  6. package/dist/components/AnimationModal/AnimationModal.d.ts +5 -6
  7. package/dist/components/AnimationModal/AnimationModal.d.ts.map +1 -1
  8. package/dist/components/Hud/AlertBottomView/AlertBottomView.d.ts.map +1 -1
  9. package/dist/components/Hud/AlertBottomView/AlertBottomView.js +7 -12
  10. package/dist/components/Hud/AlertBottomView/AlertBottomView.md +245 -0
  11. package/dist/components/Hud/AlertSheetView/AlertSheetView.d.ts.map +1 -1
  12. package/dist/components/Hud/AlertSheetView/AlertSheetView.js +7 -12
  13. package/dist/components/Hud/AlertSheetView/AlertSheetView.md +180 -0
  14. package/dist/index.d.ts +1 -2
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +2 -2
  17. package/dist/jsbridge/RNEasyui.d.ts +28 -3
  18. package/dist/jsbridge/RNEasyui.d.ts.map +1 -1
  19. package/dist/jsbridge/RNEasyui.js +36 -1
  20. package/dist/jsbridge/UpgradeModule.d.ts +3 -3
  21. package/dist/jsbridge/UpgradeModule.d.ts.map +1 -1
  22. package/dist/specs/NativeRNEasyui.d.ts +18 -0
  23. package/dist/specs/NativeRNEasyui.d.ts.map +1 -0
  24. package/dist/specs/NativeRNEasyui.js +2 -0
  25. package/package.json +11 -2
  26. package/src/specs/NativeRNEasyui.ts +20 -0
  27. package/android/src/main/java/com/easyui/RNEasyuiModule.java +0 -86
@@ -1,51 +1,66 @@
1
-
2
1
  buildscript {
3
- if (project == rootProject) {
4
- repositories {
5
- mavenCentral()
6
- google()
7
- ///https://blog.csdn.net/xiaopihair123/article/details/119422895
8
- // maven{ url 'https://maven.aliyun.com/repository/google'}
9
- // maven{ url 'https://maven.aliyun.com/repository/gradle-plugin'}
10
- // maven{ url 'https://maven.aliyun.com/repository/public'}
11
- // maven{ url 'https://maven.aliyun.com/repository/jcenter'}
12
- }
13
-
14
- dependencies {
15
- classpath("com.android.tools.build:gradle:4.2.2")
16
- }
2
+ ext.safeExtGet = {prop, fallback ->
3
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
4
+ }
5
+ repositories {
6
+ google()
7
+ gradlePluginPortal()
8
+ }
9
+ dependencies {
10
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet("kotlinVersion", "1.9.24")}")
11
+ classpath("com.android.tools.build:gradle:8.13.0")
17
12
  }
18
13
  }
19
14
 
20
- apply plugin: 'com.android.library'
21
-
22
-
15
+ def isNewArchitectureEnabled() {
16
+ return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
17
+ }
23
18
 
19
+ apply plugin: "com.android.library"
20
+ apply plugin: "kotlin-android"
24
21
 
25
- def safeExtGet(prop, fallback) {
26
- rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
22
+ if (isNewArchitectureEnabled()) {
23
+ apply plugin: "com.facebook.react"
27
24
  }
28
25
 
29
-
30
26
  android {
31
- compileSdkVersion safeExtGet('compileSdkVersion', 30)
27
+ namespace "com.easyui"
28
+
29
+ buildToolsVersion safeExtGet("buildToolsVersion", "35.0.0")
30
+ compileSdkVersion safeExtGet("compileSdkVersion", 35)
32
31
 
32
+ buildFeatures {
33
+ buildConfig true
34
+ }
33
35
  defaultConfig {
34
- minSdkVersion safeExtGet('minSdkVersion', 21)
35
- //noinspection OldTargetApi
36
- targetSdkVersion safeExtGet('targetSdkVersion', 30)
36
+ buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString())
37
+ minSdkVersion safeExtGet("minSdkVersion", 24)
38
+ targetSdkVersion safeExtGet("targetSdkVersion", 35)
37
39
  }
38
40
  lintOptions {
39
41
  abortOnError false
40
42
  }
43
+ sourceSets {
44
+ main {
45
+ if (isNewArchitectureEnabled()) {
46
+ java.srcDirs += ["src/newarch"]
47
+ } else {
48
+ java.srcDirs += ["src/oldarch"]
49
+ }
50
+ }
51
+ }
41
52
  }
42
53
 
43
54
  repositories {
55
+ maven {
56
+ // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
57
+ url("$rootDir/../node_modules/react-native/android")
58
+ }
59
+ google()
44
60
  mavenCentral()
45
61
  }
46
62
 
47
63
  dependencies {
48
-
49
- implementation 'com.facebook.react:react-native:+'
64
+ //noinspection GradleDynamicVersion
65
+ implementation "com.facebook.react:react-native:+" // From node_modules
50
66
  }
51
-
@@ -1,10 +1,11 @@
1
1
  /*
2
2
  * @Author: shiguo
3
- * @Date: 2022-05-05 13:57:25
3
+ * @Date: 2022-04-25 17:57:29
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2023-02-16 16:52:19
6
- * @FilePath: /@aks-dev/easyui/android/src/main/java/com/easyui/UpgradeModule.java
5
+ * @LastEditTime: 2022-10-24 16:08:50
6
+ * @FilePath: /@aks-dev/easyui/android/src/main/java/com/easyui/RNEasyuiModule.java
7
7
  */
8
+
8
9
  package com.easyui;
9
10
 
10
11
  import android.Manifest;
@@ -14,6 +15,15 @@ import android.app.ProgressDialog;
14
15
  import android.content.Context;
15
16
  import android.content.ContextWrapper;
16
17
  import android.content.Intent;
18
+
19
+ import androidx.core.app.ActivityCompat;
20
+ import androidx.core.content.FileProvider;
21
+
22
+ import com.facebook.react.bridge.Promise;
23
+ import com.facebook.react.bridge.ReactApplicationContext;
24
+ import com.facebook.react.bridge.ReactMethod;
25
+ import com.facebook.react.bridge.ReadableMap;
26
+
17
27
  import android.content.pm.PackageInfo;
18
28
  import android.content.pm.PackageManager;
19
29
  import android.graphics.Color;
@@ -26,7 +36,6 @@ import android.os.Handler;
26
36
  import android.os.Looper;
27
37
  import android.os.PowerManager;
28
38
  import android.util.DisplayMetrics;
29
- import android.view.Display;
30
39
  import android.view.View;
31
40
  import android.view.Window;
32
41
  import android.view.WindowManager;
@@ -34,18 +43,6 @@ import android.widget.Button;
34
43
  import android.widget.TextView;
35
44
  import android.widget.Toast;
36
45
 
37
- import androidx.annotation.NonNull;
38
- import androidx.core.app.ActivityCompat;
39
- import androidx.core.content.FileProvider;
40
-
41
- import com.facebook.react.bridge.Promise;
42
- import com.facebook.react.bridge.ReactApplicationContext;
43
- import com.facebook.react.bridge.ReactContextBaseJavaModule;
44
- import com.facebook.react.bridge.ReactMethod;
45
- import com.facebook.react.bridge.ReadableMap;
46
-
47
- import org.w3c.dom.Text;
48
-
49
46
  import java.io.File;
50
47
  import java.io.FileOutputStream;
51
48
  import java.io.IOException;
@@ -55,9 +52,9 @@ import java.net.HttpURLConnection;
55
52
  import java.net.URL;
56
53
  import java.util.HashMap;
57
54
 
58
- public class UpgradeModule extends ReactContextBaseJavaModule {
59
-
60
- private ReactApplicationContext context;
55
+ public class RNEasyuiModuleImpl {
56
+ public static final String NAME = "RNEasyui";
57
+ private final ReactApplicationContext context;
61
58
  public static final int EXTERNAL_STORAGE_REQ_CODE = 10 ;
62
59
  private static Handler mHandler = new Handler(Looper.getMainLooper());
63
60
  private ProgressDialog mProgressDialog;
@@ -67,21 +64,66 @@ public class UpgradeModule extends ReactContextBaseJavaModule {
67
64
  private static void runOnMainThread(Runnable runnable) {
68
65
  mHandler.postDelayed(runnable, 0);
69
66
  }
67
+ public RNEasyuiModuleImpl(ReactApplicationContext reactContext) {
68
+ context = reactContext;
69
+ }
70
70
 
71
- @NonNull
72
- @Override
73
71
  public String getName() {
74
- return "UpgradeModule";
72
+ return NAME;
75
73
  }
76
74
 
77
75
 
78
- public UpgradeModule(ReactApplicationContext reactContext) {
79
- super(reactContext);
80
- this.context = reactContext;
76
+ @ReactMethod
77
+ public void getDeviceBrand(Promise promise) {
78
+ promise.resolve( Build.BRAND+ Build.MODEL);
79
+ }
80
+
81
+ @Deprecated
82
+ @ReactMethod
83
+ public void getStatusBarHeight(final Promise promise) {
84
+
85
+ // int status_bar_height = context.getResources().getDimensionPixelSize(context.getResources().getIdentifier("status_bar_height", "dimen", "android"));
86
+ // promise.resolve(status_bar_height);
87
+ int result = 0;
88
+ int resId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
89
+ if (resId > 0) {
90
+ result = context.getResources().getDimensionPixelSize(resId);
91
+ }
92
+ promise.resolve(result);
93
+
94
+ }
95
+
96
+
97
+
81
98
 
99
+
100
+ @Deprecated
101
+ @ReactMethod
102
+ public void getNavigationBarHeight(final Promise promise) {
103
+
104
+ // int navigation_bar_height = context.getResources().getDimensionPixelSize(context.getResources().getIdentifier("navigation_bar_height", "dimen", "android"));
105
+ // promise.resolve(navigation_bar_height);
106
+
107
+ int resourceId = 0;
108
+ int rid = context.getResources().getIdentifier("config_showNavigationBar", "bool", "android");
109
+ if (rid != 0) {
110
+ resourceId = context.getResources().getIdentifier("navigation_bar_height", "dimen", "android");
111
+ int result = context.getResources().getDimensionPixelSize(resourceId);
112
+ promise.resolve(result);
113
+ } else {
114
+ promise.resolve(0);
115
+ }
82
116
  }
83
117
 
84
118
 
119
+ @ReactMethod
120
+ public void gotoDesktop() {
121
+ //启动一个意图,回到桌面
122
+ Intent desktop = new Intent(Intent.ACTION_MAIN);
123
+ desktop.addCategory(Intent.CATEGORY_HOME);
124
+ ActivityCompat.startActivity(context.getCurrentActivity(), desktop, null);
125
+ }
126
+
85
127
  private String getAppVersionName() {
86
128
  try {
87
129
  PackageManager manager = context.getPackageManager();
@@ -261,7 +303,7 @@ public class UpgradeModule extends ReactContextBaseJavaModule {
261
303
  //安装应用
262
304
  Intent intent = new Intent(Intent.ACTION_VIEW);
263
305
  //sg
264
- ContextWrapper cw = new ContextWrapper(getReactApplicationContext());
306
+ ContextWrapper cw = new ContextWrapper(context);
265
307
  File directory = cw.getExternalFilesDir(Environment.DIRECTORY_MUSIC);
266
308
  Activity currentActivity = context.getCurrentActivity();
267
309
  //判断是否是AndroidN以及更高的版本
@@ -317,7 +359,7 @@ public class UpgradeModule extends ReactContextBaseJavaModule {
317
359
 
318
360
  mDownloadFile = "app_" + String.valueOf(System.currentTimeMillis()) + ".apk";
319
361
  //sg
320
- ContextWrapper cw = new ContextWrapper(getReactApplicationContext());
362
+ ContextWrapper cw = new ContextWrapper(context);
321
363
  File directory = cw.getExternalFilesDir(Environment.DIRECTORY_MUSIC);
322
364
  file = new File(directory, mDownloadFile);
323
365
  //
@@ -394,4 +436,5 @@ public class UpgradeModule extends ReactContextBaseJavaModule {
394
436
  }
395
437
  }
396
438
  }
397
- }
439
+
440
+ }
@@ -8,31 +8,43 @@
8
8
 
9
9
  package com.easyui;
10
10
 
11
- import java.util.ArrayList;
12
- import java.util.Collections;
13
- import java.util.List;
11
+ import androidx.annotation.NonNull;
12
+ import androidx.annotation.Nullable;
14
13
 
15
- import com.facebook.react.ReactPackage;
14
+ import com.facebook.react.BaseReactPackage;
16
15
  import com.facebook.react.bridge.NativeModule;
17
16
  import com.facebook.react.bridge.ReactApplicationContext;
18
- import com.facebook.react.uimanager.ViewManager;
19
- import com.facebook.react.bridge.JavaScriptModule;
20
- public class RNEasyuiPackage implements ReactPackage {
21
- @Override
22
- public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
23
- List<NativeModule> modules = new ArrayList<>();
24
- modules.add(new RNEasyuiModule(reactContext));
25
- modules.add(new UpgradeModule(reactContext));
26
- return modules;
27
- }
17
+ import com.facebook.react.module.model.ReactModuleInfo;
18
+ import com.facebook.react.module.model.ReactModuleInfoProvider;
28
19
 
29
- // Deprecated from RN 0.47
30
- public List<Class<? extends JavaScriptModule>> createJSModules() {
31
- return Collections.emptyList();
20
+ import java.util.HashMap;
21
+ import java.util.Map;
22
+
23
+ public class RNEasyuiPackage extends BaseReactPackage {
24
+ @Nullable
25
+ @Override
26
+ public NativeModule getModule(@NonNull String s, @NonNull ReactApplicationContext reactApplicationContext) {
27
+ if (s.equals(RNEasyuiModuleImpl.NAME)) {
28
+ return new RNEasyuiModule(reactApplicationContext);
29
+ } else {
30
+ return null;
31
+ }
32
32
  }
33
33
 
34
+ @NonNull
34
35
  @Override
35
- public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
36
- return Collections.emptyList();
36
+ public ReactModuleInfoProvider getReactModuleInfoProvider() {
37
+ return ()->{
38
+ Map<String, ReactModuleInfo> map = new HashMap<>();
39
+ map.put(RNEasyuiModuleImpl.NAME, new ReactModuleInfo(
40
+ RNEasyuiModuleImpl.NAME, // name
41
+ RNEasyuiModuleImpl.NAME, // className
42
+ false, // canOverrideExistingModule
43
+ false, // needsEagerInit
44
+ false, // isCXXModule
45
+ true // isTurboModule
46
+ ));
47
+ return map;
48
+ };
37
49
  }
38
50
  }
@@ -0,0 +1,76 @@
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
+
12
+
13
+ import androidx.annotation.NonNull;
14
+
15
+ import com.facebook.react.bridge.Promise;
16
+ import com.facebook.react.bridge.ReactApplicationContext;
17
+ import com.facebook.react.bridge.ReadableMap;
18
+ import com.facebook.react.module.annotations.ReactModule;
19
+
20
+ @ReactModule(name = RNEasyuiModuleImpl.NAME)
21
+ public class RNEasyuiModule extends NativeRNEasyuiSpec{
22
+ final private RNEasyuiModuleImpl mRNEasyuiModuleImpl;
23
+
24
+ public RNEasyuiModule(ReactApplicationContext reactContext) {
25
+ super(reactContext);
26
+ mRNEasyuiModuleImpl = new RNEasyuiModuleImpl(reactContext);
27
+ }
28
+
29
+ @NonNull
30
+ @Override
31
+ public String getName() {
32
+ return RNEasyuiModuleImpl.NAME;
33
+ }
34
+
35
+
36
+ @Override
37
+ public void getDeviceBrand(Promise promise) {
38
+ mRNEasyuiModuleImpl.getDeviceBrand(promise);
39
+ }
40
+
41
+ @Deprecated
42
+ public void getStatusBarHeight(final Promise promise) {
43
+ mRNEasyuiModuleImpl.getStatusBarHeight(promise);
44
+ }
45
+
46
+
47
+
48
+
49
+
50
+ @Deprecated
51
+ public void getNavigationBarHeight(final Promise promise) {
52
+ mRNEasyuiModuleImpl.getNavigationBarHeight(promise);
53
+ }
54
+
55
+
56
+ @Override
57
+ public void gotoDesktop() {
58
+ mRNEasyuiModuleImpl.gotoDesktop();
59
+ }
60
+
61
+
62
+ @Override
63
+ public void getAppVersion(final Promise promise) {
64
+ mRNEasyuiModuleImpl.getAppVersion(promise);
65
+ }
66
+
67
+ @Override
68
+ public void getOSVersion(Promise promise) {
69
+ mRNEasyuiModuleImpl.getOSVersion(promise);
70
+ }
71
+
72
+ @Override
73
+ public void upgrade(final ReadableMap info, final Promise promise) {
74
+ mRNEasyuiModuleImpl.upgrade(info, promise);
75
+ }
76
+ }
@@ -0,0 +1,79 @@
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
+
12
+
13
+ import androidx.annotation.NonNull;
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 com.facebook.react.bridge.ReadableMap;
20
+ import com.facebook.react.module.annotations.ReactModule;
21
+
22
+ @ReactModule(name = RNEasyuiModuleImpl.NAME)
23
+ public class RNEasyuiModule extends ReactContextBaseJavaModule {
24
+ final private RNEasyuiModuleImpl mRNEasyuiModuleImpl;
25
+
26
+ public RNEasyuiModule(ReactApplicationContext reactContext) {
27
+ super(reactContext);
28
+ mRNEasyuiModuleImpl = new RNEasyuiModuleImpl(reactContext);
29
+ }
30
+
31
+ @NonNull
32
+ @Override
33
+ public String getName() {
34
+ return RNEasyuiModuleImpl.NAME;
35
+ }
36
+
37
+
38
+ @ReactMethod
39
+ public void getDeviceBrand(Promise promise) {
40
+ mRNEasyuiModuleImpl.getDeviceBrand(promise);
41
+ }
42
+
43
+ @Deprecated
44
+ @ReactMethod
45
+ public void getStatusBarHeight(final Promise promise) {
46
+ mRNEasyuiModuleImpl.getStatusBarHeight(promise);
47
+ }
48
+
49
+
50
+
51
+
52
+ @Deprecated
53
+ @ReactMethod
54
+ public void getNavigationBarHeight(final Promise promise) {
55
+ mRNEasyuiModuleImpl.getNavigationBarHeight(promise);
56
+ }
57
+
58
+
59
+ @ReactMethod
60
+ public void gotoDesktop() {
61
+ mRNEasyuiModuleImpl.gotoDesktop();
62
+ }
63
+
64
+
65
+ @ReactMethod
66
+ public void getAppVersion(final Promise promise) {
67
+ mRNEasyuiModuleImpl.getAppVersion(promise);
68
+ }
69
+
70
+ @ReactMethod
71
+ public void getOSVersion(Promise promise) {
72
+ mRNEasyuiModuleImpl.getOSVersion(promise);
73
+ }
74
+
75
+ @ReactMethod
76
+ public void upgrade(final ReadableMap info, final Promise promise) {
77
+ mRNEasyuiModuleImpl.upgrade(info, promise);
78
+ }
79
+ }
@@ -16,12 +16,11 @@ export type AnimationModalProps = {
16
16
  backgroundColor?: ColorValue | undefined;
17
17
  };
18
18
  };
19
- type RefAttributes = {
20
- show: () => RefAttributes;
21
- hide: () => RefAttributes;
22
- setData: (data?: any) => RefAttributes;
19
+ export type AnimationModalRefAttributes = {
20
+ show: () => AnimationModalRefAttributes;
21
+ hide: () => AnimationModalRefAttributes;
22
+ setData: (data?: any) => AnimationModalRefAttributes;
23
23
  getData: () => any;
24
24
  };
25
- export declare const AnimationModal: React.ForwardRefExoticComponent<React.PropsWithoutRef<AnimationModalProps> & React.RefAttributes<RefAttributes>>;
26
- export {};
25
+ export declare const AnimationModal: React.ForwardRefExoticComponent<React.PropsWithoutRef<AnimationModalProps> & React.RefAttributes<AnimationModalRefAttributes>>;
27
26
  //# sourceMappingURL=AnimationModal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AnimationModal.d.ts","sourceRoot":"","sources":["../../../src/components/AnimationModal/AnimationModal.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAUL,UAAU,EACX,MAAM,cAAc,CAAC;AAItB,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,GAAG,WAAW,CAAC;IAC5C;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,KAAK,CAAC,EAAE;QACN,eAAe,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;KAC1C,CAAC;CACH,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,MAAM,aAAa,CAAC;IAC1B,IAAI,EAAE,MAAM,aAAa,CAAC;IAC1B,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,aAAa,CAAC;IACvC,OAAO,EAAE,MAAM,GAAG,CAAC;CACpB,CAAC;AAMF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,yBAAyB,CAC1D,KAAK,CAAC,eAAe,CAAC,mBAAmB,CAAC,GACxC,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,CAkIpC,CAAC"}
1
+ {"version":3,"file":"AnimationModal.d.ts","sourceRoot":"","sources":["../../../src/components/AnimationModal/AnimationModal.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAUL,UAAU,EACX,MAAM,cAAc,CAAC;AAItB,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAA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I,CAAC;CACrB,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IACrD,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;;AAKF,wBAsGG;AAEH,eAAO,MAAM,kBAAkB,uCAAmC,CAAC;AAEnE,eAAO,MAAM,oBAAoB,GAAI,OAAO,OAAO,CAAC,kBAAkB,CAAC,SAEtE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
- import { View, Text, StyleSheet, Platform, StatusBar, TouchableOpacity, Dimensions, } from "react-native";
3
- import Modal from "react-native-modal";
2
+ import { View, Text, StyleSheet, Platform, StatusBar, TouchableOpacity, } from "react-native";
3
+ import { AnimationModal, } from "../../AnimationModal/AnimationModal";
4
4
  import { px2dp, deviceWidth } from "../../../screen/px2dp";
5
5
  import { px2sp } from "../../../screen/px2sp";
6
6
  export default React.forwardRef((_, ref) => {
@@ -12,9 +12,11 @@ export default React.forwardRef((_, ref) => {
12
12
  const [state, setState] = React.useState(defaultState);
13
13
  const cancelCallbackRef = React.useRef(undefined);
14
14
  const confirmCallbackRef = React.useRef(undefined);
15
+ const animationModalRef = React.useRef(null);
15
16
  React.useImperativeHandle(ref, () => ({
16
17
  show: async (options) => {
17
18
  setState(Object.assign({}, defaultState, { visible: true }, options));
19
+ animationModalRef.current?.show();
18
20
  cancelCallbackRef.current = options.cancel;
19
21
  confirmCallbackRef.current = options.confirm;
20
22
  },
@@ -22,6 +24,7 @@ export default React.forwardRef((_, ref) => {
22
24
  }), []);
23
25
  const hide = async () => {
24
26
  setState(defaultState);
27
+ animationModalRef.current?.hide();
25
28
  };
26
29
  React.useEffect(() => {
27
30
  if (Platform.OS == "android") {
@@ -35,15 +38,7 @@ export default React.forwardRef((_, ref) => {
35
38
  }
36
39
  }
37
40
  }, [state.visible]);
38
- return (<Modal hideModalContentWhileAnimating={true} //通过隐藏模态内容直到动画完成来增强性能
39
- useNativeDriver={true} //定义动画是否应使用本机驱动程序
40
- animationIn="slideInUp" animationOut="slideOutDown" onBackButtonPress={() => {
41
- //按下Android后退按钮时调用
42
- hide();
43
- }} onBackdropPress={() => {
44
- //按下背景时调用
45
- hide();
46
- }} isVisible={state.visible} style={{ margin: 0 }} deviceHeight={Dimensions.get("screen").height}>
41
+ return (<AnimationModal ref={animationModalRef}>
47
42
  <View style={styles.container}>
48
43
  <View style={[styles.wrapper, state.wrapperStyle]}>
49
44
  {state.title && <Text style={styles.titleText}>{state.title}</Text>}
@@ -87,7 +82,7 @@ export default React.forwardRef((_, ref) => {
87
82
  </View>)}
88
83
  </View>
89
84
  </View>
90
- </Modal>);
85
+ </AnimationModal>);
91
86
  });
92
87
  export const alertBottomViewRef = React.createRef();
93
88
  export const showAlertBottomModal = (props) => {