From 250ebb8c814ea5c8818d12afc25194091694a5b1 Mon Sep 17 00:00:00 2001
From: Bryan Owens <djbryan3540@gmail.com>
Date: Sun, 17 Jan 2016 02:15:52 -0600
Subject: Themes: Expose hard coded colors and styles from layouts

Change-Id: I815dc35d65110ac091e73cc3dd9b1a16fe69b929
Signed-off-by: Bryan Owens <djbryan3540@gmail.com>
---
 res/layout-sw600dp/snapshot_item.xml               |  6 +++---
 res/layout-sw600dp/suggestion_item.xml             |  8 ++++----
 res/layout-sw600dp/title_bar_autologin.xml         | 10 +++++-----
 res/layout/anim_screen.xml                         |  2 +-
 res/layout/bookmark_sync_wizard.xml                |  6 +++---
 res/layout/bookmark_thumbnail.xml                  |  2 +-
 res/layout/bookmarkthumbnailwidget_item.xml        |  2 +-
 res/layout/bookmarkthumbnailwidget_item_folder.xml |  2 +-
 res/layout/nav_screen.xml                          |  2 +-
 res/layout/preference_list_content.xml             |  2 +-
 res/layout/qc_tab.xml                              |  4 ++--
 res/layout/snapshot_item.xml                       |  4 ++--
 res/layout/title_bar_autologin.xml                 | 12 ++++++------
 res/values/cm_colors.xml                           | 22 ++++++++++++++++++++++
 res/values/cm_styles.xml                           | 22 ++++++++++++++++++++++
 15 files changed, 75 insertions(+), 31 deletions(-)
 create mode 100644 res/values/cm_styles.xml

diff --git a/res/layout-sw600dp/snapshot_item.xml b/res/layout-sw600dp/snapshot_item.xml
index 2fc6ca8..2258b17 100644
--- a/res/layout-sw600dp/snapshot_item.xml
+++ b/res/layout-sw600dp/snapshot_item.xml
@@ -39,7 +39,7 @@
         android:ellipsize="end"
         android:textSize="12sp"
         android:typeface="sans"
-        android:textColor="@android:color/white"
+        android:textColor="@color/snapshot_item_text_color"
         android:paddingLeft="6dip"
         android:paddingRight="2dip"
         android:gravity="center_vertical" />
@@ -62,7 +62,7 @@
         android:gravity="center_vertical"
         android:typeface="sans"
         android:textSize="14sp"
-        android:textColor="#AAAAAA" />
+        android:textColor="@color/snapshot_item_date_text_color" />
     <TextView android:id="@+id/size"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
@@ -73,5 +73,5 @@
         android:gravity="center_vertical"
         android:typeface="sans"
         android:textSize="14sp"
-        android:textColor="#AAAAAA" />
+        android:textColor="@color/snapshot_item_title_text_color" />
 </RelativeLayout>
diff --git a/res/layout-sw600dp/suggestion_item.xml b/res/layout-sw600dp/suggestion_item.xml
index b106ae6..5dbe91e 100644
--- a/res/layout-sw600dp/suggestion_item.xml
+++ b/res/layout-sw600dp/suggestion_item.xml
@@ -51,16 +51,16 @@
                 android:id="@android:id/text1"
                 style="@style/SuggestionLineMedium"
                 android:maxLines="1"
-                android:textColor="@color/black"
-                android:textColorHint="@color/black"
+                android:textColor="@color/suggestion_item_text_color"
+                android:textColorHint="@color/suggestion_item_hint_text_color"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content" />
             <TextView
                 android:id="@android:id/text2"
                 style="@style/SuggestionLineSmall"
                 android:singleLine="true"
-                android:textColor="@color/black"
-                android:textColorHint="@color/black"
+                android:textColor="@color/suggestion_item_secondary_text_color"
+                android:textColorHint="@color/suggestion_item_secondary_hint_text_color"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content" />
         </LinearLayout>
