ソースを参照

PDFTool(Android) - 内容编辑图片属性弹窗可以预览选中的图片,云朵边框接入

liuxiaolong 1 ヶ月 前
コミット
ddf76bf707
29 ファイル変更470 行追加121 行削除
  1. BIN
      ComPDFKit_Repo/compdfkit-ui/ComPDFKit-UI.aar
  2. BIN
      ComPDFKit_Repo/compdfkit/ComPDFKit.aar
  3. 4 2
      ComPDFKit_Tools/src/main/assets/tools_default_configuration.json
  4. 11 9
      ComPDFKit_Tools/src/main/java/com/compdfkit/tools/annotation/pdfproperties/pdfshape/CShapeStyleFragment.java
  5. 24 27
      ComPDFKit_Tools/src/main/java/com/compdfkit/tools/annotation/pdfproperties/pdfshape/adapter/CShapeStyleSpinnerAdapter.java
  6. 15 12
      ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/pdf/CPDFApplyConfigUtil.java
  7. 7 0
      ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/pdf/CPDFConfigurationUtils.java
  8. 7 6
      ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/pdf/CPDFDocumentFragment.java
  9. 12 0
      ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/pdf/config/annot/AnnotShapeAttr.java
  10. 41 0
      ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/utils/glide/transformation/RotateTransformation.java
  11. 16 0
      ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/views/pdfproperties/basic/CBasicPropertiesFragment.java
  12. 87 3
      ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/views/pdfproperties/pdfstyle/CAnnotStyle.java
  13. 16 0
      ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/views/pdfproperties/pdfstyle/CBasicOnStyleChangeListener.java
  14. 16 0
      ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/views/pdfproperties/pdfstyle/manager/CStyleManager.java
  15. 75 39
      ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/views/pdfproperties/pdfstyle/manager/provider/CEditSelectionsProvider.java
  16. 7 0
      ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/views/pdfproperties/pdfstyle/manager/provider/CGlobalStyleProvider.java
  17. 19 5
      ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/views/pdfproperties/pdfstyle/manager/provider/CSelectedAnnotStyleProvider.java
  18. 3 0
      ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/views/pdfproperties/preview/CBasicAnnotPreviewView.java
  19. 40 11
      ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/views/pdfproperties/preview/CEditImagePreviewView.java
  20. 10 2
      ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/views/pdfproperties/preview/CStylePreviewView.java
  21. 1 0
      ComPDFKit_Tools/src/main/java/com/compdfkit/tools/contenteditor/pdfproperties/CEditImagePropertiesFragment.java
  22. 12 3
      ComPDFKit_Tools/src/main/java/com/compdfkit/tools/contenteditor/pdfproperties/CEditTextProperFragment.java
  23. 0 0
      ComPDFKit_Tools/src/main/res/drawable/tools_bord_effect_type_cloudy.xml
  24. 0 0
      ComPDFKit_Tools/src/main/res/drawable/tools_bord_effect_type_solid.xml
  25. 10 0
      ComPDFKit_Tools/src/main/res/drawable/tools_edit_text_style_remove_strike_line.xml
  26. 10 0
      ComPDFKit_Tools/src/main/res/drawable/tools_edit_text_style_remove_underline.xml
  27. 25 0
      ComPDFKit_Tools/src/main/res/layout/tools_edit_text_property_fragment.xml
  28. 1 1
      ComPDFKit_Tools/src/main/res/layout/tools_properties_shape_style_fragment.xml
  29. 1 1
      ComPDFKit_Tools/src/main/res/layout/tools_spinner_list_image_item.xml

BIN
ComPDFKit_Repo/compdfkit-ui/ComPDFKit-UI.aar


BIN
ComPDFKit_Repo/compdfkit/ComPDFKit.aar


+ 4 - 2
ComPDFKit_Tools/src/main/assets/tools_default_configuration.json

@@ -98,7 +98,8 @@
         "borderStyle": {
           "style": "solid",
           "dashGap": 0.0
-        }
+        },
+        "bordEffectType":"solid"
       },
       "circle": {
         "fillColor": "#1460F3",
@@ -108,7 +109,8 @@
         "borderStyle": {
           "style": "solid",
           "dashGap": 0.0
-        }
+        },
+        "bordEffectType":"solid"
       },
       "line": {
         "borderColor": "#1460F3",

+ 11 - 9
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/annotation/pdfproperties/pdfshape/CShapeStyleFragment.java

@@ -16,18 +16,17 @@ import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.AdapterView;
-import android.widget.Spinner;
 
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.appcompat.widget.AppCompatSpinner;
 import androidx.constraintlayout.widget.ConstraintLayout;
 
+import com.compdfkit.core.annotation.CPDFAnnotation;
 import com.compdfkit.core.annotation.CPDFBorderStyle;
 import com.compdfkit.core.annotation.CPDFLineAnnotation;
 import com.compdfkit.tools.R;
-import com.compdfkit.tools.annotation.pdfproperties.pdfshape.adapter.CShapeStyleSpinnerAdapter;
-import com.compdfkit.tools.common.utils.CToastUtil;
+import com.compdfkit.tools.annotation.pdfproperties.pdfshape.adapter.CShapeBordEffectTypeAdapter;
 import com.compdfkit.tools.common.utils.view.colorpicker.CColorPickerFragment;
 import com.compdfkit.tools.common.utils.view.sliderbar.CSliderBar;
 import com.compdfkit.tools.common.views.pdfproperties.basic.CBasicPropertiesFragment;
@@ -64,7 +63,7 @@ public class CShapeStyleFragment extends CBasicPropertiesFragment {
 
     private AppCompatSpinner shapeStyleSpinner;
 
-    private CShapeStyleSpinnerAdapter shapeStyleSpinnerAdapter;
+    private CShapeBordEffectTypeAdapter bordEffectTypeAdapter;
 
     public static CShapeStyleFragment newInstance() {
         return new CShapeStyleFragment();
@@ -85,7 +84,7 @@ public class CShapeStyleFragment extends CBasicPropertiesFragment {
         startLinePreview = rootView.findViewById(R.id.preview_start_line);
         tailLinePreview = rootView.findViewById(R.id.preview_tail_line);
         clShapeStyle = rootView.findViewById(R.id.cl_shape_style);
-        shapeStyleSpinner = rootView.findViewById(R.id.spinner_shape_style);
+        shapeStyleSpinner = rootView.findViewById(R.id.spinner_bord_effect_type);
         return rootView;
     }
 
@@ -184,13 +183,16 @@ public class CShapeStyleFragment extends CBasicPropertiesFragment {
             });
         });
 
-        shapeStyleSpinnerAdapter = new CShapeStyleSpinnerAdapter(getContext());
-        shapeStyleSpinner.setAdapter(shapeStyleSpinnerAdapter);
+
+        bordEffectTypeAdapter = new CShapeBordEffectTypeAdapter(getContext());
+        bordEffectTypeAdapter.setBordEffectType(cAnnotStyle.getBordEffectType());
+        shapeStyleSpinner.setAdapter(bordEffectTypeAdapter);
+        shapeStyleSpinner.setSelection(bordEffectTypeAdapter.getSelectPosition());
         shapeStyleSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
             @Override
             public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
-                CShapeStyleSpinnerAdapter.ShapeStyle shapeStyle = shapeStyleSpinnerAdapter.list.get(position);
-                CToastUtil.showLongToast(getContext(), shapeStyle == CShapeStyleSpinnerAdapter.ShapeStyle.Straight_Line ? "直线" : "曲线");
+                CPDFAnnotation.CPDFBorderEffectType bordEffectType = bordEffectTypeAdapter.list.get(position);
+                viewModel.getStyle().setBordEffectType(bordEffectType);
             }
 
             @Override

+ 24 - 27
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/annotation/pdfproperties/pdfshape/adapter/CShapeStyleSpinnerAdapter.java

