Use text color from theme

This is to enable light themes more easily.

Bug: 167443831
Test: Manually
Change-Id: Ie28f70645addf1c2ffb7d37fb0daeac8f788032e
diff --git a/car-apps-common/res/color/primary_text_color.xml b/car-apps-common/res/color/primary_text_color.xml
new file mode 100644
index 0000000..d310838
--- /dev/null
+++ b/car-apps-common/res/color/primary_text_color.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+    Copyright (C) 2019 The Android Open Source 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.
+-->
+<!-- Copy of ?android:attr/textColorPrimary (frameworks/base/res/res/color/text_color_primary.xml)
+     but with a ux restricted state. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+          xmlns:app="http://schemas.android.com/apk/res-auto">
+    <item android:state_enabled="false"
+          android:alpha="?android:attr/disabledAlpha"
+          android:color="?android:attr/colorForeground"/>
+    <item app:state_ux_restricted="true"
+          android:alpha="?android:attr/disabledAlpha"
+          android:color="?android:attr/colorForeground"/>
+    <item android:color="?android:attr/colorForeground"/>
+</selector>
diff --git a/car-apps-common/res/color/secondary_text_color.xml b/car-apps-common/res/color/secondary_text_color.xml
new file mode 100644
index 0000000..4c9f267
--- /dev/null
+++ b/car-apps-common/res/color/secondary_text_color.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+    Copyright (C) 2019 The Android Open Source 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.
+-->
+<!-- Copy of ?android:attr/textColorSecondary (frameworks/base/res/res/color/text_color_secondary.xml)
+     but with a ux restricted state. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+          xmlns:app="http://schemas.android.com/apk/res-auto">
+    <item android:state_enabled="false"
+          android:alpha="?android:attr/disabledAlpha"
+          android:color="?android:attr/colorForeground"/>
+    <item app:state_ux_restricted="true"
+          android:alpha="?android:attr/disabledAlpha"
+          android:color="?android:attr/colorForeground"/>
+    <item android:alpha="?android:attr/secondaryContentAlpha"
+          android:color="?android:attr/colorForeground"/>
+</selector>
diff --git a/car-apps-common/res/color/uxr_button_text_color_selector.xml b/car-apps-common/res/color/uxr_button_text_color_selector.xml
deleted file mode 100644
index 08b64e1..0000000
--- a/car-apps-common/res/color/uxr_button_text_color_selector.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (C) 2019 The Android Open Source 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.
-  -->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android"
-          xmlns:app="http://schemas.android.com/apk/res-auto">
-    <item app:state_ux_restricted="true" android:color="@color/uxr_button_text_disabled_color"/>
-    <item app:state_ux_restricted="false" android:color="@color/uxr_button_text_color"/>
-</selector>
diff --git a/car-apps-common/res/values-night/colors.xml b/car-apps-common/res/values-night/colors.xml
index 6a2f4cf..a0a9c3a 100644
--- a/car-apps-common/res/values-night/colors.xml
+++ b/car-apps-common/res/values-night/colors.xml
@@ -21,9 +21,6 @@
     <color name="scrim_overlay_color">#D6000000</color>
     <color name="minimized_control_bar_background_color">#E00E1013</color>
 
-    <color name="primary_text_color">#E0FFFFFF</color>
-    <color name="secondary_text_color">#99FFFFFF</color>
-
     <color name="primary_app_icon_color">#E0FFFFFF</color>
     <color name="secondary_app_icon_color">#99FFFFFF</color>
 
diff --git a/car-apps-common/res/values/colors.xml b/car-apps-common/res/values/colors.xml
index f7e18a5..45a0a18 100644
--- a/car-apps-common/res/values/colors.xml
+++ b/car-apps-common/res/values/colors.xml
@@ -50,9 +50,6 @@
     <color name="car_tab_unselected_color_dark">#80FFFFFF</color>
     <color name="car_tab_unselected_color_light">#90FFFFFF</color>
 
-    <color name="primary_text_color">#FFFFFFFF</color>
-    <color name="secondary_text_color">#B8FFFFFF</color>
-
     <color name="primary_app_icon_color">#FFFFFFFF</color>
     <color name="secondary_app_icon_color">#B8FFFFFF</color>
     <color name="car_card_ripple_background">#17000000</color>
@@ -60,14 +57,12 @@
     <color name="background_image_30p_black">#4D000000</color>
 
     <color name="uxr_button_image_color">@color/primary_app_icon_color</color>
-    <color name="uxr_button_text_color">@color/primary_text_color</color>
     <color name="uxr_button_image_disabled_color">#80FFFFFF</color>
-    <color name="uxr_button_text_disabled_color">#80FFFFFF</color>
 
     <color name="control_bar_button_background_color">#66ffffff</color>
 
     <color name="hero_button_background_color">@color/car_grey_868</color>
-    <color name="hero_button_text_color">@color/uxr_button_text_color_selector</color>
+    <color name="hero_button_text_color">@color/primary_text_color</color>