]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/res/layout/view_source_coordinatorlayout.xml
Handle content:// URLs in View Source. https://redmine.stoutner.com/issues/361
[PrivacyBrowserAndroid.git] / app / src / main / res / layout / view_source_coordinatorlayout.xml
index 71a7667631dba3309cbd14b1c996ee34267dfad6..5fd4566ce733ab8ed9f42d16f6821be389aff7a1 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 
 <!--
-  Copyright © 2017-2018 Soren Stoutner <soren@stoutner.com>.
+  Copyright © 2017-2021 Soren Stoutner <soren@stoutner.com>.
 
   This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
 
   You should have received a copy of the GNU General Public License
   along with Privacy Browser.  If not, see <http://www.gnu.org/licenses/>. -->
 
-<!-- `android:fitsSystemWindows="true"` moves the AppBar below the status bar.  When it is specified the theme should include `<item name="android:windowTranslucentStatus">true</item>` to make the status bar a transparent, darkened overlay.
-    Setting the layout root to be `focusableInTouchMode` prevents the URL toolbar from stealing focus on launch and opening the keyboard. -->
-<android.support.design.widget.CoordinatorLayout
+<!-- 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"
-    tools:context="com.stoutner.privacybrowser.activities.ViewSourceActivity"
     android:layout_height="match_parent"
     android:layout_width="match_parent"
-    android:fitsSystemWindows="true"
     android:focusable="true"
     android:focusableInTouchMode="true" >
 
-    <!-- The `LinearLayout` with `orientation="vertical"` moves the content below the app bar layout. -->
+    <!-- The linear layout with `orientation="vertical"` moves the content below the app bar layout. -->
     <LinearLayout
         android:layout_height="match_parent"
         android:layout_width="match_parent"
         android:orientation="vertical" >
 
-        <!-- The `AppBarLayout` theme has to be defined here because the activity uses a `NoActionBar` theme. -->
-        <android.support.design.widget.AppBarLayout
+        <!-- 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:theme="@style/PrivacyBrowserAppBarLight" >
+            android:background="?android:attr/colorBackground"
+            android:theme="@style/PrivacyBrowserAppBar" >
 
-            <!-- The `FrameLayout` allows the toolbar and the progress bar to occupy the same space. -->
+            <!-- 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" >
 
-                <android.support.v7.widget.Toolbar
+                <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. -->
+                <!-- 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_width="match_parent"
                     android:minHeight="3dp"
                     android:layout_gravity="bottom"
-                    android:progressTint="?attr/progressTintColor"
-                    android:progressBackgroundTint="@color/transparent"
                     android:visibility="gone"
                     tools:ignore="UnusedAttribute" />
             </FrameLayout>
-        </android.support.design.widget.AppBarLayout>
+        </com.google.android.material.appbar.AppBarLayout>
 
-        <ScrollView
-            android:layout_height="wrap_content"
-            android:layout_width="match_parent" >
+        <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
+            android:id="@+id/view_source_swiperefreshlayout"
+            android:layout_height="match_parent"
+            android:layout_width="match_parent">
 
-            <LinearLayout
+            <ScrollView
+                android:id="@+id/view_source_scrollview"
                 android:layout_height="wrap_content"
-                android:layout_width="match_parent"
-                android:orientation="vertical"
-                android:layout_margin="10dp" >
-
-                <!-- Request headers. -->
-                <TextView
-                    android:layout_height="wrap_content"
-                    android:layout_width="match_parent"
-                    android:text="@string/request_headers"
-                    android:textAlignment="center"
-                    android:textSize="18sp"
-                    android:textColor="@color/blue_600"
-                    android:textStyle="bold" />
-
-                <TextView
-                    android:id="@+id/request_headers"
-                    android:layout_height="wrap_content"
-                    android:layout_width="match_parent"
-                    android:textIsSelectable="true"
-                    android:layout_marginBottom="8dp" />
-
-                <!-- Response message. -->
-                <TextView
-                    android:layout_height="wrap_content"
-                    android:layout_width="match_parent"
-                    android:text="@string/response_message"
-                    android:textAlignment="center"
-                    android:textSize="18sp"
-                    android:textColor="@color/blue_600"
-                    android:textStyle="bold" />
-
-                <TextView
-                    android:id="@+id/response_message"
-                    android:layout_height="wrap_content"
-                    android:layout_width="match_parent"
-                    android:textIsSelectable="true"
-                    android:layout_marginBottom="8dp" />
-
-                <!-- Response headers. -->
-                <TextView
-                    android:layout_height="wrap_content"
-                    android:layout_width="match_parent"
-                    android:text="@string/response_headers"
-                    android:textAlignment="center"
-                    android:textSize="18sp"
-                    android:textColor="@color/blue_600"
-                    android:textStyle="bold" />
-
-                <TextView
-                    android:id="@+id/response_headers"
-                    android:layout_height="wrap_content"
-                    android:layout_width="match_parent"
-                    android:textIsSelectable="true"
-                    android:layout_marginBottom="8dp" />
+                android:layout_width="match_parent" >
 
-                <!-- Response body. -->
-                <TextView
-                    android:layout_height="wrap_content"
-                    android:layout_width="match_parent"
-                    android:text="@string/response_body"
-                    android:textAlignment="center"
-                    android:textSize="18sp"
-                    android:textColor="@color/blue_600"
-                    android:textStyle="bold" />
-
-                <TextView
-                    android:id="@+id/response_body"
+                <LinearLayout
                     android:layout_height="wrap_content"
                     android:layout_width="match_parent"
-                    android:textIsSelectable="true" />
-            </LinearLayout>
-        </ScrollView>
+                    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>
     </LinearLayout>
-</android.support.design.widget.CoordinatorLayout>
\ No newline at end of file
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file