1
0
mirror of https://github.com/moparisthebest/k-9 synced 2025-01-13 14:48:04 -05:00

make the color chip genuinely calculated per message

This commit is contained in:
Jesse Vincent 2009-12-27 17:15:38 +00:00
parent ed19a8284e
commit 81d72a2d8c

View File

@ -100,8 +100,6 @@ public class MessageList
private ListView mListView;
private int mSelectedWidget = WIDGET_FLAG;
private int colorChipResId;
private MessageListAdapter mAdapter;
private FolderInfoHolder mCurrentFolder;
@ -407,12 +405,6 @@ public class MessageList
mSelectedCount = savedInstanceState.getInt(STATE_KEY_SELECTED_COUNT);
}
/*
* Since the color chip is always the same color for a given account we just
* cache the id of the chip right here.
*/
colorChipResId = colorChipResIds[mAccount.getAccountNumber() % colorChipResIds.length];
mLeftHanded = mAccount.getLeftHanded();
mAdapter = new MessageListAdapter();
@ -1959,7 +1951,9 @@ public class MessageList
}
});
holder.chip.setBackgroundResource(colorChipResId);
holder.chip.setBackgroundResource( colorChipResIds[message.account.getAccountNumber() % colorChipResIds.length] );
holder.selected = (CheckBox) view.findViewById(R.id.selected_checkbox);
if (holder.selected!=null)
{
@ -1971,7 +1965,6 @@ public class MessageList
if (message != null)
{
holder.chip.getBackground().setAlpha(message.read ? 0 : 255);
holder.subject.setTypeface(null, message.read ? Typeface.NORMAL : Typeface.BOLD);
setVisibleWidgetsForListItem(view, mSelectedWidget);
@ -1985,7 +1978,7 @@ public class MessageList
holder.position = -1;
holder.selected.setChecked(message.selected);
holder.chip.getBackground().setAlpha(message.read ? 0 : 127);
holder.chip.getBackground().setAlpha(message.read ? 255 : 127);
if (message.downloaded)
{