Highlight unread messages

This commit is contained in:
M66B
2018-08-06 15:07:46 +00:00
parent 601d63482d
commit 33c0ec0efe
5 changed files with 18 additions and 7 deletions

View File

@@ -20,11 +20,10 @@ package eu.faircode.email;
*/
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.os.Build;
import android.text.TextUtils;
import android.util.Log;
import android.util.TypedValue;
import java.io.BufferedReader;
import java.io.IOException;
@@ -34,10 +33,11 @@ public class Helper {
static final String TAG = BuildConfig.APPLICATION_ID;
static int resolveColor(Context context, int attr) {
TypedValue typedValue = new TypedValue();
Resources.Theme theme = context.getTheme();
theme.resolveAttribute(attr, typedValue, true);
return typedValue.data;
int[] attrs = new int[]{attr};
TypedArray a = context.getTheme().obtainStyledAttributes(attrs);
int color = a.getColor(0, 0xFF0000);
a.recycle();
return color;
}
static String localizeFolderName(Context context, String name) {