Browse Source

Improved view of certificate details for SSL dialog based on SslCertificate

David A. Velasco 11 years ago
parent
commit
a2be11ad54

+ 1 - 1
res/layout/ssl_untrusted_cert_layout.xml

@@ -46,7 +46,7 @@
         android:id="@+id/untrusted_details_scroll"
         android:visibility="gone" 
     	android:padding="20dp"
-        android:layout_width="wrap_content"
+        android:layout_width="match_parent"
         android:layout_height="180dp">
         
 		<LinearLayout 

+ 17 - 2
src/com/owncloud/android/ui/dialog/SslUntrustedCertDialogForEmptySslError.java

@@ -179,7 +179,7 @@ public class SslUntrustedCertDialogForEmptySslError extends SslUntrustedCertDial
             showSubject(cert.getIssuedTo());
             showIssuer(cert.getIssuedBy());
             showValidity(cert.getValidNotBeforeDate(), cert.getValidNotAfterDate());
-            // TODO showSignatureNotAvailabe/Provided
+            hideSignature();
             
         } else {
             nullCerView.setVisibility(View.VISIBLE);
@@ -207,10 +207,14 @@ public class SslUntrustedCertDialogForEmptySslError extends SslUntrustedCertDial
         TextView ouView = ((TextView)mView.findViewById(R.id.untrusted_value_subject_OU));
         ouView.setText(subject.getUName());
         ouView.setVisibility(View.VISIBLE);
-        
+
+        // SslCertificates don't offer this information
         ((TextView)mView.findViewById(R.id.untrusted_value_subject_C)).setVisibility(View.GONE);
         ((TextView)mView.findViewById(R.id.untrusted_value_subject_ST)).setVisibility(View.GONE);
         ((TextView)mView.findViewById(R.id.untrusted_value_subject_L)).setVisibility(View.GONE);
+        ((TextView)mView.findViewById(R.id.untrusted_label_subject_C)).setVisibility(View.GONE);
+        ((TextView)mView.findViewById(R.id.untrusted_label_subject_ST)).setVisibility(View.GONE);
+        ((TextView)mView.findViewById(R.id.untrusted_label_subject_L)).setVisibility(View.GONE);
     }
     
     
@@ -227,9 +231,20 @@ public class SslUntrustedCertDialogForEmptySslError extends SslUntrustedCertDial
         ouView.setText(issuer.getUName());
         ouView.setVisibility(View.VISIBLE);
         
+        // SslCertificates don't offer this information
         ((TextView)mView.findViewById(R.id.untrusted_value_issuer_C)).setVisibility(View.GONE);
         ((TextView)mView.findViewById(R.id.untrusted_value_issuer_ST)).setVisibility(View.GONE);
         ((TextView)mView.findViewById(R.id.untrusted_value_issuer_L)).setVisibility(View.GONE);
+        ((TextView)mView.findViewById(R.id.untrusted_label_issuer_C)).setVisibility(View.GONE);
+        ((TextView)mView.findViewById(R.id.untrusted_label_issuer_ST)).setVisibility(View.GONE);
+        ((TextView)mView.findViewById(R.id.untrusted_label_issuer_L)).setVisibility(View.GONE);
     }
     
+    private void hideSignature() {
+        ((TextView)mView.findViewById(R.id.untrusted_label_signature)).setVisibility(View.GONE);
+        ((TextView)mView.findViewById(R.id.untrusted_label_signature_algorithm)).setVisibility(View.GONE);
+        ((TextView)mView.findViewById(R.id.untrusted_value_signature_algorithm)).setVisibility(View.GONE);
+        ((TextView)mView.findViewById(R.id.untrusted_value_signature)).setVisibility(View.GONE);
+    }
+
 }