@@ -18,40 +18,36 @@ import android.widget.BaseAdapter;
 import androidx.annotation.NonNull;
 import androidx.appcompat.widget.AppCompatImageView;
 
+import com.compdfkit.core.annotation.CPDFAnnotation;
 import com.compdfkit.tools.R;
 
 import java.util.Arrays;
 import java.util.List;
 
 
-public class CShapeStyleSpinnerAdapter extends BaseAdapter {
+public class CShapeBordEffectTypeAdapter extends BaseAdapter {
 
-    public enum ShapeStyle{
-        Straight_Line,
 
-        Squiggly_Line
-    }
-
-    public List<ShapeStyle> list;
+    public List<CPDFAnnotation.CPDFBorderEffectType> list;
 
     private Context mContext;
 
-    private ShapeStyle selectStyleType;
+    private CPDFAnnotation.CPDFBorderEffectType selectBordEffectType;
 
-    public CShapeStyleSpinnerAdapter(@NonNull Context context) {
-        this.list = Arrays.asList(ShapeStyle.Straight_Line, ShapeStyle.Squiggly_Line);
+    public CShapeBordEffectTypeAdapter(@NonNull Context context) {
+        this.list = Arrays.asList(CPDFAnnotation.CPDFBorderEffectType.CPDFBorderEffectTypeSolid, CPDFAnnotation.CPDFBorderEffectType.CPDFBorderEffectTypeCloudy);
         mContext = context;
     }
 
-    public void setSelectStyleType(ShapeStyle selectStyleType) {
-        this.selectStyleType = selectStyleType;
+    public void setBordEffectType(CPDFAnnotation.CPDFBorderEffectType bordEffectType) {
+        this.selectBordEffectType = bordEffectType;
     }
 
     public int getSelectPosition(){
-        if (selectStyleType != null){
+        if (selectBordEffectType != null){
             for (int i = 0; i < list.size(); i++) {
-                ShapeStyle item = list.get(i);
-                if (selectStyleType.equals(item)) {
+                CPDFAnnotation.CPDFBorderEffectType item = list.get(i);
+                if (selectBordEffectType.equals(item)) {
                     return i;
                 }
             }
@@ -59,11 +55,11 @@ public class CShapeStyleSpinnerAdapter extends BaseAdapter {
         return 0;
     }
 
-    public ShapeStyle getSelectShapeType(){
-        if (selectStyleType != null){
-            return selectStyleType;
+    public CPDFAnnotation.CPDFBorderEffectType getSelectBordEffectType(){
+        if (selectBordEffectType != null){
+            return selectBordEffectType;
         }
-        return ShapeStyle.Straight_Line;
+        return CPDFAnnotation.CPDFBorderEffectType.CPDFBorderEffectTypeSolid;
     }
 
     @Override
@@ -83,23 +79,24 @@ public class CShapeStyleSpinnerAdapter extends BaseAdapter {
 
     @Override
     public View getView(int position, View convertView, ViewGroup parent) {
-        CShapeStyleViewHolder holder;
+        CEffectTypeViewHolder holder;
 
         if (convertView == null){
             LayoutInflater inflater = LayoutInflater.from(mContext);
             convertView = inflater.inflate(R.layout.tools_spinner_list_image_item, null);
-            holder = new CShapeStyleViewHolder();
-            holder.ivShapeStyle = convertView.findViewById(R.id.iv_image_menu);
+            holder = new CEffectTypeViewHolder();
+            holder.ivEffectType = convertView.findViewById(R.id.iv_image_menu);
             convertView.setTag(holder);
         }else {
-            holder = (CShapeStyleViewHolder) convertView.getTag();
+            holder = (CEffectTypeViewHolder) convertView.getTag();
         }
-        ShapeStyle shapeStyle = list.get(position);
-        holder.ivShapeStyle.setImageResource(shapeStyle == ShapeStyle.Straight_Line ? R.drawable.tools_line_type_straight_line : R.drawable.tools_line_type_squiggly);
+        CPDFAnnotation.CPDFBorderEffectType shapeStyle = list.get(position);
+        holder.ivEffectType.setImageResource(shapeStyle == CPDFAnnotation.CPDFBorderEffectType.CPDFBorderEffectTypeSolid ?
+                R.drawable.tools_bord_effect_type_solid : R.drawable.tools_bord_effect_type_cloudy);
         return convertView;
     }
 
-    static class CShapeStyleViewHolder{
-        AppCompatImageView ivShapeStyle;
+    static class CEffectTypeViewHolder {
+        AppCompatImageView ivEffectType;
     }
 }

+ 15 - 12
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/pdf/CPDFApplyConfigUtil.java

@@ -242,19 +242,22 @@ public class CPDFApplyConfigUtil {
                             })
             );
         } else {
-            builder.setShape(styleType,
-                    shapeAttr.getBorderColor(),
-                    shapeAttr.getColorAlpha(),
-                    shapeAttr.getFillColor(),
-                    shapeAttr.getColorAlpha(),
+            CAnnotStyle shapeAnnotStyle = new CAnnotStyle(styleType);
+            shapeAnnotStyle.setBorderColor(shapeAttr.getBorderColor());
+            shapeAnnotStyle.setLineColorOpacity(shapeAttr.getColorAlpha());
+            shapeAnnotStyle.setFillColor(shapeAttr.getFillColor());
+            shapeAnnotStyle.setFillColorOpacity(shapeAttr.getColorAlpha());
+            shapeAnnotStyle.setBorderWidth(shapeAttr.getBorderWidth());
+
+            CPDFBorderStyle borderStyle = new CPDFBorderStyle(CPDFBorderStyle.Style.valueOf(shapeBorderStyle.borderStyle.id),
                     shapeAttr.getBorderWidth(),
-                    new CPDFBorderStyle(CPDFBorderStyle.Style.valueOf(shapeBorderStyle.borderStyle.id),
-                            shapeAttr.getBorderWidth(),
-                            new float[]{
-                                    shapeBorderStyle.dashWidth,
-                                    shapeBorderStyle.dashGap,
-                            })
-            );
+                    new float[]{
+                            shapeBorderStyle.dashWidth,
+                            shapeBorderStyle.dashGap,
+                    });
+            shapeAnnotStyle.setBorderStyle(borderStyle);
+            shapeAnnotStyle.setBordEffectType(shapeAttr.getBorderEffectType());
+            builder.setAnnotStyle(shapeAnnotStyle);
         }
     }
 

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

@@ -15,6 +15,7 @@ import android.text.TextUtils;
 
 import androidx.annotation.Nullable;
 
+import com.compdfkit.core.annotation.CPDFAnnotation;
 import com.compdfkit.core.annotation.CPDFTextAttribute;
 import com.compdfkit.core.annotation.form.CPDFWidget;
 import com.compdfkit.core.edit.CPDFEditTextArea;
@@ -343,6 +344,12 @@ public class CPDFConfigurationUtils {
                     shapeBorderStyle.dashGap = (float) borderStyleJsonObject.optDouble("dashGap", 0.0);
                     shapeAttr.setBorderStyle(shapeBorderStyle);
                 }
+                String bordEffectType = annotJsonObject.optString("bordEffectType", "solid");
+                if ("solid".equals(bordEffectType)){
+                    shapeAttr.setBorderEffectType(CPDFAnnotation.CPDFBorderEffectType.CPDFBorderEffectTypeSolid);
+                }else {
+                    shapeAttr.setBorderEffectType(CPDFAnnotation.CPDFBorderEffectType.CPDFBorderEffectTypeCloudy);
+                }
                 String startLineType = annotJsonObject.optString("startLineType", AnnotShapeAttr.AnnotLineType.None.name());
                 shapeAttr.setStartLineType(AnnotShapeAttr.AnnotLineType.fromString(startLineType));
                 String tailLineType = annotJsonObject.optString("tailLineType", AnnotShapeAttr.AnnotLineType.None.name());

+ 7 - 6
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/pdf/CPDFDocumentFragment.java

@@ -283,10 +283,6 @@ public class CPDFDocumentFragment extends CBasicPDFFragment {
         pdfView.getCPdfReaderView().setMinScaleEnable(false);
         registerAnnotHelper(pdfView);
         registerFormHelper(pdfView);
-        Paint paint = new Paint();
-        paint.setStyle(Paint.Style.FILL);
-        paint.setColor(ContextCompat.getColor(getContext(), R.color.tools_color_accent_50));
-        pdfView.getCPdfReaderView().setFormPreviewPaint(paint);
         pdfView.addOnPDFFocusedTypeChangeListener(type -> {
             if (type != CPDFAnnotation.Type.INK) {
                 if (inkCtrlView.getVisibility() == View.VISIBLE) {
@@ -318,12 +314,10 @@ public class CPDFDocumentFragment extends CBasicPDFFragment {
             }
         });
         pdfView.getCPdfReaderView().setPdfAddAnnotCallback((cpdfPageView, cpdfBaseAnnot) -> {
-            CLog.e("ComPDFKit", "Add Annot Callback- type:" + cpdfBaseAnnot.getAnnotType().name());
             CPDFAnnotation annotation = cpdfBaseAnnot.onGetAnnotation();
             annotation.setTitle(cpdfConfiguration.annotationsConfig.annotationAuthor);
             annotation.updateAp();
 
-            CLog.e("ComPDFKit", "Add Annot Callback- setTitle:" + annotation.getTitle());
             // Annotation creation completed listener, you can use cpdfBaseAnnot.getAnnotType() to determine the type of the added annotation
             if (cpdfBaseAnnot instanceof CPDFListboxWidgetImpl) {
                 // When the ListBox form is created, display an editing dialog for adding list data
@@ -543,12 +537,19 @@ public class CPDFDocumentFragment extends CBasicPDFFragment {
         }
         editToolBar.initWithPDFView(pdfView);
         editToolBar.setEditMode(false);
+
+        Paint paint = new Paint();
+        paint.setStyle(Paint.Style.FILL);
+        paint.setColor(ContextCompat.getColor(getContext(), R.color.tools_color_accent_50));
+
         CPDFEditConfig editConfig = pdfView.getCPdfReaderView()
                 .getEditManager()
                 .getEditConfigBuilder()
                 .setScreenshotRectColor(Color.TRANSPARENT)
                 .setScreenshotBorderColor(ContextCompat.getColor(getContext(), R.color.tools_color_accent))
                 .setScreenshotBorderDash(new float[]{8.0F, 4F})
+                .setFormPreviewPaint(paint)
+                .setRotateAnnotationDrawableRes(R.drawable.tools_ic_watermark_control)
                 .build();
 
         pdfView.getCPdfReaderView().getEditManager().updateEditConfig(editConfig);

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

@@ -14,6 +14,8 @@ import android.graphics.Color;
 
 import androidx.annotation.FloatRange;
 
+import com.compdfkit.core.annotation.CPDFAnnotation;
+
 import java.io.Serializable;
 
 public class AnnotShapeAttr extends AnnotAttr {
@@ -34,6 +36,8 @@ public class AnnotShapeAttr extends AnnotAttr {
 
     private ShapeBorderStyle borderStyle = new ShapeBorderStyle();
 
+    private CPDFAnnotation.CPDFBorderEffectType borderEffectType = CPDFAnnotation.CPDFBorderEffectType.CPDFBorderEffectTypeSolid;
+
     public String getFillColorHex() {
         return fillColor;
     }
@@ -123,6 +127,14 @@ public class AnnotShapeAttr extends AnnotAttr {
         this.borderStyle = borderStyle;
     }
 
+    public void setBorderEffectType(CPDFAnnotation.CPDFBorderEffectType borderEffectType) {
+        this.borderEffectType = borderEffectType;
+    }
+
+    public CPDFAnnotation.CPDFBorderEffectType getBorderEffectType() {
+        return borderEffectType;
+    }
+
     public static class ShapeBorderStyle implements Serializable {
 
         public StyleType borderStyle = StyleType.Solid;

+ 41 - 0
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/utils/glide/transformation/RotateTransformation.java

@@ -0,0 +1,41 @@
+/**
+ * Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+ *
+ * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+ * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+ * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+ * This notice may not be removed from this file.
+ */
+package com.compdfkit.tools.common.utils.glide.transformation;
+
+import android.graphics.Bitmap;
+import android.graphics.Matrix;
+
+import androidx.annotation.NonNull;
+
+import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
+import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
+
+import java.security.MessageDigest;
+
+public
+class RotateTransformation extends BitmapTransformation {
+
+    private float rotateRotationAngle;
+
+    public RotateTransformation(float rotateRotationAngle) {
+        this.rotateRotationAngle = rotateRotationAngle;
+    }
+
+    @Override
+    public void updateDiskCacheKey(MessageDigest messageDigest) {
+
+    }
+
+    @Override
+    protected Bitmap transform(@NonNull BitmapPool pool, @NonNull Bitmap toTransform, int outWidth, int outHeight) {
+        Matrix matrix = new Matrix();
+        matrix.postRotate(rotateRotationAngle);
+        return Bitmap.createBitmap(toTransform, 0, 0, toTransform.getWidth(), toTransform.getHeight(), matrix, true);
+    }
+}

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

@@ -16,6 +16,7 @@ import androidx.annotation.Nullable;
 import androidx.fragment.app.Fragment;
 import androidx.lifecycle.ViewModelProvider;
 
+import com.compdfkit.core.annotation.CPDFAnnotation;
 import com.compdfkit.core.annotation.CPDFBorderStyle;
 import com.compdfkit.core.annotation.CPDFLineAnnotation;
 import com.compdfkit.core.annotation.CPDFStampAnnotation;
@@ -227,6 +228,21 @@ public abstract class CBasicPropertiesFragment extends Fragment implements CAnno
 
     }
 
+    @Override
+    public void onChangeShapeBordEffectType(CPDFAnnotation.CPDFBorderEffectType type) {
+
+    }
+
+    @Override
+    public void onChangeEditTextStrikeThrough(boolean addStrikeThrough) {
+
+    }
+
+    @Override
+    public void onChangeEditTextUnderline(boolean addUnderline) {
+
+    }
+
     public void setSwitchFragmentListener(OnSwitchFragmentListener switchFragmentListener) {
         this.switchFragmentListener = switchFragmentListener;
     }

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

@@ -10,6 +10,7 @@
 package com.compdfkit.tools.common.views.pdfproperties.pdfstyle;
 
 
+import android.graphics.Bitmap;
 import android.graphics.Color;
 import android.net.Uri;
 import android.text.TextUtils;
@@ -20,6 +21,7 @@ import androidx.annotation.IntRange;
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 
+import com.compdfkit.core.annotation.CPDFAnnotation;
 import com.compdfkit.core.annotation.CPDFBorderStyle;
 import com.compdfkit.core.annotation.CPDFLineAnnotation;
 import com.compdfkit.core.annotation.CPDFStampAnnotation;
@@ -101,6 +103,14 @@ public class CAnnotStyle implements Serializable {
 
     private CPDFWidget.BorderStyle signFieldsBorderStyle = CPDFWidget.BorderStyle.BS_Solid;
 
+    private CPDFAnnotation.CPDFBorderEffectType bordEffectType = CPDFAnnotation.CPDFBorderEffectType.CPDFBorderEffectTypeSolid;
+
+    private boolean editTextUnderLine = false;
+
+    private boolean editTextStrikeThrough = false;
+
+    private transient Bitmap editImageBitmap;
+
     private List<OnAnnotStyleChangeListener> styleChangeListenerList = new ArrayList<>();
 
     public CAnnotStyle(CStyleType type) {
@@ -441,6 +451,26 @@ public class CAnnotStyle implements Serializable {
         return checkStyle;
     }
 
+    public void setEditTextUnderLine(boolean editTextUnderLine) {
+        boolean update = this.editTextUnderLine != editTextUnderLine;
+        this.editTextUnderLine = editTextUnderLine;
+        updateEditTextUnderLine(editTextUnderLine, update);
+    }
+
+    public boolean isEditTextUnderLine() {
+        return editTextUnderLine;
+    }
+
+    public void setEditTextStrikeThrough(boolean editTextStrikeThrough) {
+        boolean update = this.editTextStrikeThrough != editTextStrikeThrough;
+        this.editTextStrikeThrough = editTextStrikeThrough;
+        updateEditTextStrikeThrough(editTextStrikeThrough, update);
+    }
+
+    public boolean isEditTextStrikeThrough() {
+        return editTextStrikeThrough;
+    }
+
     public void setChecked(boolean checked) {
         boolean update = checked != this.isChecked;
         isChecked = checked;
@@ -472,6 +502,24 @@ public class CAnnotStyle implements Serializable {
         return signFieldsBorderStyle;
     }
 
+    public CPDFAnnotation.CPDFBorderEffectType getBordEffectType() {
+        return bordEffectType;
+    }
+
+    public void setBordEffectType(CPDFAnnotation.CPDFBorderEffectType bordEffectType) {
+        boolean update = this.bordEffectType != bordEffectType;
+        this.bordEffectType = bordEffectType;
+        updateShapeBordEffectType(bordEffectType, update);
+    }
+
+    public Bitmap getEditImageBitmap() {
+        return editImageBitmap;
+    }
+
+    public void setEditImageBitmap(Bitmap editImageBitmap) {
+        this.editImageBitmap = editImageBitmap;
+    }
+
     @NonNull
     @Override
     public String toString() {
@@ -502,8 +550,11 @@ public class CAnnotStyle implements Serializable {
                 "formDefaultValue" + formDefaultValue + "," +
                 "hideForm" + hideForm + "," +
                 "formMultiLine" + formMultiLine + "," +
-                "customExtraMap" + customExtraMap.toString() +
-                "signFieldsBorderStyle" + (signFieldsBorderStyle != null ? signFieldsBorderStyle.name() : "empty");
+                "customExtraMap" + customExtraMap.toString() + "," +
+                "signFieldsBorderStyle" + (signFieldsBorderStyle != null ? signFieldsBorderStyle.name() : "empty") + "," +
+                "bordEffectType" + bordEffectType + "," +
+                "editTextUnderLine" + editTextUnderLine + "," +
+                "editTextStrikeThrough" + editTextStrikeThrough+ "}";
     }
 
     @Override
@@ -532,6 +583,7 @@ public class CAnnotStyle implements Serializable {
         result = 31 * result + (this.formDefaultValue != null ? this.formDefaultValue.hashCode() : 0);
         result = 31 * result + (this.customExtraMap != null ? this.customExtraMap.hashCode() : 0);
         result = 31 * result + (this.signFieldsBorderStyle != null ? this.signFieldsBorderStyle.hashCode() : 0);
+        result = 31 * result + (this.bordEffectType != null ? this.bordEffectType.hashCode() : 0);
         return result;
     }
 
@@ -883,6 +935,30 @@ public class CAnnotStyle implements Serializable {
         }
     }
 
+    private void updateShapeBordEffectType(CPDFAnnotation.CPDFBorderEffectType bordEffectType, boolean update){
+        if (styleChangeListenerList != null && update) {
+            for (OnAnnotStyleChangeListener onAnnotStyleChangeListener : styleChangeListenerList) {
+                onAnnotStyleChangeListener.onChangeShapeBordEffectType(bordEffectType);
+            }
+        }
+    }
+
+    private void updateEditTextUnderLine(boolean addUnderLine, boolean update) {
+        if (styleChangeListenerList != null && update) {
+            for (OnAnnotStyleChangeListener onAnnotStyleChangeListener : styleChangeListenerList) {
+                onAnnotStyleChangeListener.onChangeEditTextUnderline(addUnderLine);
+            }
+        }
+    }
+
+    private void updateEditTextStrikeThrough(boolean addStrikeThrough, boolean update) {
+        if (styleChangeListenerList != null && update) {
+            for (OnAnnotStyleChangeListener onAnnotStyleChangeListener : styleChangeListenerList) {
+                onAnnotStyleChangeListener.onChangeEditTextStrikeThrough(addStrikeThrough);
+            }
+        }
+    }
+
     public void addStyleChangeListener(OnAnnotStyleChangeListener styleChangeListener) {
         this.styleChangeListenerList.add(styleChangeListener);
     }
@@ -965,6 +1041,12 @@ public class CAnnotStyle implements Serializable {
         void onChangeExtraMap(Map<String, Object> extraMap);
 
         void onChangeSignFieldsBorderStyle(CPDFWidget.BorderStyle borderStyle);
+
+        void onChangeShapeBordEffectType(CPDFAnnotation.CPDFBorderEffectType type);
+
+        void onChangeEditTextUnderline(boolean addUnderline);
+
+        void onChangeEditTextStrikeThrough(boolean addStrikeThrough);
     }
 
     public void setUpdatePropertyType(EditUpdatePropertyType type) {
@@ -993,7 +1075,9 @@ public class CAnnotStyle implements Serializable {
         Mirror,
         ReplaceImage,
         Export,
-        Crop
+        Crop,
+        UnderLine,
+        StrikeThrough
     }
 
     public enum Mirror{

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

@@ -12,6 +12,7 @@ package com.compdfkit.tools.common.views.pdfproperties.pdfstyle;
 
 import android.net.Uri;
 
+import com.compdfkit.core.annotation.CPDFAnnotation;
 import com.compdfkit.core.annotation.CPDFBorderStyle;
 import com.compdfkit.core.annotation.CPDFLineAnnotation;
 import com.compdfkit.core.annotation.CPDFStampAnnotation;
@@ -175,4 +176,19 @@ public class CBasicOnStyleChangeListener  implements CAnnotStyle.OnAnnotStyleCha
     public void onChangeSignFieldsBorderStyle(CPDFWidget.BorderStyle borderStyle) {
 
     }
+
+    @Override
+    public void onChangeShapeBordEffectType(CPDFAnnotation.CPDFBorderEffectType type) {
+
+    }
+
+    @Override
+    public void onChangeEditTextStrikeThrough(boolean addStrikeThrough) {
+
+    }
+
+    @Override
+    public void onChangeEditTextUnderline(boolean addUnderline) {
+
+    }
 }

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

@@ -256,6 +256,22 @@ public class CStyleManager implements CAnnotStyle.OnAnnotStyleChangeListener {
         updateAnnot();
     }
 
+
+    @Override
+    public void onChangeShapeBordEffectType(CPDFAnnotation.CPDFBorderEffectType type) {
+        updateAnnot();
+    }
+
+    @Override
+    public void onChangeEditTextStrikeThrough(boolean addStrikeThrough) {
+        updateAnnot();
+    }
+
+    @Override
+    public void onChangeEditTextUnderline(boolean addUnderline) {
+        updateAnnot();
+    }
+
     private void updateAnnot() {
         if (styleDialogFragment != null) {
             CAnnotStyle style = styleDialogFragment.getAnnotStyle();

+ 75 - 39
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/views/pdfproperties/pdfstyle/manager/provider/CEditSelectionsProvider.java

@@ -53,45 +53,79 @@ public class CEditSelectionsProvider implements CStyleProvider {
             if (selections instanceof CPDFEditTextSelections && style.getType() == CStyleType.EDIT_TEXT) {
                 CPDFEditTextSelections textSelections = (CPDFEditTextSelections) selections;
                 CAnnotStyle.EditUpdatePropertyType type = style.getUpdatePropertyType();
-                if (type == CAnnotStyle.EditUpdatePropertyType.FontSize) {
-                    textSelections.setFontSize(style.getFontSize());
-                } else if (type == CAnnotStyle.EditUpdatePropertyType.TextColor) {
-                    textSelections.setColor(style.getTextColor());
-                } else if (type == CAnnotStyle.EditUpdatePropertyType.TextColorOpacity) {
-                    textSelections.setTransparancy(style.getTextColorOpacity());
-                } else if (type == CAnnotStyle.EditUpdatePropertyType.Italic) {
-                    textSelections.setItalic(style.isFontItalic());
-                } else if (type == CAnnotStyle.EditUpdatePropertyType.Bold) {
-                    textSelections.setBold(style.isFontBold());
-                } else if (type == CAnnotStyle.EditUpdatePropertyType.Alignment) {
-                    CAnnotStyle.Alignment align = style.getAlignment();
-                    if (align == CAnnotStyle.Alignment.LEFT) {
-                        textSelections.setAlign(CPDFEditTextArea.PDFEditAlignType.PDFEditAlignLeft);
-                    } else if (align == CAnnotStyle.Alignment.CENTER) {
-                        textSelections.setAlign(CPDFEditTextArea.PDFEditAlignType.PDFEditAlignMiddle);
-                    } else if (align == CAnnotStyle.Alignment.RIGHT) {
-                        textSelections.setAlign(CPDFEditTextArea.PDFEditAlignType.PDFEditAlignRight);
-                    }
-                } else if (type == CAnnotStyle.EditUpdatePropertyType.FontType) {
-                    textSelections.setFontName(getAnnotStyleFontName(style));
-                    textSelections.setBold(style.isFontBold());
-                    textSelections.setItalic(style.isFontItalic());
+                switch (type){
+                    case FontSize:
+                        textSelections.setFontSize(style.getFontSize());
+                        break;
+                    case TextColor:
+                        textSelections.setColor(style.getTextColor());
+                        break;
+                    case TextColorOpacity:
+                        textSelections.setTransparancy(style.getTextColorOpacity());
+                        break;
+                    case Italic:
+                        textSelections.setItalic(style.isFontItalic());
+                        break;
+                    case Bold:
+                        textSelections.setBold(style.isFontBold());
+                        break;
+                    case Alignment:
+                        CAnnotStyle.Alignment align = style.getAlignment();
+                        if (align == CAnnotStyle.Alignment.LEFT) {
+                            textSelections.setAlign(CPDFEditTextArea.PDFEditAlignType.PDFEditAlignLeft);
+                        } else if (align == CAnnotStyle.Alignment.CENTER) {
+                            textSelections.setAlign(CPDFEditTextArea.PDFEditAlignType.PDFEditAlignMiddle);
+                        } else if (align == CAnnotStyle.Alignment.RIGHT) {
+                            textSelections.setAlign(CPDFEditTextArea.PDFEditAlignType.PDFEditAlignRight);
+                        }
+                        break;
+
+                    case FontType:
+                        textSelections.setFontName(getAnnotStyleFontName(style));
+                        textSelections.setBold(style.isFontBold());
+                        textSelections.setItalic(style.isFontItalic());
+                        break;
 
-                } else {
-                    textSelections.setColor(style.getTextColor());
-                    textSelections.setTransparancy(style.getTextColorOpacity());
-                    textSelections.setBold(style.isFontBold());
-                    textSelections.setItalic(style.isFontItalic());
-                    textSelections.setFontSize(style.getFontSize());
-                    CAnnotStyle.Alignment align = style.getAlignment();
-                    if (align == CAnnotStyle.Alignment.LEFT) {
-                        textSelections.setAlign(CPDFEditTextArea.PDFEditAlignType.PDFEditAlignLeft);
-                    } else if (align == CAnnotStyle.Alignment.CENTER) {
-                        textSelections.setAlign(CPDFEditTextArea.PDFEditAlignType.PDFEditAlignMiddle);
-                    } else if (align == CAnnotStyle.Alignment.RIGHT) {
-                        textSelections.setAlign(CPDFEditTextArea.PDFEditAlignType.PDFEditAlignRight);
-                    }
-                    textSelections.setFontName(getAnnotStyleFontName(style));
+                    case UnderLine:
+                        if (style.isEditTextUnderLine()){
+                            textSelections.addUnderline();
+                        }else {
+                            textSelections.removeUnderline();
+                        }
+                        break;
+                    case StrikeThrough:
+                        if (style.isEditTextStrikeThrough()){
+                            textSelections.addStrikethrough();
+                        }else {
+                            textSelections.removeStrikethrough();
+                        }
+                        break;
+                    default:
+                        textSelections.setColor(style.getTextColor());
+                        textSelections.setTransparancy(style.getTextColorOpacity());
+                        textSelections.setBold(style.isFontBold());
+                        textSelections.setItalic(style.isFontItalic());
+                        textSelections.setFontSize(style.getFontSize());
+                        CAnnotStyle.Alignment align1 = style.getAlignment();
+                        if (align1 == CAnnotStyle.Alignment.LEFT) {
+                            textSelections.setAlign(CPDFEditTextArea.PDFEditAlignType.PDFEditAlignLeft);
+                        } else if (align1 == CAnnotStyle.Alignment.CENTER) {
+                            textSelections.setAlign(CPDFEditTextArea.PDFEditAlignType.PDFEditAlignMiddle);
+                        } else if (align1 == CAnnotStyle.Alignment.RIGHT) {
+                            textSelections.setAlign(CPDFEditTextArea.PDFEditAlignType.PDFEditAlignRight);
+                        }
+                        textSelections.setFontName(getAnnotStyleFontName(style));
+                        if (style.isEditTextUnderLine()){
+                            textSelections.addUnderline();
+                        }else {
+                            textSelections.removeUnderline();
+                        }
+                        if (style.isEditTextStrikeThrough()){
+                            textSelections.addStrikethrough();
+                        }else {
+                            textSelections.removeStrikethrough();
+                        }
+                        break;
                 }
             } else if (style.getType() == CStyleType.EDIT_IMAGE) {
                 CAnnotStyle.EditUpdatePropertyType updatePropertyType = style.getUpdatePropertyType();
@@ -174,8 +208,10 @@ public class CEditSelectionsProvider implements CStyleProvider {
         } else if (style.getType() == CStyleType.EDIT_IMAGE) {
             CPDFEditArea editArea = pageView.getCurrentEditArea();
             if (editArea != null && editArea instanceof CPDFEditImageArea) {
-                float transparency = ((CPDFEditImageArea)editArea).getTransparency();
+                CPDFEditImageArea editImageArea = (CPDFEditImageArea) editArea;
+                float transparency = editImageArea.getTransparency();
                 style.setOpacity((int) transparency);
+                style.setEditImageBitmap(editImageArea.getImage());
             } else {
                 style.setOpacity(255);
             }

+ 7 - 0
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/views/pdfproperties/pdfstyle/manager/provider/CGlobalStyleProvider.java

@@ -12,6 +12,7 @@ package com.compdfkit.tools.common.views.pdfproperties.pdfstyle.manager.provider
 
 import android.text.TextUtils;
 
+import com.compdfkit.core.annotation.CPDFAnnotation;
 import com.compdfkit.core.annotation.CPDFBorderStyle;
 import com.compdfkit.core.annotation.CPDFFreetextAnnotation;
 import com.compdfkit.core.annotation.CPDFLineAnnotation;
@@ -139,6 +140,8 @@ public class CGlobalStyleProvider extends CBasicOnStyleChangeListener implements
                     squareAttr.setBorderAlpha(params.getLineColorOpacity());
                     squareAttr.setBorderWidth(params.getBorderWidth());
                     squareAttr.setBorderStyle(params.getBorderStyle());
+                    squareAttr.setEffectType(params.getBordEffectType());
+                    squareAttr.setEffectIntensity(CPDFAnnotation.BorderEffectIntensity.INTENSITY_ONE);
                     callback = squareAttr;
                     break;
                 case ANNOT_CIRCLE:
@@ -149,6 +152,8 @@ public class CGlobalStyleProvider extends CBasicOnStyleChangeListener implements
                     circleAttr.setBorderAlpha(params.getLineColorOpacity());
                     circleAttr.setBorderWidth(params.getBorderWidth());
                     circleAttr.setBorderStyle(params.getBorderStyle());
+                    circleAttr.setEffectType(params.getBordEffectType());
+                    circleAttr.setEffectIntensity(CPDFAnnotation.BorderEffectIntensity.INTENSITY_ONE);
                     callback = circleAttr;
                     break;
                 case ANNOT_LINE:
@@ -399,6 +404,7 @@ public class CGlobalStyleProvider extends CBasicOnStyleChangeListener implements
                 style.setLineColorOpacity(squareAttr.getBorderAlpha());
                 style.setBorderWidth(squareAttr.getBorderWidth());
                 style.setBorderStyle(squareAttr.getBorderStyle());
+                style.setBordEffectType(squareAttr.getEffectType());
                 break;
             case ANNOT_CIRCLE:
                 CPDFCircleAttr circleAttr = attribute.getCircleAttr();
@@ -408,6 +414,7 @@ public class CGlobalStyleProvider extends CBasicOnStyleChangeListener implements
                 style.setLineColorOpacity(circleAttr.getBorderAlpha());
                 style.setBorderWidth(circleAttr.getBorderWidth());
                 style.setBorderStyle(circleAttr.getBorderStyle());
+                style.setBordEffectType(circleAttr.getEffectType());
                 break;
             case ANNOT_LINE:
 

+ 19 - 5
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/views/pdfproperties/pdfstyle/manager/provider/CSelectedAnnotStyleProvider.java

@@ -9,6 +9,7 @@
 
 package com.compdfkit.tools.common.views.pdfproperties.pdfstyle.manager.provider;
 
+import com.compdfkit.core.annotation.CPDFAnnotation;
 import com.compdfkit.core.annotation.CPDFBorderStyle;
 import com.compdfkit.core.annotation.CPDFCircleAnnotation;
 import com.compdfkit.core.annotation.CPDFFreetextAnnotation;
@@ -65,7 +66,6 @@ public class CSelectedAnnotStyleProvider implements CStyleProvider {
             } else if (annotImpl instanceof CPDFInkAnnotImpl) {
                 CPDFInkAnnotImpl inkAnnot = (CPDFInkAnnotImpl) annotImpl;
                 CPDFInkAnnotation inkAnnotation = (CPDFInkAnnotation) inkAnnot.onGetAnnotation();
-                CLog.e("注释Ink", "color: " + style.getColor() +  " alpha: " + style.getOpacity());
                 inkAnnotation.setColor(style.getColor());
                 inkAnnotation.setAlpha(style.getOpacity());
                 inkAnnotation.setBorderWidth(style.getBorderWidth());
@@ -74,25 +74,37 @@ public class CSelectedAnnotStyleProvider implements CStyleProvider {
                 pageView.invalidate();
             } else if (annotImpl instanceof CPDFSquareAnnotImpl) {
                 CPDFSquareAnnotImpl squareAnnot = (CPDFSquareAnnotImpl) annotImpl;
-                CPDFSquareAnnotation squareAnnotation = squareAnnot.onGetAnnotation();
+                CPDFSquareAnnotation squareAnnotation = (CPDFSquareAnnotation) squareAnnot.onGetAnnotation();
                 squareAnnotation.setBorderColor(style.getLineColor());
                 squareAnnotation.setBorderAlpha(style.getLineColorOpacity());
                 squareAnnotation.setFillColor(style.getFillColor());
                 squareAnnotation.setFillAlpha(style.getFillColorOpacity());
                 squareAnnotation.setBorderStyle(style.getBorderStyle());
                 squareAnnotation.setBorderWidth(style.getBorderWidth());
+                squareAnnotation.setBordEffectType(style.getBordEffectType());
+                if (style.getBordEffectType() == CPDFAnnotation.CPDFBorderEffectType.CPDFBorderEffectTypeCloudy){
+                    squareAnnotation.setBordEffectIntensity(CPDFAnnotation.BorderEffectIntensity.INTENSITY_ONE);
+                }else {
+                    squareAnnotation.setBordEffectIntensity(CPDFAnnotation.BorderEffectIntensity.INTENSITY_ZERO);
+                }
                 squareAnnotation.updateAp();
                 annotImpl.onAnnotAttrChange();
                 pageView.invalidate();
             } else if (annotImpl instanceof CPDFCircleAnnotImpl) {
                 CPDFCircleAnnotImpl circleAnnot = (CPDFCircleAnnotImpl) annotImpl;
-                CPDFCircleAnnotation circleAnnotation = circleAnnot.onGetAnnotation();
+                CPDFCircleAnnotation circleAnnotation = (CPDFCircleAnnotation) circleAnnot.onGetAnnotation();
                 circleAnnotation.setBorderColor(style.getLineColor());
                 circleAnnotation.setBorderAlpha(style.getLineColorOpacity());
                 circleAnnotation.setFillColor(style.getFillColor());
                 circleAnnotation.setFillAlpha(style.getFillColorOpacity());
                 circleAnnotation.setBorderStyle(style.getBorderStyle());
                 circleAnnotation.setBorderWidth(style.getBorderWidth());
+                circleAnnotation.setBordEffectType(style.getBordEffectType());
+                if (style.getBordEffectType() == CPDFAnnotation.CPDFBorderEffectType.CPDFBorderEffectTypeCloudy){
+                    circleAnnotation.setBordEffectIntensity(CPDFAnnotation.BorderEffectIntensity.INTENSITY_ONE);
+                }else {
+                    circleAnnotation.setBordEffectIntensity(CPDFAnnotation.BorderEffectIntensity.INTENSITY_ZERO);
+                }
                 circleAnnotation.updateAp();
                 annotImpl.onAnnotAttrChange();
                 pageView.invalidate();
@@ -157,12 +169,13 @@ public class CSelectedAnnotStyleProvider implements CStyleProvider {
                 break;
             case ANNOT_SQUARE:
                 CPDFSquareAnnotImpl squareAnnot = (CPDFSquareAnnotImpl) annotImpl;
-                CPDFSquareAnnotation squareAnnotation = squareAnnot.onGetAnnotation();
+                CPDFSquareAnnotation squareAnnotation = (CPDFSquareAnnotation) squareAnnot.onGetAnnotation();
                 style.setBorderColor(squareAnnotation.getBorderColor());
                 style.setLineColorOpacity(squareAnnotation.getBorderAlpha());
                 style.setFillColor(squareAnnotation.getFillColor());
                 style.setFillColorOpacity(squareAnnotation.getFillAlpha());
                 style.setBorderWidth(squareAnnotation.getBorderWidth());
+                style.setBordEffectType(squareAnnotation.getBordEffectType());
                 CPDFBorderStyle borderStyle = squareAnnotation.getBorderStyle();
                 if (borderStyle == null){
                     borderStyle = new CPDFBorderStyle();
@@ -174,12 +187,13 @@ public class CSelectedAnnotStyleProvider implements CStyleProvider {
                 break;
             case ANNOT_CIRCLE:
                 CPDFCircleAnnotImpl circleAnnot = (CPDFCircleAnnotImpl) annotImpl;
-                CPDFCircleAnnotation circleAnnotation = circleAnnot.onGetAnnotation();
+                CPDFCircleAnnotation circleAnnotation = (CPDFCircleAnnotation) circleAnnot.onGetAnnotation();
                 style.setBorderColor(circleAnnotation.getBorderColor());
                 style.setLineColorOpacity(circleAnnotation.getBorderAlpha());
                 style.setFillColor(circleAnnotation.getFillColor());
                 style.setFillColorOpacity(circleAnnotation.getFillAlpha());
                 style.setBorderWidth(circleAnnotation.getBorderWidth());
+                style.setBordEffectType(circleAnnotation.getBordEffectType());
                 CPDFBorderStyle circleBorderStyle = circleAnnotation.getBorderStyle();
                 if (circleBorderStyle == null){
                     circleBorderStyle = new CPDFBorderStyle();

+ 3 - 0
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/views/pdfproperties/preview/CBasicAnnotPreviewView.java

@@ -11,6 +11,7 @@ package com.compdfkit.tools.common.views.pdfproperties.preview;
 
 
 import android.content.Context;
+import android.graphics.Bitmap;
 import android.util.AttributeSet;
 import android.widget.FrameLayout;
 
@@ -86,4 +87,6 @@ abstract class CBasicAnnotPreviewView extends FrameLayout {
     }
 
     public void setFontPsName(String fontPsName){}
+
+    public void setImage(Bitmap bitmap){}
 }

+ 40 - 11
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/views/pdfproperties/preview/CEditImagePreviewView.java

@@ -1,6 +1,6 @@
 /**
  * Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
- *
+ * <p>
  * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
  * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
  * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
@@ -11,6 +11,8 @@ package com.compdfkit.tools.common.views.pdfproperties.preview;
 
 
 import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.Matrix;
 import android.util.AttributeSet;
 import android.view.Gravity;
 import android.view.ViewGroup;
@@ -20,10 +22,17 @@ import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.appcompat.widget.AppCompatImageView;
 
+import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
+import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
+import com.bumptech.glide.request.RequestOptions;
 import com.compdfkit.tools.R;
+import com.compdfkit.tools.common.utils.glide.GlideApp;
+import com.compdfkit.tools.common.utils.glide.transformation.RotateTransformation;
 import com.compdfkit.tools.common.views.pdfproperties.pdfstyle.CAnnotStyle;
 
-public class CEditImagePreviewView extends CBasicAnnotPreviewView{
+import java.security.MessageDigest;
+
+public class CEditImagePreviewView extends CBasicAnnotPreviewView {
 
     private AppCompatImageView imageView;
 
@@ -42,7 +51,7 @@ public class CEditImagePreviewView extends CBasicAnnotPreviewView{
     @Override
     protected void bindView() {
         imageView = new AppCompatImageView(getContext());
-        FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+        FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
         layoutParams.gravity = Gravity.CENTER;
         imageView.setImageResource(R.drawable.tools_edit_image_property_preview);
         addView(imageView, layoutParams);
@@ -61,16 +70,17 @@ public class CEditImagePreviewView extends CBasicAnnotPreviewView{
         }
     }
 
+    private float rotationAngle = 0;
+
     @Override
     public void setRotationAngle(float angle) {
         if (imageView != null) {
-            imageView.setPivotX(imageView.getWidth() / 2F);
-            imageView.setPivotY(imageView.getHeight() / 2F);
-            if (angle < 0){
-                imageView.setRotation(imageView.getRotation() - Math.abs(angle));
-            }else {
-                imageView.setRotation(imageView.getRotation() + angle);
+            if (angle < 0) {
+                rotationAngle -= Math.abs(angle);
+            } else {
+                rotationAngle += angle;
             }
+            reloadBitmap();
         }
     }
 
@@ -81,13 +91,32 @@ public class CEditImagePreviewView extends CBasicAnnotPreviewView{
     @Override
     public void setMirror(CAnnotStyle.Mirror mirror) {
         if (imageView != null) {
-            if (mirror == CAnnotStyle.Mirror.Horizontal){
+            if (mirror == CAnnotStyle.Mirror.Horizontal) {
                 horizontalMirror = !horizontalMirror;
                 imageView.setScaleX(horizontalMirror ? -1 : 1);
-            }else {
+            } else {
                 verticalMirror = !verticalMirror;
                 imageView.setScaleY(verticalMirror ? -1 : 1);
             }
         }
     }
+
+    private Bitmap bitmap;
+
+    @Override
+    public void setImage(Bitmap bitmap) {
+        super.setImage(bitmap);
+        this.bitmap = bitmap;
+        reloadBitmap();
+    }
+
+    private void reloadBitmap() {
+        if (bitmap != null) {
+            GlideApp.with(this)
+                    .load(bitmap)
+                    .apply(RequestOptions.bitmapTransform(new RotateTransformation(rotationAngle)))
+                    .into(imageView);
+        }
+    }
+
 }

+ 10 - 2
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/common/views/pdfproperties/preview/CStylePreviewView.java

@@ -11,6 +11,7 @@ package com.compdfkit.tools.common.views.pdfproperties.preview;
 
 import android.content.Context;
 import android.content.res.TypedArray;
+import android.graphics.Bitmap;
 import android.util.AttributeSet;
 import android.view.Gravity;
 import android.view.ViewGroup;
@@ -151,6 +152,12 @@ public class CStylePreviewView extends FrameLayout {
         }
     }
 
+    public void setImage(Bitmap bitmap){
+        if (previewView != null){
+            previewView.setImage(bitmap);
+        }
+    }
+
     private void updatePreview() {
         removeAllViews();
         previewView = null;
@@ -211,9 +218,10 @@ public class CStylePreviewView extends FrameLayout {
                 break;
             case EDIT_IMAGE:
                 previewView = new CEditImagePreviewView(getContext());
-                int editImageSize = CDimensUtils.dp2px(getContext(), 50);
-                layoutParams = new LayoutParams(editImageSize,editImageSize);
+                layoutParams = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
                 layoutParams.gravity = Gravity.CENTER;
+                int margin = CDimensUtils.dp2px(getContext(), 4);
+                layoutParams.setMargins(margin, margin,margin,margin);
                 previewView.setLayoutParams(layoutParams);
                 break;
             default:

+ 1 - 0
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/contenteditor/pdfproperties/CEditImagePropertiesFragment.java

@@ -85,6 +85,7 @@ public class CEditImagePropertiesFragment extends CBasicPropertiesFragment imple
         rlCrop.setOnClickListener(this);
         rlExport.setOnClickListener(this);
         stylePreviewView.setAnnotType(CStyleType.EDIT_IMAGE);
+        stylePreviewView.setImage(viewModel.getStyle().getEditImageBitmap());
         opacitySliderBar.setProgress(viewModel.getStyle().getOpacity());
         opacitySliderBar.setChangeListener((progress, percentageValue, isStopTouch) -> {
             if (isStopTouch) {

+ 12 - 3
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/contenteditor/pdfproperties/CEditTextProperFragment.java

@@ -48,8 +48,10 @@ public class CEditTextProperFragment extends CBasicPropertiesFragment
     private CPDFFontView fontView;
 
     private AppCompatImageView ivStyleUnderLine;
+    private AppCompatImageView ivStyleRemoveUnderLine;
 
     private AppCompatImageView ivStyleStrikeLine;
+    private AppCompatImageView ivStyleRemoveStrikeLine;
 
     private List<View> alignmentViews = new ArrayList<>();
 
@@ -75,12 +77,16 @@ public class CEditTextProperFragment extends CBasicPropertiesFragment
         fontSizeSliderBar = rootView.findViewById(R.id.font_size_slider_bar);
         fontView = rootView.findViewById(R.id.font_view);
         ivStyleUnderLine = rootView.findViewById(R.id.iv_style_underline);
+        ivStyleRemoveUnderLine = rootView.findViewById(R.id.iv_style_remove_underline);
         ivStyleStrikeLine = rootView.findViewById(R.id.iv_style_strike_line);
+        ivStyleRemoveStrikeLine = rootView.findViewById(R.id.iv_style_remove_strike_line);
         ivAlignmentLeft.setOnClickListener(this);
         ivAlignmentCenter.setOnClickListener(this);
         ivAlignmentRight.setOnClickListener(this);
+        ivStyleRemoveUnderLine.setOnClickListener(this);
         ivStyleUnderLine.setOnClickListener(this);
         ivStyleStrikeLine.setOnClickListener(this);
+        ivStyleRemoveStrikeLine.setOnClickListener(this);
         alignmentViews.add(ivAlignmentLeft);
         alignmentViews.add(ivAlignmentCenter);
         alignmentViews.add(ivAlignmentRight);
@@ -157,7 +163,6 @@ public class CEditTextProperFragment extends CBasicPropertiesFragment
             if (viewModel != null) {
                 boolean isBold = CPDFTextAttribute.FontNameHelper.isBold(psName);
                 boolean isItalic = CPDFTextAttribute.FontNameHelper.isItalic(psName);
-                CLog.e("字体", "内容编辑:Font:" + psName + ", isBold:" + isBold + ", isItalic:" + isItalic);
                 setUpdatePropertyType(CAnnotStyle.EditUpdatePropertyType.FontType);
                 viewModel.getStyle().setBold(isBold);
                 viewModel.getStyle().setItalic(isItalic);
@@ -179,9 +184,13 @@ public class CEditTextProperFragment extends CBasicPropertiesFragment
             selectAlignmentView(ivAlignmentRight);
             setAlignment(CAnnotStyle.Alignment.RIGHT);
         } else if (v.getId() == R.id.iv_style_underline) {
-            ivStyleUnderLine.setSelected(!ivStyleUnderLine.isSelected());
+            viewModel.getStyle().setEditTextUnderLine(true);
         } else if (v.getId() == R.id.iv_style_strike_line) {
-            ivStyleStrikeLine.setSelected(!ivStyleStrikeLine.isSelected());
+            viewModel.getStyle().setEditTextStrikeThrough(true);
+        } else if (v.getId() == R.id.iv_style_remove_underline) {
+            viewModel.getStyle().setEditTextUnderLine(false);
+        } else if (v.getId() == R.id.iv_style_remove_strike_line) {
+            viewModel.getStyle().setEditTextStrikeThrough(false);
         } else {
 
         }

ComPDFKit_Tools/src/main/res/drawable/tools_line_type_squiggly.xml → ComPDFKit_Tools/src/main/res/drawable/tools_bord_effect_type_cloudy.xml


ComPDFKit_Tools/src/main/res/drawable/tools_line_type_straight_line.xml → ComPDFKit_Tools/src/main/res/drawable/tools_bord_effect_type_solid.xml


+ 10 - 0
ComPDFKit_Tools/src/main/res/drawable/tools_edit_text_style_remove_strike_line.xml

@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="17dp"
+    android:height="16dp"
+    android:viewportWidth="17"
+    android:viewportHeight="16">
+  <path
+      android:pathData="M11.102,11V9.5H12.602V11C12.602,13.209 10.811,15 8.602,15C6.923,15 5.486,13.966 4.892,12.5H6.601C7.057,13.107 7.784,13.5 8.602,13.5C9.982,13.5 11.102,12.381 11.102,11ZM6.102,5V6.5H4.602V5C4.602,2.791 6.392,1 8.602,1C10.128,1 11.455,1.855 12.129,3.112L14.171,1.07L15.232,2.13L10.112,7.25H14.602V8.75H8.612L4.032,13.33L2.971,12.27L6.491,8.75H2.602V7.25H7.991L11.741,3.5H10.602C10.146,2.893 9.419,2.5 8.602,2.5C7.221,2.5 6.102,3.619 6.102,5Z"
+      android:fillColor="#43474D"
+      android:fillType="evenOdd"/>
+</vector>

+ 10 - 0
ComPDFKit_Tools/src/main/res/drawable/tools_edit_text_style_remove_underline.xml

@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="17dp"
+    android:height="16dp"
+    android:viewportWidth="17"
+    android:viewportHeight="16">
+  <path
+      android:pathData="M5.151,1V7C5.151,7.755 5.408,8.449 5.839,9.001L11.651,3.189V1H13.151V1.689L13.77,1.07L14.831,2.13L13.151,3.811V7C13.151,9.623 11.024,11.75 8.401,11.75C7.489,11.75 6.637,11.493 5.914,11.048L3.711,13.25H13.401V14.75H3.401V13.25H3.551L2.57,12.27L4.773,10.067C4.073,9.239 3.651,8.169 3.651,7V1H5.151ZM7.019,9.942C7.438,10.14 7.907,10.25 8.401,10.25C10.196,10.25 11.651,8.795 11.651,7V5.311L7.019,9.942Z"
+      android:fillColor="#43474D"
+      android:fillType="evenOdd"/>
+</vector>

+ 25 - 0
ComPDFKit_Tools/src/main/res/layout/tools_edit_text_property_fragment.xml

@@ -138,19 +138,44 @@
                 android:background="@drawable/tools_annotation_font_alignment_bg"
                 android:button="@null"
                 android:padding="8dp"
+                android:foreground="@drawable/tools_common_btn_rectangle_ripple"
                 android:textSize="0sp"
                 app:tint="@color/tools_font_style_iv_color"
                 app:srcCompat="@drawable/tools_edit_text_style_underline" />
 
+
+            <androidx.appcompat.widget.AppCompatImageView
+                android:id="@+id/iv_style_remove_underline"
+                android:layout_width="49dp"
+                android:layout_height="32dp"
+                android:background="@drawable/tools_annotation_font_alignment_bg"
+                android:button="@null"
+                android:padding="8dp"
+                android:foreground="@drawable/tools_common_btn_rectangle_ripple"
+                android:textSize="0sp"
+                app:tint="@color/tools_font_style_iv_color"
+                app:srcCompat="@drawable/tools_edit_text_style_remove_underline" />
+
             <androidx.appcompat.widget.AppCompatImageView
                 android:id="@+id/iv_style_strike_line"
                 android:layout_width="49dp"
                 android:layout_height="32dp"
+                android:foreground="@drawable/tools_common_btn_rectangle_ripple"
                 android:background="@drawable/tools_annotation_font_alignment_bg"
                 android:padding="8dp"
                 app:tint="@color/tools_font_style_iv_color"
                 app:srcCompat="@drawable/tools_edit_text_style_strike_line" />
 
+            <androidx.appcompat.widget.AppCompatImageView
+                android:id="@+id/iv_style_remove_strike_line"
+                android:layout_width="49dp"
+                android:layout_height="32dp"
+                android:foreground="@drawable/tools_common_btn_rectangle_ripple"
+                android:background="@drawable/tools_annotation_font_alignment_bg"
+                android:padding="8dp"
+                app:tint="@color/tools_font_style_iv_color"
+                app:srcCompat="@drawable/tools_edit_text_style_remove_strike_line" />
+
         </LinearLayout>
 
 

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

@@ -101,7 +101,7 @@
                 >
 
                 <androidx.appcompat.widget.AppCompatSpinner
-                    android:id="@+id/spinner_shape_style"
+                    android:id="@+id/spinner_bord_effect_type"
                     android:layout_width="72dp"
                     android:layout_height="28dp"
                     android:spinnerMode="dropdown"

+ 1 - 1
ComPDFKit_Tools/src/main/res/layout/tools_spinner_list_image_item.xml

@@ -13,7 +13,7 @@
         android:layout_height="48dp"
         android:gravity="center_vertical"
         android:layout_marginEnd="16dp"
-        app:srcCompat="@drawable/tools_line_type_straight_line"
+        app:srcCompat="@drawable/tools_bord_effect_type_solid"
         android:padding="8dp"
         />