Преглед изворни кода

compdfkit(rn) - 修复android p0, 修复ios导入文档界面崩溃

liuxiaolong пре 19 часа
родитељ
комит
28fc9f81ae

+ 2 - 1
android/build.gradle

@@ -2,7 +2,6 @@ buildscript {
   repositories {
     google()
     mavenCentral()
-    mavenLocal()
     maven {
       url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
     }
@@ -96,4 +95,6 @@ dependencies {
   api 'com.google.android.material:material:1.8.0'
   api 'androidx.constraintlayout:constraintlayout:2.1.4'
 }
+configurations.all { resolutionStrategy.cacheChangingModulesFor 0, 'seconds' }
+
 

+ 2 - 2
example/src/screens/CPDFImportDocumentScreen.tsx

@@ -72,9 +72,9 @@ export const CPDFImportDocumentScreen: React.FC<CPDFImportDocumentScreenProps> =
                             }}>
                                 <Text style={styles.titleLarge}>Import Document</Text>
                                 <TouchableWithoutFeedback
-                                    disabled={document === null}
+                                    disabled={document === undefined || document === null}
                                     onPress={async () => {
-
+                                        
                                         var pages: number[] = [];
                                         if (!importAllPages) {
                                             if (text === '') {

+ 6 - 1
example/src/screens/HomeScreen.tsx

@@ -15,6 +15,7 @@ import {
   StyleSheet,
   TouchableOpacity,
   View,
+  Platform,
 } from 'react-native';
 
 import {examples} from "../examples";
@@ -65,7 +66,11 @@ class HomeScreen extends Component<Props> {
       return (
         <TouchableOpacity
           style={styles.funItem} onPress={() => {
-            if (this.state.isFocused) {
+            if(Platform.OS == 'android'){
+              if (this.state.isFocused) {
+                item.action(this);
+              }
+            }else{
               item.action(this);
             }
           }}>