]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/res/layout/guide_coordinatorlayout.xml
Fix a crach when editing a bookmark in the bookmarks drawer. https://redmine.stoutne...
[PrivacyBrowserAndroid.git] / app / src / main / res / layout / guide_coordinatorlayout.xml
index 233da963618ace768acd18b5e3b6b2d0658cc39f..885ec2e317561997660c7931f1d468168d435b02 100644 (file)
 <android.support.design.widget.CoordinatorLayout
     android:id="@+id/guide_coordinatorlayout"
     xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_height="match_parent"
     android:layout_width="match_parent"
     android:fitsSystemWindows="true" >
 
-    <!-- the LinearLayout with orientation="vertical" moves the ViewPager below the AppBarLayout. -->
+    <!-- The `LinearLayout` with `orientation="vertical"` moves the `ViewPager` below the `AppBarLayout`. -->
     <LinearLayout
-        android:layout_width="match_parent"
         android:layout_height="match_parent"
+        android:layout_width="match_parent"
         android:orientation="vertical" >
 
-        <!-- We need to set android:background="@color/blue_700" here or any space to the right of the TabLayout on large devices will be white. -->
+        <!-- We need to set `android:background="?attr/colorPrimaryDark"` here or any space to the right of the `TabLayout` on large devices will be the theme background color. -->
         <android.support.design.widget.AppBarLayout
             android:id="@+id/guide_appbarlayout"
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
-            android:background="@color/blue_700"
-            android:theme="@style/PrivacyBrowserAppBarLight" >
+            android:background="?attr/colorPrimaryDark" >
 
-            <!-- android:theme="@style/PrivacyBrowser.DarkAppBar" makes the text and icons in the AppBar white. -->
+            <!-- `android:theme="?attr/appBarTextTheme"` sets the color of the text and icons in the `AppBar`. -->
             <android.support.v7.widget.Toolbar
                 android:id="@+id/guide_toolbar"
-                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:background="@color/blue_700"
-                android:theme="@style/PrivacyBrowserAppBarWhiteText"
-                app:popupTheme="@style/PrivacyBrowserPopupsLight" />
+                android:layout_width="match_parent"
+                android:background="?attr/colorPrimaryDark"
+                android:theme="?attr/appBarTextTheme" />
 
+            <!-- For some reason `tabIndicatorColor` does not pull from the style unless specified explicitly here. -->
             <android.support.design.widget.TabLayout
                 android:id="@+id/guide_tablayout"
                 xmlns:android.support.design="http://schemas.android.com/apk/res-auto"
                 android:layout_height="wrap_content"
                 android:layout_width="match_parent"
-                android.support.design:tabBackground="@color/blue_700"
-                android.support.design:tabTextColor="@color/blue_100"
-                android.support.design:tabSelectedTextColor="@color/white"
-                android.support.design:tabIndicatorColor="@color/white"
-                android.support.design:tabMode="scrollable" />
+                android.support.design:tabMode="scrollable"
+                android.support.design:tabIndicatorColor="?attr/tabIndicatorColor"
+                android:theme="?attr/tabLayoutTheme" />
         </android.support.design.widget.AppBarLayout>
 
-        <!-- android:layout_weight="1" makes about_viewpager fill the rest of the screen. -->
+        <!-- `android:layout_weight="1"` makes `about_viewpager` fill the rest of the screen. -->
         <android.support.v4.view.ViewPager
             android:id="@+id/guide_viewpager"
             android:layout_width="match_parent"