1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-15 14:05:05 -05:00
k-9/src/com/fsck/k9/helper/ContactPicture.java

26 lines
764 B
Java

package com.fsck.k9.helper;
import android.content.Context;
import android.util.TypedValue;
import com.fsck.k9.K9;
import com.fsck.k9.R;
import com.fsck.k9.activity.misc.ContactPictureLoader;
public class ContactPicture {
public static ContactPictureLoader getContactPictureLoader(Context context) {
final int defaultBgColor;
if (!K9.isColorizeMissingContactPictures()) {
TypedValue outValue = new TypedValue();
context.getTheme().resolveAttribute(R.attr.contactPictureFallbackDefaultBackgroundColor,
outValue, true);
defaultBgColor = outValue.data;
} else {
defaultBgColor = 0;
}
return new ContactPictureLoader(context, defaultBgColor);
}
}