Browse Source

PDFTool(Android) - 移除CAnnotStyle 无效方法

liuxiaolong 7 months ago
parent
commit
7a0820d7dd

+ 0 - 1
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/pdf/CPDFConfigurationUtils.java

@@ -18,7 +18,6 @@ import androidx.annotation.Nullable;
 import com.compdfkit.core.annotation.CPDFTextAttribute;
 import com.compdfkit.core.annotation.form.CPDFWidget;
 import com.compdfkit.core.edit.CPDFEditTextArea;
-import com.compdfkit.core.font.CPDFFont;
 import com.compdfkit.tools.common.pdf.config.AnnotationsConfig;
 import com.compdfkit.tools.common.pdf.config.CPDFConfiguration;
 import com.compdfkit.tools.common.pdf.config.ContentEditorConfig;

+ 0 - 1
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/pdf/CPDFDocumentFragment.java

@@ -31,7 +31,6 @@ import android.widget.FrameLayout;
 
 import androidx.activity.OnBackPressedCallback;
 import androidx.activity.result.ActivityResultLauncher;
-import androidx.activity.result.contract.ActivityResultContracts;
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.constraintlayout.widget.ConstraintLayout;

+ 0 - 1
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/pdf/config/annot/AnnotFreetextAttr.java

@@ -14,7 +14,6 @@ import android.graphics.Color;
 
 import androidx.annotation.IntRange;
 
