]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/commitdiff
Fix the width of urlTextBox, lower the height of the AppBar to 53dp, and increase...
authorSoren Stoutner <soren@stoutner.com>
Wed, 17 Feb 2016 18:19:12 +0000 (11:19 -0700)
committerSoren Stoutner <soren@stoutner.com>
Wed, 17 Feb 2016 18:19:12 +0000 (11:19 -0700)
app/app.iml
app/src/main/res/layout/url_bar.xml
app/src/main/res/values/styles.xml

index 90cf5debe731258d33acc3f7aab1af5faed74be2..c752c86a839ede0fad62db22af07b24cef1aed9f 100644 (file)
@@ -67,7 +67,9 @@
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/debug" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/jars" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.1/jars" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/resources" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/tmp" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
       <excludeFolder url="file://$MODULE_DIR$/build/outputs" />
       <excludeFolder url="file://$MODULE_DIR$/build/tmp" />
index e912cf2b62178e680bdf967e5fcf15541d7bc652..2363375bf0a0c087825f949375dbee9e04fcc958 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 
 <!--
-  Copyright 2015 Soren Stoutner <soren@stoutner.com>.
+  Copyright 2015-2016 Soren Stoutner <soren@stoutner.com>.
 
   This file is part of Privacy Browser <https://privacybrowser.stoutner.com/>.
 
     android:layout_width="match_parent"
     android:layout_height="wrap_content">
 
-    <LinearLayout
-        android:id="@+id/addressBarLinearLayout"
+    <RelativeLayout
+        android:id="@+id/addressBarRelativeLayout"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:orientation="horizontal" >
+        android:layout_height="wrap_content">
 
         <!-- Set the program icon as the initial favoriteIcon. -->
+        <!-- layout_width and layout_height of 28dp matches the appBar icons. -->
         <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:layout_width="28dp"
+            android:layout_height="28dp"
+            android:layout_centerVertical="true"
             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. -->
-        <!-- For some reason, android:layout_weight="1" doesdn't makes urlTextBox take up all the remaining space when it is inside a SupportActionBar.
-            layout_width="2000" is less elegant, but it does the trick. -->
+        <!-- android:layout_toEndOf requires API >= 17, but is compatible with right-to-left layouts.  android:layout_toRightOf is required for previous APIs. -->
         <EditText
             android:id="@+id/urlTextBox"
-            android:layout_width="2000dp"
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
+            android:layout_toEndOf="@id/favoriteIcon"
+            android:layout_toRightOf="@id/favoriteIcon"
             android:imeOptions="actionGo"
             android:inputType="textUri" />
-    </LinearLayout>
+    </RelativeLayout>
 
     <!-- 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. -->
index 2c1e1c94b0b0b254bdad088b5c0ea601062e4dc4..a68cd81e1aef02258837ede585f57e0098cb91a0 100644 (file)
 <resources>
 
     <!-- We want to use .NoActionBar so that we can set a SupportActionBar. -->
+    <!-- android:actionBarSize is supported by API >= 11.  actionBarSize is for older versions. -->
+    <!-- The default actionBarSize is 56dp.  53dp is the smallest that doesn't cause the urlTextBox to scroll vertically with a font size of Huge. -->
     <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
         <item name="colorAccent">@color/light_blue</item>
+        <item name="android:actionBarSize">53dp</item>
+        <item name="actionBarSize">53dp</item>
     </style>
 
 </resources>