Prechádzať zdrojové kódy

PDFTools(Android) - 1.Form Bug修复

liuxiaolong 1 rok pred
rodič
commit
557585d09d
22 zmenil súbory, kde vykonal 207 pridanie a 135 odobranie
  1. BIN
      compdfkit-repo/compdfkit-ui/ComPDFKit-UI.aar
  2. BIN
      compdfkit-repo/compdfkit/ComPDFKit.aar
  3. 10 0
      compdfkit-tools/src/main/java/com/compdfkit/tools/annotation/pdfproperties/pdfstyle/CPDFGlobalAnnotStyle.java
  4. 1 0
      compdfkit-tools/src/main/java/com/compdfkit/tools/common/activity/CBasicActivity.java
  5. 2 0
      compdfkit-tools/src/main/java/com/compdfkit/tools/common/contextmenu/impl/CLinkContextMenuView.java
  6. 23 0
      compdfkit-tools/src/main/java/com/compdfkit/tools/common/utils/UriUtil.java
  7. 4 0
      compdfkit-tools/src/main/java/com/compdfkit/tools/common/views/CPageEditBar.java
  8. 16 6
      compdfkit-tools/src/main/java/com/compdfkit/tools/common/views/pdfpageedit/CInsertBlankPageDialogFragment.java
  9. 49 42
      compdfkit-tools/src/main/java/com/compdfkit/tools/common/views/pdfpageedit/CInsertPdfPageDialogFragment.java
  10. 43 43
      compdfkit-tools/src/main/java/com/compdfkit/tools/common/views/pdfpageedit/CPDFPageEditDialogFragment.java
  11. 13 0
      compdfkit-tools/src/main/java/com/compdfkit/tools/common/views/pdfstyle/manager/CStyleManager.java
  12. 1 0
      compdfkit-tools/src/main/java/com/compdfkit/tools/form/pdfproperties/pdftextfield/CTextFieldStyleFragment.java
  13. 6 3
      compdfkit-tools/src/main/java/com/compdfkit/tools/viewer/pdfthumbnail/CPDFEditThumbnailFragment.java
  14. 5 11
      compdfkit-tools/src/main/java/com/compdfkit/tools/viewer/pdfthumbnail/adpater/CPDFEditThumbnailListAdapter.java
  15. 2 2
      compdfkit-tools/src/main/res/layout/tools_page_edit_bar.xml
  16. 2 1
      compdfkit-tools/src/main/res/layout/tools_pageedit_insert_blank_page_dialog_fragment.xml
  17. 2 2
      compdfkit-tools/src/main/res/layout/tools_pageedit_insert_dialog_fragment.xml
  18. 6 4
      compdfkit-tools/src/main/res/layout/tools_pageedit_insert_pdf_page_dialog_fragment.xml
  19. 1 0
      compdfkit-tools/src/main/res/values/tools_attrs.xml
  20. 20 17
      compdfkit-tools/src/main/res/values/tools_strings.xml
  21. 0 1
      form-ctrl-demo/src/main/java/com/compdfkit/demo/form/PDFFormSampleActivity.java
  22. 1 3
      pageedit-ctrl-demo/src/main/java/com/compdfkit/demo/pageedit/MainActivity.java

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


BIN
compdfkit-repo/compdfkit/ComPDFKit.aar


+ 10 - 0
compdfkit-tools/src/main/java/com/compdfkit/tools/annotation/pdfproperties/pdfstyle/CPDFGlobalAnnotStyle.java

@@ -13,12 +13,14 @@ package com.compdfkit.tools.annotation.pdfproperties.pdfstyle;
 import static com.compdfkit.tools.common.views.pdfstyle.CStyleType.ANNOT_ARROW;
 import static com.compdfkit.tools.common.views.pdfstyle.CStyleType.ANNOT_LINE;
 
+import android.graphics.Color;
 import android.text.TextUtils;
 
 import com.compdfkit.core.annotation.CPDFFreetextAnnotation;
 import com.compdfkit.core.annotation.CPDFLineAnnotation;
 import com.compdfkit.core.annotation.CPDFTextAlignment;
 import com.compdfkit.core.annotation.CPDFTextAttribute;
+import com.compdfkit.core.annotation.form.CPDFWidget;
 import com.compdfkit.tools.common.views.pdfstyle.CAnnotStyle;
 import com.compdfkit.tools.common.views.pdfstyle.CBasicOnStyleChangeListener;
 import com.compdfkit.tools.common.views.pdfstyle.CStyleType;
@@ -43,6 +45,7 @@ import com.compdfkit.ui.attribute.form.CPDFComboboxAttr;
 import com.compdfkit.ui.attribute.form.CPDFListboxAttr;
 import com.compdfkit.ui.attribute.form.CPDFPushButtonAttr;
 import com.compdfkit.ui.attribute.form.CPDFRadiobuttonAttr;
+import com.compdfkit.ui.attribute.form.CPDFSignatureWidgetAttr;
 import com.compdfkit.ui.attribute.form.CPDFTextfieldAttr;
 import com.compdfkit.ui.reader.CPDFReaderView;
 
@@ -265,6 +268,13 @@ public class CPDFGlobalAnnotStyle extends CBasicOnStyleChangeListener implements
                     pushButtonAttr.setFontSize(params.getFontSize());
                     pushButtonAttr.setButtonTitle(params.getFormDefaultValue());
                     break;
+                case FORM_SIGNATURE_FIELDS:
+                    CPDFSignatureWidgetAttr signatureWidgetAttr = attribute.getSignatureWidgetAttr();
+                    signatureWidgetAttr.setBorderWidth(params.getBorderWidth());
+                    signatureWidgetAttr.setBorderColor(params.getLineColor());
+                    signatureWidgetAttr.setBorderStyle(CPDFWidget.BorderStyle.BS_Solid);
+                    signatureWidgetAttr.setFillColor(params.getFillColor());
+                    break;
                 default:
                     break;
             }

+ 1 - 0
compdfkit-tools/src/main/java/com/compdfkit/tools/common/activity/CBasicActivity.java

@@ -127,6 +127,7 @@ public class CBasicActivity extends AppCompatActivity {
                 .setListBox(Color.TRANSPARENT, bgColor, Color.BLACK, 20, 2)
                 .setComboBox(Color.TRANSPARENT, bgColor, Color.BLACK, 20, 2)
                 .setPushButton(Color.BLACK, Color.WHITE, Color.BLACK, 20, 2, "Push Button")
+                .setFormSignature(Color.TRANSPARENT, bgColor, 0)
                 .init(pdfView);
     }
 

