--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ Copyright © 2017-2021 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
+
+ Privacy Browser is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Privacy Browser is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Privacy Browser. If not, see <http://www.gnu.org/licenses/>. -->
+
+<!-- Setting the layout root to be `focusableInTouchMode` prevents the URL toolbar from stealing focus on launch and opening the keyboard. -->
+<androidx.coordinatorlayout.widget.CoordinatorLayout android:id="@+id/view_source_coordinatorlayout"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:focusable="true"
+ android:focusableInTouchMode="true"
+ xmlns:app="http://schemas.android.com/apk/res-auto">
+
+ <!-- The linear layout with `orientation="vertical"` keeps the content above the app bar layout. `app:layout_dodgeInsetEdges="bottom"` as a child of a coordinator layout moves the view above snackbars. -->
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ app:layout_dodgeInsetEdges="bottom" >
+
+ <!-- `android:layout_weight="1"` causes the swipe refresh layout to fill all the remaining space. -->
+ <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
+ android:id="@+id/view_source_swiperefreshlayout"
+ android:layout_height="0dp"
+ android:layout_width="match_parent"
+ android:layout_weight="1">
+
+ <ScrollView
+ android:id="@+id/view_source_scrollview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" >
+
+ <LinearLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ android:layout_margin="10dp" >
+
+ <!-- Request headers. -->
+ <TextView
+ android:id="@+id/request_headers_title_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:text="@string/request_headers"
+ android:textAlignment="center"
+ android:textSize="18sp"
+ android:textColor="?attr/blueTextColor"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/request_headers_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textIsSelectable="true"
+ android:layout_marginBottom="8dp" />
+
+ <!-- Response message. -->
+ <TextView
+ android:id="@+id/response_message_title_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:text="@string/response_message"
+ android:textAlignment="center"
+ android:textSize="18sp"
+ android:textColor="?attr/blueTextColor"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/response_message_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textIsSelectable="true"
+ android:layout_marginBottom="8dp" />
+
+ <!-- Response headers. -->
+ <!-- The title text is set programatically. -->
+ <TextView
+ android:id="@+id/response_headers_title_textivew"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textAlignment="center"
+ android:textSize="18sp"
+ android:textColor="?attr/blueTextColor"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/response_headers_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textIsSelectable="true"
+ android:layout_marginBottom="8dp" />
+
+ <!-- Response body. -->
+ <!-- The title text is set programatically. -->
+ <TextView
+ android:id="@+id/response_body_title_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textAlignment="center"
+ android:textSize="18sp"
+ android:textColor="?attr/blueTextColor"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/response_body_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:textIsSelectable="true" />
+ </LinearLayout>
+ </ScrollView>
+ </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
+
+ <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
+ <com.google.android.material.appbar.AppBarLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:background="?android:attr/colorBackground"
+ android:theme="@style/PrivacyBrowserAppBar" >
+
+ <!-- The frame layout allows the toolbar and the progress bar to occupy the same space. -->
+ <FrameLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" >
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/view_source_toolbar"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent" />
+
+ <!-- Android automatically uses a different, skinnier drawable with padding for indeterminate horizontal progress bars in API >= 21.
+ They make this very difficult to override. https://redmine.stoutner.com/issues/241
+ `tools:ignore="UnusedAttribute"` removes the lint warning about `progressTint` and `progressBackgroundTint` not applying to API < 21. -->
+ <ProgressBar
+ android:id="@+id/progress_bar"
+ style="?android:attr/progressBarStyleHorizontal"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:minHeight="3dp"
+ android:layout_gravity="bottom"
+ android:visibility="gone"
+ tools:ignore="UnusedAttribute" />
+ </FrameLayout>
+ </com.google.android.material.appbar.AppBarLayout>
+ </LinearLayout>
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file