- // Setup the label.
- val securityPatchLabel = getString(R.string.security_patch)
-
- // Get the security patch version.
- val securityPatch = Build.VERSION.SECURITY_PATCH
-
- // Create a spannable string builder.
- val securityPatchStringBuilder = SpannableStringBuilder(securityPatchLabel + securityPatch)
-
- // Set the span to display the security patch version in blue.
- securityPatchStringBuilder.setSpan(blueColorSpan, securityPatchLabel.length, securityPatchStringBuilder.length, Spanned.SPAN_INCLUSIVE_INCLUSIVE)
-
- // Display the string in the text view.
- securityPatchTextView.text = securityPatchStringBuilder
-
- // Create the WebView provider label.
- val webViewProviderLabel = getString(R.string.webview_provider)
-
- // Get the current WebView package info.
- val webViewPackageInfo = WebViewCompat.getCurrentWebViewPackage(requireContext())!!
-
- // Get the WebView provider name.
- val webViewPackageName = webViewPackageInfo.packageName
-
- // Create the spannable string builder.
- val webViewProviderStringBuilder = SpannableStringBuilder(webViewProviderLabel + webViewPackageName)
-
- // Apply the coloration.
- webViewProviderStringBuilder.setSpan(blueColorSpan, webViewProviderLabel.length, webViewProviderStringBuilder.length, Spanned.SPAN_INCLUSIVE_INCLUSIVE)
-
- // Display the WebView provider.
- webViewProviderTextView.text = webViewProviderStringBuilder
-