Adapter clean ups

This commit is contained in:
Karim Abou Zeid 2015-07-12 03:22:24 +02:00
commit 98dcdf2d47
55 changed files with 811 additions and 1147 deletions

View file

@ -52,4 +52,8 @@ public class ColorUtil {
public static boolean useDarkTextColorOnBackground(int backgroundColor) {
return (Color.red(backgroundColor) * 0.299 + Color.green(backgroundColor) * 0.587 + Color.blue(backgroundColor) * 0.114) > 186;
}
public static int getTextColorForBackground(int backgroundColor) {
return (Color.red(backgroundColor) * 0.299 + Color.green(backgroundColor) * 0.587 + Color.blue(backgroundColor) * 0.114) > 186 ? Color.BLACK : Color.WHITE;
}
}