Ver código fonte

PDFTool(Android) - bug修复

liuxiaolong 1 ano atrás
pai
commit
cb5fe319e9

+ 5 - 1
PDFViewer/src/main/java/com/compdfkit/pdfviewer/MainActivity.java

@@ -253,7 +253,7 @@ public class MainActivity extends CBasicPDFActivity {
             } else {
                 curEditMode = CPDFEditPage.LoadUnknown;
             }
-            binding.pdfView.exitEditMode();
+//            binding.pdfView.exitEditMode();
             binding.pdfToolBar.setVisibility(View.GONE);
             binding.pdfSearchToolBar.setVisibility(View.VISIBLE);
             binding.pdfSearchToolBar.showKeyboard();
@@ -424,6 +424,9 @@ public class MainActivity extends CBasicPDFActivity {
 
             @Override
             public void onEndSearch() {
+                if (binding.pdfView.getCPdfReaderView().getViewMode() == CPDFReaderView.ViewMode.PDFEDIT) {
+                    binding.lockView.setVisibility(View.VISIBLE);
+                }
                 Fragment fragment = getSupportFragmentManager().findFragmentByTag("searchLoadingDialog");
                 if (fragment != null && fragment instanceof CLoadingDialog){
                     ((CLoadingDialog) fragment).dismiss();
@@ -437,6 +440,7 @@ public class MainActivity extends CBasicPDFActivity {
                     editManager.beginEdit(curEditMode);
                 }
             }
+            binding.lockView.setVisibility(View.GONE);
             binding.pdfToolBar.setVisibility(View.VISIBLE);
             binding.pdfSearchToolBar.setVisibility(View.GONE);
         });

+ 17 - 10
PDFViewer/src/main/res/layout/pdf_sample_activity.xml

@@ -62,12 +62,12 @@
         android:id="@+id/sign_status_view"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
+        android:visibility="gone"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@id/fl_tool"
-        android:visibility="gone"
-        tools:visibility="visible"
-        app:status="valid" />
+        app:status="valid"
+        tools:visibility="visible" />
 
     <FrameLayout
         android:id="@+id/fl_bottom_tool_bar"
@@ -80,30 +80,37 @@
         <com.compdfkit.tools.annotation.pdfannotationbar.CAnnotationToolbar
             android:id="@+id/annotation_tool_bar"
             android:layout_width="match_parent"
-            android:layout_height="?android:attr/actionBarSize"
-            />
+            android:layout_height="?android:attr/actionBarSize" />
 
         <com.compdfkit.tools.contenteditor.CEditToolbar
             android:id="@+id/edit_tool_bar"
             android:layout_width="match_parent"
-            android:layout_height="?android:attr/actionBarSize"
-            />
+            android:layout_height="?android:attr/actionBarSize" />
 
         <com.compdfkit.tools.forms.pdfformbar.CFormToolbar
             android:id="@+id/form_tool_bar"
             android:layout_width="match_parent"
             android:layout_height="?android:attr/actionBarSize"
-            android:visibility="gone"
-            />
+            android:visibility="gone" />
 
         <com.compdfkit.tools.signature.CSignatureToolBar
             android:id="@+id/signature_tool_bar"
             android:layout_width="match_parent"
-            android:visibility="gone"
             android:layout_height="?android:attr/actionBarSize"
+            android:visibility="gone"
             app:layout_constraintBottom_toBottomOf="parent" />
 
     </FrameLayout>
 
+    <View
+        android:id="@+id/lock_view"
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:clickable="true"
+        android:focusable="true"
+        android:visibility="gone"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/fl_tool" />
+
 
 </androidx.constraintlayout.widget.ConstraintLayout>