mirror of
https://github.com/moparisthebest/k-9
synced 2024-12-25 09:08:49 -05:00
Add "cc Me" and "from me" color chips. Uprez the chips 10x so we get crisp views rather than awful bitmappy stuff
This commit is contained in:
parent
0c34a21ff0
commit
7b23704bd5
@ -212,6 +212,8 @@ public class Account implements BaseAccount {
|
|||||||
private ColorChip mFlaggedReadColorChip;
|
private ColorChip mFlaggedReadColorChip;
|
||||||
private ColorChip mToMeUnreadColorChip;
|
private ColorChip mToMeUnreadColorChip;
|
||||||
private ColorChip mToMeReadColorChip;
|
private ColorChip mToMeReadColorChip;
|
||||||
|
private ColorChip mCcMeUnreadColorChip;
|
||||||
|
private ColorChip mCcMeReadColorChip;
|
||||||
private ColorChip mFromMeUnreadColorChip;
|
private ColorChip mFromMeUnreadColorChip;
|
||||||
private ColorChip mFromMeReadColorChip;
|
private ColorChip mFromMeReadColorChip;
|
||||||
private ColorChip mCheckmarkChip;
|
private ColorChip mCheckmarkChip;
|
||||||
@ -800,6 +802,8 @@ public class Account implements BaseAccount {
|
|||||||
mUnreadColorChip = new ColorChip(mChipColor, false, ColorChip.CIRCULAR);
|
mUnreadColorChip = new ColorChip(mChipColor, false, ColorChip.CIRCULAR);
|
||||||
mToMeReadColorChip = new ColorChip(mChipColor, true, ColorChip.RIGHT_POINTING);
|
mToMeReadColorChip = new ColorChip(mChipColor, true, ColorChip.RIGHT_POINTING);
|
||||||
mToMeUnreadColorChip = new ColorChip(mChipColor, false,ColorChip.RIGHT_POINTING);
|
mToMeUnreadColorChip = new ColorChip(mChipColor, false,ColorChip.RIGHT_POINTING);
|
||||||
|
mCcMeReadColorChip = new ColorChip(mChipColor, true, ColorChip.RIGHT_NOTCH);
|
||||||
|
mCcMeUnreadColorChip = new ColorChip(mChipColor, false,ColorChip.RIGHT_NOTCH);
|
||||||
mFromMeReadColorChip = new ColorChip(mChipColor, true, ColorChip.LEFT_POINTING);
|
mFromMeReadColorChip = new ColorChip(mChipColor, true, ColorChip.LEFT_POINTING);
|
||||||
mFromMeUnreadColorChip = new ColorChip(mChipColor, false,ColorChip.LEFT_POINTING);
|
mFromMeUnreadColorChip = new ColorChip(mChipColor, false,ColorChip.LEFT_POINTING);
|
||||||
mFlaggedReadColorChip = new ColorChip(mChipColor, true, ColorChip.STAR);
|
mFlaggedReadColorChip = new ColorChip(mChipColor, true, ColorChip.STAR);
|
||||||
@ -816,14 +820,15 @@ public class Account implements BaseAccount {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ColorChip generateColorChip(boolean messageRead, boolean toMe, boolean fromMe, boolean messageFlagged) {
|
public ColorChip generateColorChip(boolean messageRead, boolean toMe, boolean ccMe, boolean fromMe, boolean messageFlagged) {
|
||||||
|
|
||||||
if (messageRead) {
|
if (messageRead) {
|
||||||
if (messageFlagged) {
|
if (messageFlagged) {
|
||||||
return mFlaggedReadColorChip;
|
return mFlaggedReadColorChip;
|
||||||
} else if (toMe) {
|
} else if (toMe) {
|
||||||
return mToMeReadColorChip;
|
return mToMeReadColorChip;
|
||||||
|
} else if (ccMe) {
|
||||||
|
return mCcMeReadColorChip;
|
||||||
} else if (fromMe) {
|
} else if (fromMe) {
|
||||||
return mFromMeReadColorChip;
|
return mFromMeReadColorChip;
|
||||||
} else {
|
} else {
|
||||||
@ -835,7 +840,8 @@ public class Account implements BaseAccount {
|
|||||||
return mFlaggedUnreadColorChip;
|
return mFlaggedUnreadColorChip;
|
||||||
} else if (toMe) {
|
} else if (toMe) {
|
||||||
return mToMeUnreadColorChip;
|
return mToMeUnreadColorChip;
|
||||||
|
} else if (ccMe) {
|
||||||
|
return mCcMeUnreadColorChip;
|
||||||
} else if (fromMe) {
|
} else if (fromMe) {
|
||||||
return mFromMeUnreadColorChip;
|
return mFromMeUnreadColorChip;
|
||||||
} else {
|
} else {
|
||||||
|
@ -2490,7 +2490,7 @@ public class MessageList extends K9ListActivity implements OnItemClickListener,
|
|||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
holder.chip.setBackgroundDrawable(message.message.getFolder().getAccount().generateColorChip(message.read,message.message.toMe(), false, message.flagged).drawable());
|
holder.chip.setBackgroundDrawable(message.message.getFolder().getAccount().generateColorChip(message.read,message.message.toMe(), message.message.ccMe(), message.message.fromMe(), message.flagged).drawable());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,42 +10,48 @@ public class ColorChip {
|
|||||||
public static final Path CIRCULAR = new Path();
|
public static final Path CIRCULAR = new Path();
|
||||||
public static final Path LEFT_POINTING = new Path();
|
public static final Path LEFT_POINTING = new Path();
|
||||||
public static final Path RIGHT_POINTING = new Path();
|
public static final Path RIGHT_POINTING = new Path();
|
||||||
|
public static final Path RIGHT_NOTCH = new Path();
|
||||||
public static final Path STAR = new Path();
|
public static final Path STAR = new Path();
|
||||||
public static final Path CHECKMARK = new Path();
|
public static final Path CHECKMARK = new Path();
|
||||||
|
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
|
||||||
CIRCULAR.addCircle(8,8,7f,Path.Direction.CW);
|
CIRCULAR.addCircle(160,160,70f,Path.Direction.CW);
|
||||||
CIRCULAR.close();
|
CIRCULAR.close();
|
||||||
|
|
||||||
RIGHT_POINTING.addArc(new RectF(1f,1f,15f,15f) , 90, 180);
|
RIGHT_POINTING.addArc(new RectF(80f,80f,240f,240f) , 90, 180);
|
||||||
RIGHT_POINTING.lineTo(15f,8f);
|
RIGHT_POINTING.arcTo(new RectF(160f,0f,320f,160f), 180, -90);
|
||||||
RIGHT_POINTING.lineTo(8f, 15f);
|
RIGHT_POINTING.arcTo(new RectF(160f,160f,320f,320f), 270,-90);
|
||||||
RIGHT_POINTING.close();
|
RIGHT_POINTING.close();
|
||||||
|
|
||||||
LEFT_POINTING.addArc(new RectF(1f,1f,15f,15f) , 270, 180);
|
RIGHT_NOTCH.addArc(new RectF(80f,80f,240f,240f) , 90, 180);
|
||||||
LEFT_POINTING.moveTo(8f, 1f);
|
RIGHT_NOTCH.arcTo(new RectF(160f,0f,320f,160f), 180, -90);
|
||||||
LEFT_POINTING.lineTo(0f,8f);
|
RIGHT_NOTCH.arcTo(new RectF(160f,160f,320f,320f), 270,-90);
|
||||||
LEFT_POINTING.lineTo(8f, 15f);
|
RIGHT_NOTCH.close();
|
||||||
|
|
||||||
|
LEFT_POINTING.addArc(new RectF(80f,80f,240f,240f) , 90, -180);
|
||||||
|
LEFT_POINTING.arcTo(new RectF(00f,00f,160f,160f), 0, 90);
|
||||||
|
LEFT_POINTING.arcTo(new RectF(00f,160f,160f,320f), 270,90);
|
||||||
LEFT_POINTING.close();
|
LEFT_POINTING.close();
|
||||||
|
|
||||||
STAR.moveTo(8f,0f);
|
STAR.moveTo(140f,60f);
|
||||||
STAR.lineTo(11f,5f);
|
STAR.lineTo(170f,110f);
|
||||||
STAR.lineTo(16f,6f);
|
STAR.lineTo(220f,120f);
|
||||||
STAR.lineTo(12f,10f);
|
STAR.lineTo(180f,160f);
|
||||||
STAR.lineTo(14f,16f);
|
STAR.lineTo(200f,220f);
|
||||||
STAR.lineTo(8f,13f);
|
STAR.lineTo(140f,190f);
|
||||||
STAR.lineTo(2f,16f);
|
STAR.lineTo(80f,220f);
|
||||||
STAR.lineTo(4f,10f);
|
STAR.lineTo(100f,160f);
|
||||||
STAR.lineTo(0f,6f);
|
STAR.lineTo(60f,120f);
|
||||||
STAR.lineTo(5f,5f);
|
STAR.lineTo(110f,110f);
|
||||||
STAR.lineTo(8f,0f);
|
STAR.lineTo(140f,60f);
|
||||||
STAR.close();
|
STAR.close();
|
||||||
|
|
||||||
CHECKMARK.moveTo(1f,10f);
|
|
||||||
CHECKMARK.lineTo(6f,14f);
|
CHECKMARK.moveTo(10f,160f);
|
||||||
CHECKMARK.lineTo(15f,2f);
|
CHECKMARK.lineTo(120f,280f);
|
||||||
|
CHECKMARK.lineTo(300f,40f);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,12 +60,16 @@ public class ColorChip {
|
|||||||
|
|
||||||
public ColorChip(int color, boolean messageRead, Path shape) {
|
public ColorChip(int color, boolean messageRead, Path shape) {
|
||||||
|
|
||||||
mDrawable = new ShapeDrawable(new PathShape(shape, 16f, 16f));
|
if (shape.equals(STAR)) {
|
||||||
|
mDrawable = new ShapeDrawable(new PathShape(shape, 280f, 280f));
|
||||||
|
|
||||||
if (shape.equals(CHECKMARK)) {
|
|
||||||
mDrawable.getPaint().setStrokeWidth(3);
|
|
||||||
} else {
|
} else {
|
||||||
mDrawable.getPaint().setStrokeWidth(1);
|
mDrawable = new ShapeDrawable(new PathShape(shape, 320f, 320f));
|
||||||
|
}
|
||||||
|
if (shape.equals(CHECKMARK)) {
|
||||||
|
mDrawable.getPaint().setStrokeWidth(30);
|
||||||
|
} else {
|
||||||
|
mDrawable.getPaint().setStrokeWidth(10);
|
||||||
}
|
}
|
||||||
if (messageRead) {
|
if (messageRead) {
|
||||||
// Read messages get an outlined circle
|
// Read messages get an outlined circle
|
||||||
|
Loading…
Reference in New Issue
Block a user