diff --git a/res/layout-sw600dp/title_bar_autologin.xml b/res/layout-sw600dp/title_bar_autologin.xml
index 1065756..c656154 100644
--- a/res/layout-sw600dp/title_bar_autologin.xml
+++ b/res/layout-sw600dp/title_bar_autologin.xml
@@ -18,14 +18,14 @@
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:background="#FBF0A0"
+    android:background="@color/title_bar_autologin_background"
     android:gravity="center_vertical"
     android:visibility="gone">
     <TextView
         android:text="@string/autologin_bar_text"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:textColor="@android:color/primary_text_light"
+        android:textColor="@color/autologin_bar_text_color"
         android:paddingLeft="15dip"
         android:paddingRight="15dip"
         android:textAppearance="?android:attr/textAppearanceMedium"/>
@@ -33,11 +33,11 @@
         android:id="@+id/autologin_account"
         android:layout_height="wrap_content"
         android:layout_width="wrap_content"
-        style="@android:style/Widget.Holo.Light.Spinner" />
+        style="@style/LoginSpinnerTheme" />
     <Button
         android:id="@+id/autologin_login"
         android:text="@string/autologin_bar_login_text"
-        style="@android:style/Widget.Holo.Light.Button"
+        style="@style/LoginButtonTheme"
         android:layout_marginRight="15dip"
         android:layout_height="wrap_content"
         android:layout_width="wrap_content" />
@@ -51,7 +51,7 @@
         android:id="@+id/autologin_error"
         android:layout_height="wrap_content"
         android:layout_width="wrap_content"
-        android:textColor="#dd6826"
+        android:textColor="@color/title_bar_autologin_error_text_color"
         android:text="@string/autologin_bar_error"
         android:textAppearance="?android:attr/textAppearanceMedium"
         android:visibility="gone" />
diff --git a/res/layout/anim_screen.xml b/res/layout/anim_screen.xml
index 4015ba1..97133bf 100644
--- a/res/layout/anim_screen.xml
+++ b/res/layout/anim_screen.xml
@@ -26,5 +26,5 @@
         android:id="@+id/content"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:background="@color/white" />
+        android:background="@color/anim_screen_image_view_background" />
 </LinearLayout>
diff --git a/res/layout/bookmark_sync_wizard.xml b/res/layout/bookmark_sync_wizard.xml
index 3a3d9da..8b0036d 100644
--- a/res/layout/bookmark_sync_wizard.xml
+++ b/res/layout/bookmark_sync_wizard.xml
@@ -22,7 +22,7 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:orientation="vertical"
-        android:background="@android:color/black">
+        android:background="@color/bookmark_sync_wizard_background">
 
         <TextView
             android:layout_width="match_parent"
@@ -47,7 +47,7 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:orientation="vertical"
-        android:background="@android:color/black">
+        android:background="@color/select_account_description_background">
 
         <TextView
             android:id="@+id/select_account_description"
@@ -72,7 +72,7 @@
         android:id="@+id/confirm"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:background="@android:color/black"
+        android:background="@color/bookmark_sync_wizard_confirm_background"
         android:textAppearance="?android:attr/textAppearanceMedium" />
 
 </view>
diff --git a/res/layout/bookmark_thumbnail.xml b/res/layout/bookmark_thumbnail.xml
index 0e80998..e797566 100644
--- a/res/layout/bookmark_thumbnail.xml
+++ b/res/layout/bookmark_thumbnail.xml
@@ -58,7 +58,7 @@
         android:ellipsize="marquee"
         android:typeface="sans"
         android:textSize="14sp"
-        android:textColor="#AAAAAA"
+        android:textColor="@color/bookmark_thumbnail_label_text_color"
         />
 
 </com.android.browser.view.BookmarkContainer>
diff --git a/res/layout/bookmarkthumbnailwidget_item.xml b/res/layout/bookmarkthumbnailwidget_item.xml
index 8bc1efb..beb0fb2 100644
--- a/res/layout/bookmarkthumbnailwidget_item.xml
+++ b/res/layout/bookmarkthumbnailwidget_item.xml
@@ -55,6 +55,6 @@
             android:ellipsize="end"
             android:textSize="12sp"
             android:typeface="sans"