+ 2 - 0
compdfkit-tools/src/main/java/com/compdfkit/tools/common/contextmenu/impl/CLinkContextMenuView.java

@@ -65,6 +65,8 @@ public class CLinkContextMenuView implements ContextMenuLinkProvider {
             } else {
                 linkStyleDialogFragment = CActionEditDialogFragment.newInstanceWithUrl(pageCount, uri);
             }
+        } else {
+            linkStyleDialogFragment = CActionEditDialogFragment.newInstance(pageCount);
         }
         if (linkStyleDialogFragment == null) {
             return;

+ 23 - 0
compdfkit-tools/src/main/java/com/compdfkit/tools/common/utils/UriUtil.java

@@ -102,6 +102,29 @@ public class UriUtil {
         return null;
     }
 
+    public static String getUriFileName(Context context, Uri uri) {
+
+        Cursor cursor = null;
+        final String column = MediaStore.Files.FileColumns.DISPLAY_NAME;
+        final String[] projection = {column};
+
+        try {
+            cursor = context.getContentResolver().query(uri, projection,null,null,
+                    null);
+            if (cursor != null && cursor.moveToFirst()) {
+                final int column_index = cursor.getColumnIndexOrThrow(column);
+                return cursor.getString(column_index);
+            }
+        }catch (Exception e){
+
+        } finally {
+            if (cursor != null) {
+                cursor.close();
+            }
+        }
+        return "";
+    }
+
 
     public boolean isExternalStorageDocument(Uri uri) {
         return "com.android.externalstorage.documents".equals(uri.getAuthority());

+ 4 - 0
compdfkit-tools/src/main/java/com/compdfkit/tools/common/views/CPageEditBar.java

@@ -77,9 +77,13 @@ public class CPageEditBar extends FrameLayout implements View.OnClickListener{
         TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.CPageEditBar);
         if (typedArray != null) {
             String toolBarTitle = typedArray.getString(R.styleable.CPageEditBar_android_title);
+            String doneTitle = typedArray.getString(R.styleable.CPageEditBar_tools_done_title);
             if (!TextUtils.isEmpty(toolBarTitle)) {
                 tvToolBarTitle.setText(toolBarTitle);
             }
+            if (!TextUtils.isEmpty(doneTitle)) {
+                tvToolBarDone.setText(doneTitle);
+            }
             Drawable backIconDrawable = CViewUtils.loadDrawableFromAttributes(getContext(), typedArray, R.styleable.CPageEditBar_tools_pageeditbar_back_icon, R.drawable.tools_ic_back);
             if (backIconDrawable != null) {
                 ivToolBarBackBtn.setImageDrawable(backIconDrawable);

+ 16 - 6
compdfkit-tools/src/main/java/com/compdfkit/tools/common/views/pdfpageedit/CInsertBlankPageDialogFragment.java

@@ -18,6 +18,7 @@ import androidx.constraintlayout.widget.ConstraintLayout;
 
 import com.compdfkit.core.document.CPDFDocument;
 import com.compdfkit.tools.R;
+import com.compdfkit.tools.common.utils.CToastUtil;
 import com.compdfkit.tools.common.utils.dialog.CDialogFragmentUtil;
 import com.compdfkit.tools.common.utils.threadpools.CThreadPoolUtils;
 import com.compdfkit.tools.common.utils.viewutils.CDimensUtils;
@@ -64,8 +65,11 @@ public class CInsertBlankPageDialogFragment extends BottomSheetDialogFragment im
         super.onStart();
         if (!CViewUtils.isLandScape(getContext())){
             CDialogFragmentUtil.setDimAmount(getDialog(), 0F);
+        }else {
+            CDialogFragmentUtil.setDimAmount(getDialog(), 0.2F);
         }
         BottomSheetBehavior<View> behavior = BottomSheetBehavior.from((View) getView().getParent());
+        behavior.setDraggable(false);
         CDialogFragmentUtil.setBottomSheetDialogFragmentFullScreen(getDialog(), behavior);
     }
 
@@ -104,10 +108,7 @@ public class CInsertBlankPageDialogFragment extends BottomSheetDialogFragment im
         toolBar.setBackBtnClickListener(v -> dismiss());
         toolBar.setOnDoneClickCallback(() -> CThreadPoolUtils.getInstance().execute(() -> {
             insertBlankPage();
-            dismiss();
-            if (onEditDoneCallback != null) {
-                onEditDoneCallback.onEditDone();
-            }
+
         }));
         toolBar.setTitle(R.string.tools_page_edit_insert_page_blank);
         toolBar.showEditButton(false);
@@ -138,7 +139,7 @@ public class CInsertBlankPageDialogFragment extends BottomSheetDialogFragment im
         if (rbHomePage.isChecked()) {
             pageIndex = 0;
         } else if (rbLastPage.isChecked()) {
-            pageIndex = pdfView.getCPdfReaderView().getPDFDocument().getPageCount();
+            pageIndex = document.getPageCount();
         } else {
             if (!TextUtils.isEmpty(pageStr)) {
                 try {
@@ -153,7 +154,12 @@ public class CInsertBlankPageDialogFragment extends BottomSheetDialogFragment im
                 }
             }
         }
-
+        int pageCount = document.getPageCount();
+        if (pageIndex > pageCount){
+            CToastUtil.showLongToast(getContext(), R.string.tools_page_choose_skip_input_error);
+            return;
+        }
+        CViewUtils.hideKeyboard(etInputPageIndex);
         String pageSize = "";
         for (int i = 0; i < rgPagesize.getChildCount(); i++) {
             if (((RadioButton)rgPagesize.getChildAt(i)).isChecked()) {
@@ -171,6 +177,10 @@ public class CInsertBlankPageDialogFragment extends BottomSheetDialogFragment im
                 } else {
                     document.insertBlankPage(pageIndex, width, height);
                 }
+                dismiss();
+                if (onEditDoneCallback != null) {
+                    onEditDoneCallback.onEditDone();
+                }
             }
         }
     }

+ 49 - 42
compdfkit-tools/src/main/java/com/compdfkit/tools/common/views/pdfpageedit/CInsertPdfPageDialogFragment.java

@@ -6,6 +6,8 @@ import static com.compdfkit.core.document.CPDFDocument.PDFDocumentError.PDFDocum
 import android.content.Intent;
 import android.net.Uri;
 import android.os.Bundle;
+import android.text.InputFilter;
+import android.text.Spanned;
 import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -25,6 +27,8 @@ import androidx.fragment.app.FragmentActivity;
 import com.compdfkit.core.document.CPDFDocument;
 import com.compdfkit.tools.R;
 import com.compdfkit.tools.common.utils.CFileUtils;
+import com.compdfkit.tools.common.utils.CToastUtil;
+import com.compdfkit.tools.common.utils.UriUtil;
 import com.compdfkit.tools.common.utils.dialog.CDialogFragmentUtil;
 import com.compdfkit.tools.common.utils.threadpools.CThreadPoolUtils;
 import com.compdfkit.tools.common.utils.viewutils.CViewUtils;
@@ -64,26 +68,30 @@ public class CInsertPdfPageDialogFragment extends BottomSheetDialogFragment impl
     private final String selectPageRegex = "^(\\d+)(-\\d+)?([,,](\\d+)(-\\d+)?)*$";
     private ActivityResultLauncher<Intent> selectDocumentLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> {
         if (result.getData() != null && result.getData().getData() != null) {
-            selectUri = result.getData().getData();
-            String path = selectUri.getPath();
-            String[] arr = path.split("/");
-            if (arr != null && arr.length > 0) {
-                tvFilename.setText(arr[arr.length - 1]);
-            }
-            CFileUtils.takeUriPermission(getContext(), selectUri);
-            selectDocument = new CPDFDocument(getContext());
-            CPDFDocument.PDFDocumentError pdfDocumentError = selectDocument.open(selectUri);
-            if (pdfDocumentError == PDFDocumentErrorSuccess) {
+            Uri fileUri = result.getData().getData();
+            CFileUtils.takeUriPermission(getContext(), fileUri);
 
+            CPDFDocument tempDocument = new CPDFDocument(getContext());
+            CPDFDocument.PDFDocumentError pdfDocumentError = tempDocument.open(fileUri);
+            if (pdfDocumentError == PDFDocumentErrorSuccess) {
+                String name = UriUtil.getUriFileName(getContext(), fileUri);
+                if (!TextUtils.isEmpty(name)) {
+                    tvFilename.setText(name);
+                }
+                selectUri = fileUri;
+                selectDocument = tempDocument;
             } else if (pdfDocumentError == PDFDocumentErrorPassword) {
                 CVerifyPasswordDialogFragment verifyPasswordDialogFragment;
-                verifyPasswordDialogFragment = CVerifyPasswordDialogFragment.newInstance(selectDocument, selectUri);
+                verifyPasswordDialogFragment = CVerifyPasswordDialogFragment.newInstance(tempDocument, fileUri);
                 verifyPasswordDialogFragment.setVerifyCompleteListener(document -> {
-
+                    String name = UriUtil.getUriFileName(getContext(), fileUri);
+                    if (!TextUtils.isEmpty(name)) {
+                        tvFilename.setText(name);
+                    }
+                    selectUri = fileUri;
+                    selectDocument = document;
                 });
-                if (getContext() instanceof FragmentActivity){
-                    verifyPasswordDialogFragment.show(((FragmentActivity) getContext()).getSupportFragmentManager(), "verifyPwdDialog");
-                }
+                verifyPasswordDialogFragment.show(getChildFragmentManager(), "verifyPwdDialog");
             }
         }
     });
@@ -125,7 +133,6 @@ public class CInsertPdfPageDialogFragment extends BottomSheetDialogFragment impl
         rbFromPageLocationEven = rootView.findViewById(R.id.rb_tools_edit_page_insert_location_from_even);
         rbFromPageLocationSpecify = rootView.findViewById(R.id.rb_tools_edit_page_insert_location_from_specify);
         etFromInputPageIndex = rootView.findViewById(R.id.et_tool_edit_page_from_enterpage);
-
         rbToPageLocationHome = rootView.findViewById(R.id.rb_tools_edit_page_insert_location_homepage);
         rbToPageLocationLast = rootView.findViewById(R.id.rb_tools_edit_page_insert_location_lastpage);
         rbToPageLocationBefore = rootView.findViewById(R.id.rb_tools_edit_page_insert_location_before);
@@ -142,31 +149,25 @@ public class CInsertPdfPageDialogFragment extends BottomSheetDialogFragment impl
         rbToPageLocationBefore.setOnClickListener(this);
         rbToPageLocationAfter.setOnClickListener(this);
 
-        etFromInputPageIndex.setOnFocusChangeListener(new View.OnFocusChangeListener() {
-            @Override
-            public void onFocusChange(View view, boolean b) {
-                if (b) {
-                    if (!rbFromPageLocationSpecify.isChecked()) {
-                        rbFromPageLocationSpecify.setChecked(true);
-                        CViewUtils.showKeyboard(etFromInputPageIndex);
-                    }
-                } else {
-                    CViewUtils.hideKeyboard(etFromInputPageIndex);
+        etFromInputPageIndex.setOnFocusChangeListener((view, b) -> {
+            if (b) {
+                if (!rbFromPageLocationSpecify.isChecked()) {
+                    rbFromPageLocationSpecify.setChecked(true);
+                    CViewUtils.showKeyboard(etFromInputPageIndex);
                 }
+            } else {
+                CViewUtils.hideKeyboard(etFromInputPageIndex);
             }
         });
 
-        etToInputPageIndex.setOnFocusChangeListener(new View.OnFocusChangeListener() {
-            @Override
-            public void onFocusChange(View view, boolean b) {
-                if (b) {
-                    if (rbToPageLocationHome.isChecked() || rbToPageLocationLast.isChecked()) {
-                        rbToPageLocationBefore.setChecked(true);
-                        CViewUtils.showKeyboard(etToInputPageIndex);
-                    }
-                } else {
-                    CViewUtils.hideKeyboard(etToInputPageIndex);
+        etToInputPageIndex.setOnFocusChangeListener((view, b) -> {
+            if (b) {
+                if (rbToPageLocationHome.isChecked() || rbToPageLocationLast.isChecked()) {
+                    rbToPageLocationBefore.setChecked(true);
+                    CViewUtils.showKeyboard(etToInputPageIndex);
                 }
+            } else {
+                CViewUtils.hideKeyboard(etToInputPageIndex);
             }
         });
 
@@ -182,14 +183,11 @@ public class CInsertPdfPageDialogFragment extends BottomSheetDialogFragment impl
                     format = m.matches();
                 }
                 if (!format) {
-                    Toast.makeText(getContext(), R.string.tools_page_edit_insert_page, Toast.LENGTH_SHORT).show();
+                    Toast.makeText(getContext(), R.string.tools_page_choose_skip_input_error, Toast.LENGTH_SHORT).show();
                 } else {
                     CThreadPoolUtils.getInstance().execute(() -> {
                         insertPdfPage();
-                        dismiss();
-                        if (onEditDoneCallback != null) {
-                            onEditDoneCallback.onEditDone();
-                        }
+
                     });
                 }
             }
@@ -282,7 +280,7 @@ public class CInsertPdfPageDialogFragment extends BottomSheetDialogFragment impl
             pageNums = getPageArr(etFromInputPageIndex.getText().toString());
         }
 
-        int insertPos = 1;
+        int insertPos = -1;
         if (rbToPageLocationHome.isChecked()) {
             insertPos = 0;
         } else if (rbToPageLocationLast.isChecked()) {
@@ -298,12 +296,21 @@ public class CInsertPdfPageDialogFragment extends BottomSheetDialogFragment impl
                 insertPos -= 1;
             }
         }
+        int pageCount = document.getPageCount();
+        if (insertPos > pageCount || insertPos <0){
+            CToastUtil.showLongToast(getContext(), R.string.tools_page_choose_skip_input_error);
+            return;
+        }
         if (pageNums != null && pageNums.length > 0 && insertPos >= 0) {
             document.importPages(selectDocument, pageNums, insertPos);
             insertPages = new int[pageNums.length];
             for (int i = insertPos; i <= pageNums.length + insertPos - 1; i++) {
                 insertPages[i - insertPos] = i;
             }
+            dismiss();
+            if (onEditDoneCallback != null) {
+                onEditDoneCallback.onEditDone();
+            }
         }
     }
 

+ 43 - 43
compdfkit-tools/src/main/java/com/compdfkit/tools/common/views/pdfpageedit/CPDFPageEditDialogFragment.java

@@ -12,7 +12,6 @@ package com.compdfkit.tools.common.views.pdfpageedit;
 import static com.compdfkit.core.document.CPDFDocument.PDFDocumentError.PDFDocumentErrorPassword;
 import static com.compdfkit.core.document.CPDFDocument.PDFDocumentError.PDFDocumentErrorSuccess;
 
-import android.content.DialogInterface;
 import android.content.Intent;
 import android.net.Uri;
 import android.os.Bundle;
@@ -63,7 +62,6 @@ public class CPDFPageEditDialogFragment extends BottomSheetDialogFragment {
     private OnBackLisener onBackLisener = null;
 
     private CPDFEditThumbnailFragment editThumbnailFragment;
-    private final int MAX_SPLIT_FILE_NAME = 3;
 
     private boolean hasEdit = false;
 
@@ -85,18 +83,18 @@ public class CPDFPageEditDialogFragment extends BottomSheetDialogFragment {
                 verifyPasswordDialogFragment.setVerifyCompleteListener(document -> {
                     replacePage(selectDocument);
                 });
-                if (getContext() instanceof FragmentActivity){
+                if (getContext() instanceof FragmentActivity) {
                     verifyPasswordDialogFragment.show(((FragmentActivity) getContext()).getSupportFragmentManager(), "verifyPwdDialog");
                 }
             }
         }
     });
 
-    public static CPDFPageEditDialogFragment newInstance(){
+    public static CPDFPageEditDialogFragment newInstance() {
         return new CPDFPageEditDialogFragment();
     }
 
-    public void initWithPDFView(CPDFViewCtrl pdfView){
+    public void initWithPDFView(CPDFViewCtrl pdfView) {
         this.pdfView = pdfView;
     }
 
@@ -113,12 +111,13 @@ public class CPDFPageEditDialogFragment extends BottomSheetDialogFragment {
     @Override
     public void onStart() {
         super.onStart();
-        if (!CViewUtils.isLandScape(getContext())){
+        if (!CViewUtils.isLandScape(getContext())) {
             CDialogFragmentUtil.setDimAmount(getDialog(), 0F);
-        }else {
+        } else {
             CDialogFragmentUtil.setDimAmount(getDialog(), 0.2F);
         }
         BottomSheetBehavior<View> behavior = BottomSheetBehavior.from((View) getView().getParent());
+        behavior.setDraggable(false);
         behavior.addBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
             @Override
             public void onStateChanged(@NonNull View bottomSheet, int newState) {
@@ -129,7 +128,8 @@ public class CPDFPageEditDialogFragment extends BottomSheetDialogFragment {
                             onBackLisener.onBack();
                         }
                         break;
-                    default:break;
+                    default:
+                        break;
                 }
             }
 
@@ -189,7 +189,7 @@ public class CPDFPageEditDialogFragment extends BottomSheetDialogFragment {
             }
         });
         toolBar.setOnSelectAllCallback((select) -> {
-                editThumbnailFragment.setSelectAll(select);
+            editThumbnailFragment.setSelectAll(select);
         });
         if (enterEdit) {
             toolBar.enterEditMode();
@@ -202,7 +202,7 @@ public class CPDFPageEditDialogFragment extends BottomSheetDialogFragment {
             if (pages.size() == 0) {
                 CAlertDialog dialog = CAlertDialog.newInstance(getContext().getResources().getString(R.string.tools_page_edit_alert_title),
                         getContext().getResources().getString(R.string.tools_page_edit_alert_content_nopage));
-                dialog.setConfirmClickListener((v)-> {
+                dialog.setConfirmClickListener((v) -> {
                     dialog.dismiss();
                 });
                 dialog.show(getChildFragmentManager(), "dialog");
@@ -215,7 +215,7 @@ public class CPDFPageEditDialogFragment extends BottomSheetDialogFragment {
             if (pages.size() == 0) {
                 CAlertDialog dialog = CAlertDialog.newInstance(getContext().getResources().getString(R.string.tools_page_edit_alert_title),
                         getContext().getResources().getString(R.string.tools_page_edit_alert_content_nopage));
-                dialog.setConfirmClickListener((v)-> {
+                dialog.setConfirmClickListener((v) -> {
                     dialog.dismiss();
                 });
                 dialog.show(getChildFragmentManager(), "dialog");
@@ -225,7 +225,7 @@ public class CPDFPageEditDialogFragment extends BottomSheetDialogFragment {
                     if (!TextUtils.isEmpty(path)) {
                         CFileUtils.shareFile(getContext(), getString(R.string.tools_share_to), "application/pdf", new File(path));
                     }
-                    String msg = TextUtils.isEmpty(path) ? getString(R.string.tools_page_edit_extract_fail) : (getString(R.string.tools_page_edit_extract_ok) + " : "+ path);
+                    String msg = TextUtils.isEmpty(path) ? getString(R.string.tools_page_edit_extract_fail) : (getString(R.string.tools_page_edit_extract_ok) + " : " + path);
                     Toast.makeText(getContext(), msg, Toast.LENGTH_LONG).show();
                 });
             }
@@ -235,7 +235,7 @@ public class CPDFPageEditDialogFragment extends BottomSheetDialogFragment {
             if (pages.size() == 0) {
                 CAlertDialog dialog = CAlertDialog.newInstance(getContext().getResources().getString(R.string.tools_page_edit_alert_title),
                         getContext().getResources().getString(R.string.tools_page_edit_alert_content_nopage));
-                dialog.setConfirmClickListener((v)-> {
+                dialog.setConfirmClickListener((v) -> {
                     dialog.dismiss();
                 });
                 dialog.show(getChildFragmentManager(), "dialog");
@@ -250,7 +250,7 @@ public class CPDFPageEditDialogFragment extends BottomSheetDialogFragment {
             if (pages.size() == 0) {
                 CAlertDialog dialog = CAlertDialog.newInstance(getContext().getResources().getString(R.string.tools_page_edit_alert_title),
                         getContext().getResources().getString(R.string.tools_page_edit_alert_content_nopage));
-                dialog.setConfirmClickListener((v)-> {
+                dialog.setConfirmClickListener((v) -> {
                     dialog.dismiss();
                 });
                 dialog.show(getChildFragmentManager(), "dialog");
@@ -263,7 +263,7 @@ public class CPDFPageEditDialogFragment extends BottomSheetDialogFragment {
             if (pages.size() == 0) {
                 CAlertDialog dialog = CAlertDialog.newInstance(getContext().getResources().getString(R.string.tools_page_edit_alert_title),
                         getContext().getResources().getString(R.string.tools_page_edit_alert_content_nopage));
-                dialog.setConfirmClickListener((v)-> {
+                dialog.setConfirmClickListener((v) -> {
                     dialog.dismiss();
                 });
                 dialog.show(getChildFragmentManager(), "dialog");
@@ -273,9 +273,9 @@ public class CPDFPageEditDialogFragment extends BottomSheetDialogFragment {
                 }
                 CPDFDocument document = pdfView.getCPdfReaderView().getPDFDocument();
                 if (pages.size() == document.getPageCount()) {
-                    CAlertDialog dialog = CAlertDialog.newInstance(getContext().getResources().getString(R.string.tools_page_edit_alert_title),
+                    CAlertDialog dialog = CAlertDialog.newInstance(getContext().getString(R.string.tools_warning),
                             getContext().getResources().getString(R.string.tools_page_edit_alert_content_allpage));
-                    dialog.setConfirmClickListener((v)-> {
+                    dialog.setConfirmClickListener((v) -> {
                         dialog.dismiss();
                     });
                     dialog.show(getChildFragmentManager(), "dialog");
@@ -287,7 +287,7 @@ public class CPDFPageEditDialogFragment extends BottomSheetDialogFragment {
             }
         });
         getDialog().setOnKeyListener((dialog, keyCode, event) -> {
-            if (keyCode == KeyEvent.KEYCODE_BACK){
+            if (keyCode == KeyEvent.KEYCODE_BACK) {
                 dismiss();
                 return true;
             }
@@ -343,7 +343,7 @@ public class CPDFPageEditDialogFragment extends BottomSheetDialogFragment {
         boolean res = false;
 
         int[] insertPageNum = new int[selectDocument.getPageCount()];
-        for (int i = 0; i < insertPageNum.length;i++) {
+        for (int i = 0; i < insertPageNum.length; i++) {
             insertPageNum[i] = i;
         }
 
@@ -420,12 +420,12 @@ public class CPDFPageEditDialogFragment extends BottomSheetDialogFragment {
 
         if (pageList.size() > 0) {
             for (int i = pageList.size() - 1; i >= 0; i--) {
-                document.addPage(pageList.get(i), pagesArr.keyAt(pagesArr.size() - 1)+1);
+                document.addPage(pageList.get(i), pagesArr.keyAt(pagesArr.size() - 1) + 1);
             }
 
             pdfView.getCPdfReaderView().reloadPages();
             int[] updatePags = new int[pagesArr.size()];
-            for (int i = 0; i < updatePags.length ;i++) {
+            for (int i = 0; i < updatePags.length; i++) {
                 updatePags[i] = i + pagesArr.keyAt(pagesArr.size() - 1) + 1;
             }
             editThumbnailFragment.setSelectPages(updatePags);
@@ -479,7 +479,6 @@ public class CPDFPageEditDialogFragment extends BottomSheetDialogFragment {
         }
         boolean res = document.removePages(pageNum);
         editThumbnailFragment.setSelectAll(false);
-
         editThumbnailFragment.updatePagesArr(pageNum, CPDFEditThumbnailFragment.updateTypeDelete);
         hasEdit = true;
         return res;
@@ -495,23 +494,19 @@ public class CPDFPageEditDialogFragment extends BottomSheetDialogFragment {
         return true;
     }
 
-    private String getNewFileName(int[] export_page) {
+    private String getNewFileName(int[] exportPages) {
         CPDFDocument document = pdfView.getCPdfReaderView().getPDFDocument();
         String fileName = document.getFileName();
         String newName = fileName.substring(0, fileName.indexOf(".pdf"));
-        if (export_page.length <= MAX_SPLIT_FILE_NAME) {
-            newName = newName + "_Page";
-            for (int i = 0; i < export_page.length; i++) {
-                if (i != 0) {
-                    newName = newName + "," + (export_page[i] + 1);
-                } else {
-                    newName = newName + (export_page[i] + 1);
-                }
+        newName = newName + "_Page";
+        for (int i = 0; i < exportPages.length; i++) {
+            if (i != 0) {
+                newName = newName + "," + (exportPages[i] + 1);
+            } else {
+                newName = newName + (exportPages[i] + 1);
             }
-            newName = newName + ".pdf";
-        } else {
-            newName = newName + "_Page" + (export_page[0]+1) + "," + (export_page[1]+1) + "," + (export_page[2]+1) + ",etc" + ".pdf";
         }
+        newName = newName + ".pdf";
         return newName;
     }
 
@@ -526,24 +521,29 @@ public class CPDFPageEditDialogFragment extends BottomSheetDialogFragment {
 
     @Override
     public void dismiss() {
+        if (checkPdfView()) {
+            CPDFReaderView readerView = pdfView.getCPdfReaderView();
+            if (hasEdit) {
+                readerView.reloadPages();
+                readerView.setDisplayPageIndex(pdfView.currentPageIndex);
+                int pageCount = readerView.getPDFDocument().getPageCount();
+                pdfView.slideBar.setPageCount(pageCount);
+                pdfView.slideBar.requestLayout();
+                pdfView.indicatorView.setTotalPage(pageCount);
+            }
+        }
         super.dismiss();
         if (onBackLisener != null) {
             onBackLisener.onBack();
-            if (checkPdfView()) {
-                CPDFReaderView readerView = pdfView.getCPdfReaderView();
-                if (hasEdit) {
-                    readerView.reloadPages();
-                    readerView.setDisplayPageIndex(pdfView.currentPageIndex);
-                }
-            }
         }
     }
 
     public void setHasEdit(boolean edit) {
         hasEdit = edit;
     }
-    public void setOnBackLisener(OnBackLisener lisener) {
-        this.onBackLisener = lisener;
+
+    public void setOnBackListener(OnBackLisener listener) {
+        this.onBackLisener = listener;
     }
 
     public interface OnBackLisener {

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

@@ -448,6 +448,19 @@ public class CStyleManager implements CAnnotStyle.OnAnnotStyleChangeListener {
             return this;
         }
 
+        public Builder setFormSignature(
+                @ColorInt int borderColor,
+                @ColorInt int fillColor,
+                 int borderWidth
+        ){
+            CAnnotStyle style = new CAnnotStyle(CStyleType.FORM_SIGNATURE_FIELDS);
+            style.setFillColor(fillColor);
+            style.setBorderColor(borderColor);
+            style.setBorderWidth(borderWidth);
+            attrSet.add(style);
+            return this;
+        }
+
 
         private CStyleManager create(CPDFViewCtrl pdfView, boolean onStore) {
             return new CStyleManager(new CPDFGlobalAnnotStyle(pdfView, onStore));

+ 1 - 0
compdfkit-tools/src/main/java/com/compdfkit/tools/form/pdfproperties/pdftextfield/CTextFieldStyleFragment.java

@@ -142,6 +142,7 @@ public class CTextFieldStyleFragment extends CBasicPropertiesFragment implements
             etDefaultValue.setText(annotStyle.getFormDefaultValue());
             switch (annotStyle.getAlignment()) {
                 case LEFT:
+                case UNKNOWN:
                     selectAlignmentView(ivAlignmentLeft);
                     break;
                 case CENTER:

+ 6 - 3
compdfkit-tools/src/main/java/com/compdfkit/tools/viewer/pdfthumbnail/CPDFEditThumbnailFragment.java

@@ -43,6 +43,7 @@ public class CPDFEditThumbnailFragment extends Fragment {
     private CPDFPageEditDialogFragment pageEditDialogFragment = null;
 
     public static final int updateTypeRotate = 1;
+
     public static final int updateTypeDelete = 2;
 
     /**
@@ -139,7 +140,9 @@ public class CPDFEditThumbnailFragment extends Fragment {
                         if (pageEditDialogFragment != null) {
                             pageEditDialogFragment.dismiss();
                         }
-                        pdfView.getCPdfReaderView().setDisplayPageIndex(position);
+                        if (displayPageIndexListener != null) {
+                            displayPageIndexListener.displayPage(position);
+                        }
                     }
                 }
             });
@@ -162,8 +165,8 @@ public class CPDFEditThumbnailFragment extends Fragment {
                     thumbnailListAdapter.notifyItemChanged(pages[i]);
                 }
             } else if (updateType == updateTypeDelete) {
-                for (int i = 0; i < pages.length; i++) {
-                    thumbnailListAdapter.notifyItemRemoved(pages[i]);
+                for (int length = pages.length - 1; length >= 0; length--) {
+                    thumbnailListAdapter.notifyItemRemoved(pages[length]);
                 }
             }
         }

+ 5 - 11
compdfkit-tools/src/main/java/com/compdfkit/tools/viewer/pdfthumbnail/adpater/CPDFEditThumbnailListAdapter.java

@@ -39,21 +39,20 @@ import java.util.List;
 
 public class CPDFEditThumbnailListAdapter extends RecyclerView.Adapter<CPDFEditThumbnailListAdapter.CPDFThumbnailItemViewHolder> implements CDefaultItemTouchHelpCallback.OnItemTouchCallbackListener{
     private CPDFDocument cPdfDocument;
-    private int totalPages = 0;
+
     private int currentPageIndex;
 
     private COnSetPDFDisplayPageIndexListener displayPageIndexListener;
 
     private boolean isEdit = false;
+
     private SparseIntArray selectArr = new SparseIntArray();
+
     private OnPageEditListener onPageEditListener = null;
 
     public CPDFEditThumbnailListAdapter(CPDFDocument cPdfDocument, int currentPageIndex) {
         this.cPdfDocument = cPdfDocument;
         this.currentPageIndex = currentPageIndex;
-        if (cPdfDocument != null) {
-            this.totalPages = cPdfDocument.getPageCount();
-        }
     }
 
     @NonNull
@@ -88,11 +87,6 @@ public class CPDFEditThumbnailListAdapter extends RecyclerView.Adapter<CPDFEditT
                 .transition(DrawableTransitionOptions.withCrossFade())
                 .into(ivThumbnail);
         holder.tvPageIndex.setText(String.valueOf(holder.getAdapterPosition() + 1));
-        holder.cardView.setOnClickListener(v -> {
-            if (displayPageIndexListener != null) {
-                displayPageIndexListener.displayPage(holder.getAdapterPosition());
-            }
-        });
         updateSelectStatus(holder);
     }
 
@@ -152,7 +146,7 @@ public class CPDFEditThumbnailListAdapter extends RecyclerView.Adapter<CPDFEditT
 
     public void setAllClick(RecyclerView recyclerView){
         if (isEdit) {
-            for (int i = 0; i < totalPages; i++) {
+            for (int i = 0; i < cPdfDocument.getPageCount(); i++) {
                 selectArr.put(i, 1);
                 RecyclerView.ViewHolder viewHolder = recyclerView.findViewHolderForAdapterPosition(i);
                 if (viewHolder != null) {
@@ -199,7 +193,7 @@ public class CPDFEditThumbnailListAdapter extends RecyclerView.Adapter<CPDFEditT
 
     @Override
     public void onSwiped(int adapterPosition) {
-        /****** do nothing ******/
+
     }
 
     @Override

+ 2 - 2
compdfkit-tools/src/main/res/layout/tools_page_edit_bar.xml

@@ -49,8 +49,8 @@
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
         android:background="@drawable/tools_style_editpage_bar_done_bg"
-        android:foreground="@drawable/tools_common_rect_ripple"
-        android:layout_marginRight="16dp"
+        android:foreground="@drawable/tools_common_btn_rectangle_ripple"
+        android:layout_marginEnd="16dp"
         tools:visibility="visible"
         android:text="@string/tools_page_edit_toolbar_done"/>
 

+ 2 - 1
compdfkit-tools/src/main/res/layout/tools_pageedit_insert_blank_page_dialog_fragment.xml

@@ -10,6 +10,7 @@
         android:layout_height="?android:attr/actionBarSize"
         android:elevation="4dp"
         app:layout_constraintEnd_toEndOf="parent"
+        app:tools_done_title="@string/tools_save"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toTopOf="parent"
         android:title="@string/tools_document_info" />
@@ -151,7 +152,7 @@
                     android:textColor="@color/tools_text_color_primary"
                     app:layout_constraintStart_toStartOf="parent"
                     app:layout_constraintTop_toTopOf="parent"
-                    android:text="@string/tools_page_edit_insert_page_pagelocation"
+                    android:text="@string/tools_page_edit_insert_page_insert_to"
                     />
                 <RadioGroup
                     android:id="@+id/rp_tools_edit_page_insertpage_location"

+ 2 - 2
compdfkit-tools/src/main/res/layout/tools_pageedit_insert_dialog_fragment.xml

@@ -19,7 +19,7 @@
             android:layout_height="wrap_content"
             app:layout_constraintTop_toTopOf="parent"
             app:layout_constraintBottom_toBottomOf="parent"
-            android:text="@string/tools_page_edit_insert_page_blank"
+            android:text="@string/tools_blank_page"
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintEnd_toEndOf="parent"
             android:textColor="@color/tools_editpage_insert_page_color"
@@ -50,7 +50,7 @@
             android:layout_height="wrap_content"
             app:layout_constraintTop_toTopOf="parent"
             app:layout_constraintBottom_toBottomOf="parent"
-            android:text="@string/tools_page_edit_insert_page_pdf"
+            android:text="@string/tools_pdf_page"
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintEnd_toEndOf="parent"
             android:textColor="@color/tools_editpage_insert_page_color"

+ 6 - 4
compdfkit-tools/src/main/res/layout/tools_pageedit_insert_pdf_page_dialog_fragment.xml

@@ -10,6 +10,7 @@
         android:layout_height="?android:attr/actionBarSize"
         android:elevation="4dp"
         android:title="@string/tools_document_info"
+        app:tools_done_title="@string/tools_save"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toTopOf="parent" />
@@ -60,7 +61,7 @@
                     android:id="@+id/iv_tool_insert_page_filename"
                     style="@style/tools_edit_page_insertpage_cursize_style"
                     android:singleLine="true"
-                    android:text="select a file"
+                    android:text="@string/tools_select_a_file"
                     android:textColor="@color/tools_text_color_primary"
                     app:layout_constraintBottom_toBottomOf="parent"
                     app:layout_constraintEnd_toStartOf="@+id/iv_tool_insert_page_right"
@@ -80,7 +81,7 @@
                     android:layout_width="wrap_content"
                     android:layout_height="@dimen/tools_pageedit_line_height"
                     android:gravity="center"
-                    android:text="@string/tools_page_edit_insert_page_pagelocation"
+                    android:text="@string/tools_page_edit_insert_page_range"
                     android:textColor="@color/tools_text_color_primary"
                     app:layout_constraintStart_toStartOf="parent"
                     app:layout_constraintTop_toTopOf="parent" />
@@ -131,7 +132,8 @@
                 android:layout_marginStart="16dp"
                 android:layout_marginEnd="16dp"
                 android:gravity="bottom"
-                android:hint="@string/tools_page_edit_insert_page_enterpage_tint"
+                android:inputType="textCapWords"
+                android:hint="@string/tools_e_g_page"
                 android:textSize="14sp" />
 
             <androidx.constraintlayout.widget.ConstraintLayout
@@ -145,7 +147,7 @@
                     android:layout_width="wrap_content"
                     android:layout_height="@dimen/tools_pageedit_line_height"
                     android:gravity="center"
-                    android:text="@string/tools_page_edit_insert_page_pagelocation"
+                    android:text="@string/tools_page_edit_insert_page_insert_to"
                     android:textColor="@color/tools_text_color_primary"
                     app:layout_constraintStart_toStartOf="parent"
                     app:layout_constraintTop_toTopOf="parent" />

+ 1 - 0
compdfkit-tools/src/main/res/values/tools_attrs.xml

@@ -79,6 +79,7 @@
 
     <declare-styleable name="CPageEditBar" tools:ignore="ResourceName">
         <attr name="android:title"/>
+        <attr name="tools_done_title" format="string"/>
         <attr name="tools_pageeditbar_back_icon" format="reference"/>
     </declare-styleable>
 

+ 20 - 17
compdfkit-tools/src/main/res/values/tools_strings.xml

@@ -187,7 +187,8 @@
         <item>0.75</item>
         <item>1</item>
     </string-array>
-
+    <string name="tools_blank_page">Blank Page</string>
+    <string name="tools_pdf_page">PDF Page</string>
     <string name="tools_edit_text_property_title">Text Properties</string>
     <string name="tools_context_menu_add_text">Add Text</string>
     <string name="tools_context_menu_add_image">Add Images</string>
@@ -248,27 +249,29 @@
     <string name="tools_options">Options</string>
     <!-- Form End!!!-->
 
-    <string name="tools_page_edit_toolbar_title">Page Edit</string>
+    <string name="tools_page_edit_toolbar_title">Document Editor</string>
     <string name="tools_page_edit_toolbar_done">Done</string>
     <string name="toolsf_page_edit_insert_page_blank">Insert blank page</string>
     <string name="tools_page_edit_insert_page_pdf">Insert PDF page</string>
     <string name="tools_page_edit_insert_page_pagesize">Page Size</string>
     <string name="tools_page_edit_insert_page_pagedirection">Page Direction</string>
-    <string name="tools_page_edit_insert_page_pagelocation">Page Location</string>
-    <string name="tools_page_edit_insert_page_home_page">Home Page</string>
+    <string name="tools_page_edit_insert_page_insert_to">Insert To</string>
+    <string name="tools_page_edit_insert_page_home_page">First Page</string>
     <string name="tools_page_edit_insert_page_last_page">Last Page</string>
-    <string name="tools_page_edit_insert_page_enterpage_tint">Please enter the page</string>
+    <string name="tools_page_edit_insert_page_enterpage_tint">Please Enter a Page</string>
     <string name="tools_page_edit_insert_page_filename">File Name</string>
-    <string name="tools_page_edit_insert_page_allpage">All page</string>
-    <string name="tools_page_edit_insert_page_oddpage">Odd page</string>
-    <string name="tools_page_edit_insert_page_evenpage">Even page</string>
-    <string name="tools_page_edit_insert_page_specifypage">Specify page</string>
-    <string name="tools_page_edit_insert_page_before">Insert before specified page</string>
-    <string name="tools_page_edit_insert_page_after">Insert after specified page</string>
+    <string name="tools_page_edit_insert_page_range">Page Range</string>
+    <string name="tools_page_edit_insert_page_allpage">All Pages</string>
+    <string name="tools_page_edit_insert_page_oddpage">Odd Pages Only</string>
+    <string name="tools_page_edit_insert_page_evenpage">Even Pages Only</string>
+    <string name="tools_page_edit_insert_page_specifypage">Custom Range</string>
+    <string name="tools_page_edit_insert_page_before">Insert Before Specified Page</string>
+    <string name="tools_page_edit_insert_page_after">Insert After Specified Page</string>
+    <string name="tools_e_g_page">e.g. 1,3-5,10</string>
     <string-array name="tools_page_edit_pagesize_name">
-        <item> A3 (842*1190)</item>
-        <item> A4 (595*842)</item>
-        <item> A5 (421*595)</item>
+        <item>A3 (297 * 420mm)</item>
+        <item>A4 (210 * 297mm)</item>
+        <item>A5 (148 * 210mm)</item>
     </string-array>
     <string-array name="tools_page_edit_pagesize_value">
         <item>842*1190</item>
@@ -283,12 +286,12 @@
     <string name="tools_page_edit_toolbar_rotate">Rotate</string>
     <string name="tools_page_edit_toolbar_delete">Delete</string>
     <string name="tools_page_edit_alert_title">Warning</string>
-    <string name="tools_page_edit_alert_content_allpage">Can not delete all pages.</string>
+    <string name="tools_page_edit_alert_content_allpage">Can not delete all pages. Please keep at least one page.</string>
     <string name="tools_page_edit_alert_content_nopage">No page is selected.</string>
-    <string name="tools_page_edit_alert_ok">OK</string>
-    <string name="tools_page_edit_alert_cancel">Cancel</string>
     <string name="tools_page_edit_extract_fail">Extract Fail</string>
     <string name="tools_page_edit_extract_ok">Extract OK</string>
     <string name="tools_page_edit_insert_page">Page Error</string>
+    <string name="tools_select_a_file">Select a File</string>
+    <string name="tools_page_choose_skip_input_error">The page range is invalid or out of range. Please enter the valid page.</string>
 
 </resources>

+ 0 - 1
form-ctrl-demo/src/main/java/com/compdfkit/demo/form/PDFFormSampleActivity.java

@@ -77,7 +77,6 @@ public class PDFFormSampleActivity extends CBasicActivity {
         Paint paint = new Paint();
         paint.setStyle(Paint.Style.FILL);
         paint.setColor(ContextCompat.getColor(this, R.color.tools_color_accent_50));
-
         binding.pdfView.getCPdfReaderView().setFormPreviewPaint(paint);
         binding.pdfView.getCPdfReaderView().setCurrentFocusedFormType(CPDFWidget.WidgetType.Widget_Unknown);
         binding.pdfView.getCPdfReaderView().setCurrentFocusedType(CPDFAnnotation.Type.WIDGET);

+ 1 - 3
pageedit-ctrl-demo/src/main/java/com/compdfkit/demo/pageedit/MainActivity.java

@@ -2,7 +2,6 @@ package com.compdfkit.demo.pageedit;
 
 import android.Manifest;
 import android.content.Intent;
-import android.graphics.Paint;
 import android.net.Uri;
 import android.os.Bundle;
 import android.view.View;
@@ -10,7 +9,6 @@ import android.view.View;
 import androidx.activity.result.ActivityResultLauncher;
 import androidx.activity.result.contract.ActivityResultContracts;
 import androidx.annotation.NonNull;
-import androidx.core.content.ContextCompat;
 
 import com.compdfkit.demo.pageedit.databinding.ActivityMainBinding;
 import com.compdfkit.tools.common.activity.CBasicActivity;
@@ -70,7 +68,7 @@ public class MainActivity extends CBasicActivity {
         } else {
             CPDFPageEditDialogFragment pageEditDialogFragment = CPDFPageEditDialogFragment.newInstance();
             pageEditDialogFragment.initWithPDFView(binding.pdfView);
-            pageEditDialogFragment.setOnBackLisener(() -> {
+            pageEditDialogFragment.setOnBackListener(() -> {
                 setPreviewMode(CPreviewMode.Viewer);
             });
             pageEditDialogFragment.show(getSupportFragmentManager(),"fff");