Переглянути джерело

PDFTool(Android) - 1.优化数字签名验证交互

liuxiaolong 1 рік тому
батько
коміт
16944edfb1

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

@@ -243,7 +243,7 @@ public class CFileUtils {
 
     public static void shareFile(Context context, String title, String type, File file) {
         try {
-            Intent intent = new Intent(Intent.ACTION_VIEW);
+            Intent intent = new Intent(Intent.ACTION_SEND);
             intent.setDataAndType(getUriBySystem(context, file), type);
             intent.putExtra(Intent.EXTRA_SUBJECT, title);
             intent.putExtra(Intent.EXTRA_STREAM, getUriBySystem(context, file));
@@ -256,7 +256,7 @@ public class CFileUtils {
 
     public static void shareFile(Context context, String title, String type, Uri uri) {
         try {
-            Intent intent = new Intent(Intent.ACTION_VIEW);
+            Intent intent = new Intent(Intent.ACTION_SEND);
             intent.setDataAndType(uri, type);
             intent.putExtra(Intent.EXTRA_SUBJECT, title);
             intent.putExtra(Intent.EXTRA_STREAM, uri);

+ 0 - 3
ComPDFKit_Tools/src/main/java/com/compdfkit/tools/signature/info/CertAttrListAdapter.java

@@ -56,9 +56,6 @@ public class CertAttrListAdapter extends CBaseQuickAdapter<CPDFCertAttrDataItem,
         } else if (item.isCertTrustedType()) {
             holder.setChecked(R.id.cb_1, item.isCertIsTrusted());
             holder.setChecked(R.id.cb_2, item.isCertIsTrusted());
-            holder.setChecked(R.id.cb_3, item.isCertIsTrusted());
-            holder.setChecked(R.id.cb_4, item.isCertIsTrusted());
-            holder.setChecked(R.id.cb_5, item.isCertIsTrusted());
             holder.getView(R.id.btn_trusted).setVisibility(item.isCertIsTrusted() ? View.INVISIBLE : View.VISIBLE);
         } else {
             holder.setText(R.id.tv_attr_title, item.getTitle() + ":");

+ 9 - 58
ComPDFKit_Tools/src/main/res/layout/tools_sign_certificate_attributes_list_trusted_cert_item.xml

@@ -23,8 +23,9 @@
     <androidx.appcompat.widget.AppCompatCheckBox
         android:id="@+id/cb_1"
         android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginStart="16dp"
+        android:layout_height="30dp"
+        android:gravity="center_vertical"
+        android:layout_marginStart="24dp"
         android:layout_marginTop="8dp"
         android:focusable="false"
         android:clickable="false"
@@ -40,10 +41,11 @@
     <androidx.appcompat.widget.AppCompatCheckBox
         android:id="@+id/cb_2"
         android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginStart="16dp"
-        android:layout_marginTop="8dp"
+        android:layout_height="30dp"
+        android:gravity="center_vertical"
+        android:layout_marginStart="24dp"
         android:focusable="false"
+        android:layout_marginTop="8dp"
         android:clickable="false"
         android:button="@drawable/tools_ic_cert_trusted_checkbox_radio"
         android:paddingStart="8dp"
@@ -54,64 +56,13 @@
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@id/cb_1" />
 
-    <androidx.appcompat.widget.AppCompatCheckBox
-        android:id="@+id/cb_3"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginStart="16dp"
-        android:layout_marginTop="8dp"
-        android:focusable="false"
-        android:clickable="false"
-        android:button="@drawable/tools_ic_cert_trusted_checkbox_radio"
-        android:paddingStart="8dp"
-        android:text="@string/tools_trusted_3"
-        app:layout_constrainedWidth="true"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintHorizontal_bias="0"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@id/cb_2" />
-
-    <androidx.appcompat.widget.AppCompatCheckBox
-        android:id="@+id/cb_4"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginStart="16dp"
-        android:layout_marginTop="8dp"
-        android:focusable="false"
-        android:clickable="false"
-        android:button="@drawable/tools_ic_cert_trusted_checkbox_radio"
-        android:paddingStart="8dp"
-        android:text="@string/tools_trusted_4"
-        app:layout_constrainedWidth="true"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintHorizontal_bias="0"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@id/cb_3" />
-
-    <androidx.appcompat.widget.AppCompatCheckBox
-        android:id="@+id/cb_5"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginStart="16dp"
-        android:layout_marginTop="8dp"
-        android:focusable="false"
-        android:clickable="false"
-        android:button="@drawable/tools_ic_cert_trusted_checkbox_radio"
-        android:paddingStart="8dp"
-        android:text="@string/tools_trusted_5"
-        app:layout_constrainedWidth="true"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintHorizontal_bias="0"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@id/cb_4" />
-
 
     <androidx.appcompat.widget.AppCompatButton
         android:id="@+id/btn_trusted"
         android:layout_width="match_parent"
         android:layout_height="40dp"
         android:layout_marginHorizontal="16dp"
-        android:layout_marginTop="32dp"
+        android:layout_marginTop="24dp"
         android:layout_marginBottom="24dp"
         android:background="@drawable/tools_sign_cert_info_btn_bg"
         android:foreground="@drawable/tools_common_btn_corner_ripple"
@@ -124,7 +75,7 @@
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@id/cb_5"
+        app:layout_constraintTop_toBottomOf="@id/cb_2"
         app:layout_constraintVertical_bias="1" />
 
 

+ 5 - 0
DigitalSignature/src/main/java/com/compdfkit/digitalsignature/PDFSignaturesSampleActivity.java

@@ -217,6 +217,11 @@ public class PDFSignaturesSampleActivity extends CBasicPDFActivity {
                     }
                 });
             });
+        } else {
+            if (binding.signStatusView.getVisibility() == View.VISIBLE) {
+                screenStatusManager.manager.removeToolView(binding.signStatusView);
+                screenStatusManager.manager.hideFromTop(binding.signStatusView, 200);
+            }
         }
     }