-            android:textColor="@android:color/white" />
+            android:textColor="@color/bookmark_thumbnail_widget_label_text_color" />
     </LinearLayout>
 </RelativeLayout>
diff --git a/res/layout/bookmarkthumbnailwidget_item_folder.xml b/res/layout/bookmarkthumbnailwidget_item_folder.xml
index 6044164..e6d0c78 100644
--- a/res/layout/bookmarkthumbnailwidget_item_folder.xml
+++ b/res/layout/bookmarkthumbnailwidget_item_folder.xml
@@ -55,6 +55,6 @@
             android:ellipsize="end"
             android:textSize="12sp"
             android:typeface="sans"
-            android:textColor="@android:color/white" />
+            android:textColor="@color/bookmark_thumbnail_widget_folder_label_text_color" />
     </LinearLayout>
 </RelativeLayout>
diff --git a/res/layout/nav_screen.xml b/res/layout/nav_screen.xml
index f296478..a1849cd 100644
--- a/res/layout/nav_screen.xml
+++ b/res/layout/nav_screen.xml
@@ -19,7 +19,7 @@
     android:id="@+id/nav_screen"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:background="@color/white">
+    android:background="@color/nav_screen_background">
     <com.android.browser.NavTabScroller
         android:id="@+id/scroller"
         android:layout_width="match_parent"
diff --git a/res/layout/preference_list_content.xml b/res/layout/preference_list_content.xml
index ad3d64e..169ee53 100644
--- a/res/layout/preference_list_content.xml
+++ b/res/layout/preference_list_content.xml
@@ -79,7 +79,7 @@
                     android:layout_height="1dip"
                     android:paddingLeft="32dip"
                     android:paddingRight="32dip"
-                    android:src="#404040"
+                    android:src="@color/preference_list_image_view_background"
                 />
             <android.preference.PreferenceFrameLayout android:id="@+id/prefs"
                     android:layout_width="match_parent"
diff --git a/res/layout/qc_tab.xml b/res/layout/qc_tab.xml
index 74c82a7..57855b6 100644
--- a/res/layout/qc_tab.xml
+++ b/res/layout/qc_tab.xml
@@ -34,7 +34,7 @@
         android:ellipsize="marquee"
         android:typeface="sans"
         android:textSize="12sp"
-        android:textColor="#DDDDDD"
+        android:textColor="@color/qc_tab_title_text_color"
         />
     <ImageView
         android:id="@+id/thumb"
@@ -57,7 +57,7 @@
         android:ellipsize="marquee"
         android:typeface="sans"
         android:textSize="12sp"
-        android:textColor="#DDDDDD"
+        android:textColor="@color/qc_tab_title_text_color"
         android:elevation="5dp"
         />
 </LinearLayout>
diff --git a/res/layout/snapshot_item.xml b/res/layout/snapshot_item.xml
index 7c7ba3b..660bcde 100644
--- a/res/layout/snapshot_item.xml
+++ b/res/layout/snapshot_item.xml
@@ -39,7 +39,7 @@
         android:ellipsize="end"
         android:textSize="14sp"
         android:typeface="sans"
-        android:textColor="#AAAAAA"
+        android:textColor="@color/snapshot_item_date_text_color"
         android:paddingLeft="6dip"
         android:paddingRight="2dip"
         android:gravity="center_vertical" />
@@ -54,7 +54,7 @@
         android:gravity="center_vertical"
         android:typeface="sans"
         android:textSize="12sp"
-        android:textColor="#AAAAAA"
+        android:textColor="@color/snapshot_item_title_text_color"
         android:lines="2" />
     <ImageView
         android:id="@+id/divider"
diff --git a/res/layout/title_bar_autologin.xml b/res/layout/title_bar_autologin.xml
index 22da630..3101bc0 100644
--- a/res/layout/title_bar_autologin.xml
+++ b/res/layout/title_bar_autologin.xml
@@ -18,7 +18,7 @@
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:background="#FBF0A0"
+    android:background="@color/title_bar_autologin_background"
     android:gravity="center_vertical"
     android:visibility="gone"
     android:orientation="vertical">
@@ -31,7 +31,7 @@
             android:text="@string/autologin_bar_text"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:textColor="@android:color/primary_text_light"
