]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/res/layout/url_bar.xml
Refactor the App Bar.
[PrivacyBrowserAndroid.git] / app / src / main / res / layout / url_bar.xml
diff --git a/app/src/main/res/layout/url_bar.xml b/app/src/main/res/layout/url_bar.xml
new file mode 100644 (file)
index 0000000..8ff3f3e
--- /dev/null
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+  Copyright 2015 Soren Stoutner <soren@stoutner.com>.
+
+  This file is part of Privacy Browser <https://privacybrowser.stoutner.com/>.
+
+  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/>. -->
+
+<!-- FrameLayout lets the ProgressBar float on top of urlTextBox. -->
+<FrameLayout
+    android:id="@+id/addressBarFrameLayout"
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
+
+    <LinearLayout
+        android:id="@+id/addressBarLinearLayout"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal" >
+
+        <!-- Set the program icon as the initial favoriteIcon. -->
+        <ImageView
+            android:id="@+id/favoriteIcon"
+            android:src="@drawable/ic_language_black_24dp"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center"
+            android:contentDescription="@string/favorite_icon"/>
+
+        <!-- android:imeOptions="actionGo" sets the keyboard to have a "go" key instead of a "new line" key. -->
+        <!-- android:inputType="textUri" disables spell check in the EditText and changes the "go" key from a check mark to an arrow. -->
+        <!-- android:layout_weight="1" makes urlTextBox take up all the remaining space. -->
+        <EditText
+            android:id="@+id/urlTextBox"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:layout_height="wrap_content"
+            android:imeOptions="actionGo"
+            android:inputType="textUri" />
+    </LinearLayout>
+
+    <!-- android:max changes the maximum ProgressBar value from 10000 to 100 to match progress percentage. -->
+    <!-- android:layout_height="2dp" works best for API 23 "Marshmallow", but "3dp" is required for visibility on API <= 22. -->
+    <ProgressBar
+        android:id="@+id/progressBar"
+        style="?android:attr/progressBarStyleHorizontal"
+        android:layout_width="fill_parent"
+        android:layout_height="3dp"
+        android:layout_gravity="bottom"
+        android:max="100"
+        android:progressTint="@color/light_blue"
+        android:progressBackgroundTint="@color/white"
+        android:visibility="gone" />
+</FrameLayout>
\ No newline at end of file