Commit efc5f242 authored by Grigory Fedorov's avatar Grigory Fedorov

ContactList: contact colors fixed.

parent 8f43ee86
...@@ -20,6 +20,7 @@ import android.graphics.Bitmap; ...@@ -20,6 +20,7 @@ import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.graphics.Shader.TileMode; import android.graphics.Shader.TileMode;
import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.view.Gravity; import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
...@@ -56,6 +57,7 @@ public abstract class BaseContactInflater { ...@@ -56,6 +57,7 @@ public abstract class BaseContactInflater {
* Managed adapter. * Managed adapter.
*/ */
BaseAdapter adapter; BaseAdapter adapter;
private final int[] accountColors;
public BaseContactInflater(Activity activity) { public BaseContactInflater(Activity activity) {
this.activity = activity; this.activity = activity;
...@@ -65,6 +67,8 @@ public abstract class BaseContactInflater { ...@@ -65,6 +67,8 @@ public abstract class BaseContactInflater {
Bitmap bitmap = BitmapFactory.decodeResource(activity.getResources(), R.drawable.shadow); Bitmap bitmap = BitmapFactory.decodeResource(activity.getResources(), R.drawable.shadow);
shadowDrawable = new BitmapDrawable(activity.getResources(), bitmap); shadowDrawable = new BitmapDrawable(activity.getResources(), bitmap);
shadowDrawable.setTileModeXY(TileMode.REPEAT, TileMode.REPEAT); shadowDrawable.setTileModeXY(TileMode.REPEAT, TileMode.REPEAT);
accountColors = activity.getResources().getIntArray(R.array.account_action_bar);
} }
/** /**
...@@ -118,7 +122,8 @@ public abstract class BaseContactInflater { ...@@ -118,7 +122,8 @@ public abstract class BaseContactInflater {
viewHolder.shadow.setVisibility(View.VISIBLE); viewHolder.shadow.setVisibility(View.VISIBLE);
} }
viewHolder.color.setImageLevel(abstractContact.getColorLevel()); int colorLevel = abstractContact.getColorLevel();
viewHolder.color.setImageDrawable(new ColorDrawable(accountColors[colorLevel]));
if (SettingsManager.contactsShowAvatars()) { if (SettingsManager.contactsShowAvatars()) {
viewHolder.avatar.setVisibility(View.VISIBLE); viewHolder.avatar.setVisibility(View.VISIBLE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment