X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2FSslCertificateError.java;h=52826504de985fbe3584103b5d562a7988984c48;hp=80c9c1e71f86614cfd1165a10df142abaee39635;hb=e4e45c521ade9eb2f87a97eecffed7e852b09df7;hpb=757139ad59282fb8400bc641a4be574e0b88de49 diff --git a/app/src/main/java/com/stoutner/privacybrowser/SslCertificateError.java b/app/src/main/java/com/stoutner/privacybrowser/SslCertificateError.java index 80c9c1e7..52826504 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/SslCertificateError.java +++ b/app/src/main/java/com/stoutner/privacybrowser/SslCertificateError.java @@ -24,21 +24,15 @@ import android.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.content.DialogInterface; -import android.graphics.drawable.BitmapDrawable; -import android.graphics.drawable.Drawable; import android.net.http.SslCertificate; import android.net.http.SslError; import android.os.Bundle; -import android.support.v4.content.ContextCompat; -import android.text.SpannableString; import android.text.SpannableStringBuilder; import android.text.Spanned; import android.text.style.ForegroundColorSpan; import android.view.LayoutInflater; import android.widget.TextView; -import org.w3c.dom.Text; - import java.util.Date; public class SslCertificateError extends DialogFragment{ @@ -204,7 +198,7 @@ public class SslCertificateError extends DialogFragment{ String startDateLabel = getString(R.string.start_date) + " "; String endDateLabel = getString(R.string.end_date) + " "; - // Create a `SpannableStringBuilder` for each item. + // Create a `SpannableStringBuilder` for each `TextView` that needs multiple colors of text. SpannableStringBuilder urlStringBuilder = new SpannableStringBuilder(urlLabel + urlWithError); SpannableStringBuilder issuedToCNameStringBuilder = new SpannableStringBuilder(cNameLabel + issuedToCName); SpannableStringBuilder issuedToONameStringBuilder = new SpannableStringBuilder(oNameLabel + issuedToOName); @@ -218,8 +212,7 @@ public class SslCertificateError extends DialogFragment{ // Create a blue `ForegroundColorSpan`. We have to use the deprecated `getColor` until API >= 23. ForegroundColorSpan blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.blue)); - // Setup the spans to display the certificate information in blue. - // `SPAN_INCLUSIVE_INCLUSIVE` allows the span to grow in either direction. + // Setup the spans to display the certificate information in blue. `SPAN_INCLUSIVE_INCLUSIVE` allows the span to grow in either direction. urlStringBuilder.setSpan(blueColorSpan, urlLabel.length(), urlStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE); issuedToCNameStringBuilder.setSpan(blueColorSpan, cNameLabel.length(), issuedToCNameStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE); issuedToONameStringBuilder.setSpan(blueColorSpan, oNameLabel.length(), issuedToONameStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);