Fix data entries with intent sometimes being grayed out

Explicitly set data entries to either primary or secondary text color
depending on presence of an intent to prevent data entries sometimes
being gray despite a valid intent, due to view reuse.

Bug: 5042713
Change-Id: I8c4fac4ce2465ba53446abd629d9ee9fb20c77c9
diff --git a/src/com/android/contacts/detail/ContactDetailFragment.java b/src/com/android/contacts/detail/ContactDetailFragment.java
index c07ce6b..f293cff 100644
--- a/src/com/android/contacts/detail/ContactDetailFragment.java
+++ b/src/com/android/contacts/detail/ContactDetailFragment.java
@@ -1687,10 +1687,11 @@
             setMaxLines(views.data, entry.maxLines);
 
             // Gray out the data item if it does not perform an action when clicked
-            if (entry.intent == null) {
-                ((TextView) view.findViewById(R.id.data)).setTextColor(
-                        getResources().getColor(R.color.secondary_text_color));
-            }
+            // Set primary_text_color even if it might have been set by default to avoid
+            // views being gray sometimes when they are not supposed to, due to view reuse
+            ((TextView) view.findViewById(R.id.data)).setTextColor(
+                        getResources().getColor((entry.intent == null) ?
+                        R.color.secondary_text_color : R.color.primary_text_color));
 
             // Set the default contact method
             views.primaryIndicator.setVisibility(entry.isPrimary ? View.VISIBLE : View.GONE);