ソースを参照

PDFTool(Android) - bug修复,新增俄语测试字体

liuxiaolong 2 ヶ月 前
コミット
1843983115

BIN
ComPDFKit_Repo/compdfkit/ComPDFKit.aar


+ 2 - 2
ComPDFKit_Tools/build.gradle

@@ -55,8 +55,8 @@ dependencies {
     api project(path:':ComPDFKit_Repo:compdfkit')
     api project(path:':ComPDFKit_Repo:compdfkit-ui')
     // or use
-//    api ('com.compdf:compdfkit:2.2.0')
-//    api ('com.compdf:compdfkit-ui:2.2.0')
+//    api ('com.compdf:compdfkit:2.2.1-SNAPSHOT')
+//    api ('com.compdf:compdfkit-ui:2.2.1-SNAPSHOT')
     api 'com.github.bumptech.glide:glide:4.15.1'
     annotationProcessor 'com.github.bumptech.glide:compiler:4.15.1'
     api 'androidx.documentfile:documentfile:1.0.1'

+ 36 - 0
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/utils/CFileUtils.java

@@ -604,4 +604,40 @@ public class CFileUtils {
         }
     }
 
+    public static void copyAssetsDirToPhone(Activity activity, String assetsPath, String outPutParentDir){
+        try {
+            String[] fileList = activity.getAssets().list(assetsPath);
+            if(fileList.length>0) {//如果是目录
+                File file=new File(outPutParentDir+ File.separator+assetsPath);
+                file.mkdirs();//如果文件夹不存在,则递归
+                for (String fileName:fileList){
+                    assetsPath=assetsPath+File.separator+fileName;
+
+                    copyAssetsDirToPhone(activity,assetsPath, outPutParentDir);
+
+                    assetsPath=assetsPath.substring(0,assetsPath.lastIndexOf(File.separator));
+                    Log.e("oldPath",assetsPath);
+                }
+            } else {//如果是文件
+                InputStream inputStream=activity.getAssets().open(assetsPath);
+                File file=new File(outPutParentDir+ File.separator+assetsPath);
+                Log.i("copyAssets2Phone","file:"+file);
+                if(!file.exists() || file.length()==0) {
+                    FileOutputStream fos=new FileOutputStream(file);
+                    int len=-1;
+                    byte[] buffer=new byte[1024];
+                    while ((len=inputStream.read(buffer))!=-1){
+                        fos.write(buffer,0,len);
+                    }
+                    fos.flush();
+                    inputStream.close();
+                    fos.close();
+                } else {
+                }
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
 }

+ 1 - 3
ComPDFKit_Tools/src/main/res/layout/tools_properties_shape_style_fragment.xml

@@ -130,8 +130,6 @@
             </androidx.constraintlayout.widget.ConstraintLayout>
 
 
-
-
         </androidx.constraintlayout.widget.ConstraintLayout>
 
 
@@ -145,7 +143,7 @@
             app:layout_goneMarginBottom="8dp"
             app:tools_value_unit="pt"
             app:tools_slider_bar_value_show_type="source"
-            android:title="@string/tools_dashed_setting" />
+            android:title="@string/tools_dashed_spacing" />
 
 
         <androidx.constraintlayout.widget.ConstraintLayout

+ 1 - 0
ComPDFKit_Tools/src/main/res/values-zh-rCN/tools_strings.xml

@@ -117,6 +117,7 @@
     <string name="tools_fill_color">填充颜色</string>
     <string name="tools_text_color">文字颜色</string>
     <string name="tools_dashed_setting">线型</string>
+    <string name="tools_dashed_spacing">虚线</string>
     <string name="tools_annot_start_line_style">线头</string>
     <string name="tools_annot_tail_line_style">线尾</string>
 

+ 2 - 0
ComPDFKit_Tools/src/main/res/values/tools_strings.xml

@@ -117,6 +117,8 @@
     <string name="tools_fill_color">Fill Color</string>
     <string name="tools_text_color">Font Color</string>
     <string name="tools_dashed_setting">Line and Border Style</string>
+    <string name="tools_dashed_spacing">Dash Spacing</string>
+
     <string name="tools_annot_start_line_style">Start</string>
     <string name="tools_annot_tail_line_style">End</string>
 

ファイルの差分が大きいため隠しています
+ 11 - 4
PDFViewer/src/main/AndroidManifest.xml


BIN
PDFViewer/src/main/assets/1 page (3).pdf


BIN
PDFViewer/src/main/assets/test_3.pdf


ファイルの差分が大きいため隠しています
+ 7 - 8
PDFViewer/src/main/java/com/compdfkit/pdfviewer/home/HomeActivity.java