-import com.compdfkit.core.annotation.CPDFTextAttribute;
 import com.compdfkit.tools.common.views.pdfproperties.pdfstyle.CAnnotStyle;
 
 public class AnnotFreetextAttr extends AnnotAttr {

+ 0 - 2
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/pdf/config/forms/FormsListBoxAttr.java

@@ -13,8 +13,6 @@ import android.graphics.Color;
 
 import androidx.annotation.FloatRange;
 
-import com.compdfkit.core.annotation.CPDFTextAttribute;
-
 public class FormsListBoxAttr extends FormsAttr {
 
     private String fontColor;

+ 0 - 1
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/pdf/config/forms/FormsTextFieldAttr.java

@@ -14,7 +14,6 @@ import android.graphics.Color;
 
 import androidx.annotation.FloatRange;
 
-import com.compdfkit.core.annotation.CPDFTextAttribute;
 import com.compdfkit.tools.common.pdf.config.annot.AnnotFreetextAttr;
 import com.compdfkit.tools.common.views.pdfproperties.pdfstyle.CAnnotStyle;
 

+ 0 - 6
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/views/pdfproperties/basic/CBasicPropertiesFragment.java

@@ -19,7 +19,6 @@ import androidx.lifecycle.ViewModelProvider;
 import com.compdfkit.core.annotation.CPDFBorderStyle;
 import com.compdfkit.core.annotation.CPDFLineAnnotation;
 import com.compdfkit.core.annotation.CPDFStampAnnotation;
-import com.compdfkit.core.annotation.CPDFTextAttribute;
 import com.compdfkit.core.annotation.form.CPDFWidget;
 import com.compdfkit.tools.common.views.pdfproperties.pdfstyle.CAnnotStyle;
 import com.compdfkit.tools.common.views.pdfproperties.pdfstyle.CPropertiesFragmentBean;
@@ -148,11 +147,6 @@ public abstract class CBasicPropertiesFragment extends Fragment implements CAnno
 
     }
 
-    @Override
-    public void onChangeFontType(CPDFTextAttribute.FontNameHelper.FontType fontType) {
-
-    }
-
     @Override
     public void onChangeTextAlignment(CAnnotStyle.Alignment alignment) {
 

+ 0 - 27
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/views/pdfproperties/pdfstyle/CAnnotStyle.java

@@ -23,7 +23,6 @@ import androidx.annotation.Nullable;
 import com.compdfkit.core.annotation.CPDFBorderStyle;
 import com.compdfkit.core.annotation.CPDFLineAnnotation;
 import com.compdfkit.core.annotation.CPDFStampAnnotation;
-import com.compdfkit.core.annotation.CPDFTextAttribute;
 import com.compdfkit.core.annotation.form.CPDFWidget;
 import com.compdfkit.tools.R;
 import com.compdfkit.tools.common.utils.CLog;
@@ -71,8 +70,6 @@ public class CAnnotStyle implements Serializable {
     private int textColorOpacity = 255;
 
     private int fontSize;
-
-    private CPDFTextAttribute.FontNameHelper.FontType fontType = CPDFTextAttribute.FontNameHelper.FontType.Helvetica;
     private String externFontName = "";
     private Alignment alignment = Alignment.UNKNOWN;
 
@@ -302,29 +299,17 @@ public class CAnnotStyle implements Serializable {
         updateFontSize(fontSize, update);
     }
 
-    public CPDFTextAttribute.FontNameHelper.FontType getFontType() {
-        return fontType;
-    }
 
     public String getExternFontName() {
         return externFontName;
     }
 
-    public void setFontType(CPDFTextAttribute.FontNameHelper.FontType fontType) {
-        boolean update = fontType != this.fontType;
-        this.fontType = fontType;
-        externFontName = "";
-        CLog.e("CAnnotStyle", "setFontType(" + fontType + ", update:" + update + ")");
-        updateFontType(fontType, update);
-    }
-
     public void setExternFontName(String name) {
         boolean update = !externFontName.equals(name);
         externFontName = name;
         if (TextUtils.isEmpty(externFontName)) {
             externFontName = "";
         } else {
-            this.fontType = CPDFTextAttribute.FontNameHelper.FontType.Unknown;
             updateExternFontType(externFontName, update);
         }
     }
@@ -507,7 +492,6 @@ public class CAnnotStyle implements Serializable {
                 "textColor" + textColor + "," +
                 "textColorOpacity" + textColorOpacity + "," +
                 "fontSize" + fontSize + "," +
-                "fontType" + (fontType != null ? fontType.name() : "empty") + "," +
                 "imagePath" + imagePath + "," +
                 "imageUri" + (imageUri != null ? imageUri.toString() : "empty")+ "," +
                 "standardStamp" + (standardStamp != null ? standardStamp.name() : "empty") + "," +
@@ -537,7 +521,6 @@ public class CAnnotStyle implements Serializable {
         result = 31 * result + this.textColor;
         result = 31 * result + (this.textColorOpacity != 0.0F ? Float.floatToIntBits(this.textColorOpacity) : 0);
         result = 31 * result + (this.fontSize != 0.0F ? Float.floatToIntBits(this.fontSize) : 0);
-        result = 31 * result + (this.fontType != null ? this.fontType.hashCode() : 0);
         result = 31 * result + (this.imagePath != null ? this.imagePath.hashCode() : 0);
         result = 31 * result + (this.imageUri != null ? this.imageUri.hashCode() : 0);
         result = 31 * result + (this.type != null ? type.hashCode() : 0);
@@ -772,14 +755,6 @@ public class CAnnotStyle implements Serializable {
         }
     }
 
-    private void updateFontType(CPDFTextAttribute.FontNameHelper.FontType fontType, boolean update) {
-        if (styleChangeListenerList != null && update) {
-            for (OnAnnotStyleChangeListener onAnnotStyleChangeListener : styleChangeListenerList) {
-                onAnnotStyleChangeListener.onChangeFontType(fontType);
-            }
-        }
-    }
-
     private void updateExternFontType(String fontName, boolean update) {
         if (styleChangeListenerList != null && update) {
             for (OnAnnotStyleChangeListener onAnnotStyleChangeListener : styleChangeListenerList) {
@@ -953,8 +928,6 @@ public class CAnnotStyle implements Serializable {
 
         void onChangeFontSize(int fontSize);
 
-        void onChangeFontType(CPDFTextAttribute.FontNameHelper.FontType fontType);
-
         void onChangeTextAlignment(CAnnotStyle.Alignment alignment);
 
         void onChangeImagePath(String imagePath, Uri imageUri);

+ 0 - 6
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/views/pdfproperties/pdfstyle/CBasicOnStyleChangeListener.java

@@ -15,7 +15,6 @@ import android.net.Uri;
 import com.compdfkit.core.annotation.CPDFBorderStyle;
 import com.compdfkit.core.annotation.CPDFLineAnnotation;
 import com.compdfkit.core.annotation.CPDFStampAnnotation;
-import com.compdfkit.core.annotation.CPDFTextAttribute;
 import com.compdfkit.core.annotation.form.CPDFWidget;
 
 import java.util.Map;
@@ -97,11 +96,6 @@ public class CBasicOnStyleChangeListener  implements CAnnotStyle.OnAnnotStyleCha
 
     }
 
-    @Override
-    public void onChangeFontType(CPDFTextAttribute.FontNameHelper.FontType fontType) {
-
-    }
-
     @Override
     public void onChangeTextAlignment(CAnnotStyle.Alignment alignment) {
 

+ 0 - 6
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/views/pdfproperties/pdfstyle/manager/CStyleManager.java

@@ -19,7 +19,6 @@ import com.compdfkit.core.annotation.CPDFAnnotation;
 import com.compdfkit.core.annotation.CPDFBorderStyle;
 import com.compdfkit.core.annotation.CPDFLineAnnotation;
 import com.compdfkit.core.annotation.CPDFStampAnnotation;
-import com.compdfkit.core.annotation.CPDFTextAttribute;
 import com.compdfkit.core.annotation.form.CPDFWidget;
 import com.compdfkit.tools.common.views.pdfproperties.pdfstyle.CAnnotStyle;
 import com.compdfkit.tools.common.views.pdfproperties.pdfstyle.CStyleDialogFragment;
@@ -177,11 +176,6 @@ public class CStyleManager implements CAnnotStyle.OnAnnotStyleChangeListener {
         updateAnnot();
     }
 
-    @Override
-    public void onChangeFontType(CPDFTextAttribute.FontNameHelper.FontType fontType) {
-        updateAnnot();
-    }
-
     @Override
     public void onChangeTextAlignment(CAnnotStyle.Alignment alignment) {
         updateAnnot();

+ 0 - 26
DigitalSignature/src/androidTest/java/com/compdfkit/digitalsignature/ExampleInstrumentedTest.java

@@ -1,26 +0,0 @@
-package com.compdfkit.digitalsignature;
-
-import static org.junit.Assert.*;
-
-import android.content.Context;
-
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.platform.app.InstrumentationRegistry;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-/**
- * Instrumented test, which will execute on an Android device.
- *
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
- */
-@RunWith(AndroidJUnit4.class)
-public class ExampleInstrumentedTest {
-    @Test
-    public void useAppContext() {
-        // Context of the app under test.
-        Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
-        assertEquals("com.compdfkit.digitalsignature", appContext.getPackageName());
-    }
-}

+ 0 - 5
PDFViewer/src/main/java/com/compdfkit/pdfviewer/home/HomeFunFragment.java

@@ -19,18 +19,13 @@ import androidx.annotation.Nullable;
 import androidx.fragment.app.Fragment;
 import androidx.recyclerview.widget.LinearLayoutManager;
 
-import com.compdfkit.core.font.CPDFFont;
-import com.compdfkit.core.font.CPDFFontName;
 import com.compdfkit.pdfviewer.R;
 import com.compdfkit.pdfviewer.databinding.FragmentHomeBinding;
 import com.compdfkit.pdfviewer.home.datas.FunDatas;
 import com.compdfkit.tools.common.pdf.CPDFDocumentActivity;
-import com.compdfkit.tools.common.utils.CLog;
 import com.compdfkit.tools.common.views.pdfview.CPreviewMode;
 import com.compdfkit.ui.utils.CPDFCommomUtils;
 
-import java.util.List;
-
 
 public class HomeFunFragment extends Fragment {