Use the correct text color for labels.
Change-Id: If4665bd42c4ec55476cdbf02111105b792b61a05
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 8046e3a..d03f8e4 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -569,5 +569,7 @@
<!-- Button at bottom of conversation list screen if the folder for which contents are being shown supports loading more on demand [CHAR LIMIT=20]-->
<string name="load_more">Load more</string>
<!-- Default background color for a folder shown in a conversation item if none is set.-->
- <string name="default_folder_background_color">#f1f5ec</string>
+ <string name="default_folder_background_color" translateable="false">#f1f5ec</string>
+ <!-- Default text color for a folder shown in a conversation item if none is set.-->
+ <string name="default_folder_text_color" translateable="false">#888888</string>
</resources>
diff --git a/src/com/android/mail/ui/FolderDisplayer.java b/src/com/android/mail/ui/FolderDisplayer.java
index b2a03a2..3318af3 100644
--- a/src/com/android/mail/ui/FolderDisplayer.java
+++ b/src/com/android/mail/ui/FolderDisplayer.java
@@ -54,6 +54,8 @@
public int textColor;
+ public boolean showBgColor;
+
public FolderValues(String id, String color, String n, String bgColor, String fgColor,
Context context) {
folderId = id;
@@ -66,7 +68,12 @@
backgroundColor = Utils.getDefaultFolderBackgroundColor(context);
}
// TODO(mindyp): add default fg text color and text color from preference.
- textColor = Color.BLACK;
+ final boolean showTextColor = !TextUtils.isEmpty(fgColor);
+ if (showTextColor) {
+ textColor = Integer.parseInt(fgColor);
+ } else {
+ textColor = Utils.getDefaultFolderTextColor(context);
+ }
}
@Override
@@ -101,7 +108,12 @@
}
for (Folder folder : folders) {
String folderId = folder.id;
+ String canonicalName = folder.name;
String colorId = folder.bgColor;
+
+ // We will sometimes see folders that the folder map does not yet know about or that
+ // do not have names yet.
+ if (TextUtils.isEmpty(canonicalName)) continue;
String stringToDisplay = null;
if (!Folder.isProviderFolder(folder)) {
diff --git a/src/com/android/mail/utils/Utils.java b/src/com/android/mail/utils/Utils.java
index f3242b5..345b9e0 100644
--- a/src/com/android/mail/utils/Utils.java
+++ b/src/com/android/mail/utils/Utils.java
@@ -792,6 +792,11 @@
R.string.default_folder_background_color));
}
+ public static int getDefaultFolderTextColor(Context context) {
+ return Integer.parseInt(context.getResources().getString(
+ R.string.default_folder_text_color));
+ }
+
public static int getTransparentColor(int color) {
return 0x00ffffff & color;
}