+
+ private fun updateLayout(urlString: String) {
+ if (urlString.startsWith("content://")) { // This is a content URL.
+ // Hide the unused text views.
+ requestHeadersTitleTextView.visibility = View.GONE
+ requestHeadersTextView.visibility = View.GONE
+ responseMessageTitleTextView.visibility = View.GONE
+ responseMessageTextView.visibility = View.GONE
+
+ // Change the text of the remaining title text views.
+ responseHeadersTitleTextView.setText(R.string.content_metadata)
+ responseBodyTitleTextView.setText(R.string.content_data)
+ } else { // This is not a content URL.
+ // Show the views.
+ requestHeadersTitleTextView.visibility = View.VISIBLE
+ requestHeadersTextView.visibility = View.VISIBLE
+ responseMessageTitleTextView.visibility = View.VISIBLE
+ responseMessageTextView.visibility = View.VISIBLE
+
+ // Restore the text of the other title text views.
+ responseHeadersTitleTextView.setText(R.string.response_headers)
+ responseBodyTitleTextView.setText(R.string.response_body)
+ }
+ }