+            android:textColor="@color/autologin_bar_text_color"
             android:textAppearance="?android:attr/textAppearanceMedium" />
         <Spinner
             android:id="@+id/autologin_account"
@@ -39,7 +39,7 @@
             android:layout_width="match_parent"
             android:paddingLeft="8dp"
             android:paddingRight="24dp"
-            style="@android:style/Widget.Holo.Light.Spinner" />
+            style="@style/LoginSpinnerTheme" />
     </LinearLayout>
     <LinearLayout
         android:layout_width="match_parent"
@@ -52,7 +52,7 @@
             android:layout_weight="1"
             android:layout_height="wrap_content"
             android:text="@string/autologin_bar_hide_text"
-            style="@android:style/Widget.Holo.Light.Button" />
+            style="@style/LoginButtonTheme" />
         <ProgressBar
             android:id="@+id/autologin_progress"
             android:indeterminateOnly="true"
@@ -62,7 +62,7 @@
         <Button
             android:id="@+id/autologin_login"
             android:text="@string/autologin_bar_login_text"
-            style="@android:style/Widget.Holo.Light.Button"
+            style="@style/LoginButtonTheme"
             android:layout_height="wrap_content"
             android:layout_width="0dip"
             android:layout_weight="1" />
@@ -71,7 +71,7 @@
         android:id="@+id/autologin_error"
         android:layout_height="wrap_content"
         android:layout_width="wrap_content"
-        android:textColor="#dd6826"
+        android:textColor="@color/title_bar_autologin_error_text_color"
         android:text="@string/autologin_bar_error"
         android:textAppearance="?android:attr/textAppearanceMedium"
         android:visibility="gone" />
diff --git a/res/values/cm_colors.xml b/res/values/cm_colors.xml
index c9dd6af..9399916 100644
--- a/res/values/cm_colors.xml
+++ b/res/values/cm_colors.xml
@@ -22,4 +22,26 @@
     <color name="accent">#1b5e20</color>
     <color name="floating_action_button_touch_tint">#388e3c</color>
     <color name="trasparent">#00000000</color>
+
+
+    <color name="bookmark_thumbnail_label_text_color">#AAAAAA</color>
+    <color name="preference_list_image_view_background">#404040</color>
+    <color name="qc_tab_title_text_color">#DDDDDD</color>
+    <color name="snapshot_item_date_text_color">#AAAAAA</color>
+    <color name="snapshot_item_title_text_color">#AAAAAA</color>
+    <color name="snapshot_item_text_color">@android:color/white</color>
+    <color name="title_bar_autologin_background">#FBF0A0</color>
+    <color name="title_bar_autologin_error_text_color">#dd6826</color>
+    <color name="bookmark_sync_wizard_background">@android:color/black</color>
+    <color name="bookmark_sync_wizard_confirm_background">@android:color/black</color>
+    <color name="select_account_description_background">@android:color/black</color>
+    <color name="bookmark_thumbnail_widget_label_text_color">@android:color/white</color>
+    <color name="bookmark_thumbnail_widget_folder_label_text_color">@android:color/white</color>
+    <color name="autologin_bar_text_color">@android:color/primary_text_light</color>
+    <color name="anim_screen_image_view_background">@color/white</color>
+    <color name="nav_screen_background">@color/white</color>
+    <color name="suggestion_item_text_color">@color/black</color>
+    <color name="suggestion_item_hint_text_color">@color/black</color>
+    <color name="suggestion_item_secondary_text_color">@color/black</color>
+    <color name="suggestion_item_secondary_hint_text_color">@color/black</color>
 </resources>
diff --git a/res/values/cm_styles.xml b/res/values/cm_styles.xml
new file mode 100644
index 0000000..8dace97
--- /dev/null
+++ b/res/values/cm_styles.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2015 The CyanogenMod Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<resources>
+    <style name="LoginButtonTheme" parent="@android:Widget.Holo.Light.Button" />
+
+    <style name="LoginSpinnerTheme" parent="@android:Widget.Holo.Light.Spinner" />
+
+</resources>
-- 
cgit v1.1