diff options
Diffstat (limited to 'src/de/gultsch/chat/utils/UIHelper.java')
-rw-r--r-- | src/de/gultsch/chat/utils/UIHelper.java | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/de/gultsch/chat/utils/UIHelper.java b/src/de/gultsch/chat/utils/UIHelper.java index 52292a0f4..5e81f0990 100644 --- a/src/de/gultsch/chat/utils/UIHelper.java +++ b/src/de/gultsch/chat/utils/UIHelper.java @@ -54,7 +54,7 @@ public class UIHelper { SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); return sdf.format(date); } else { - SimpleDateFormat sdf = new SimpleDateFormat("M/D"); + SimpleDateFormat sdf = new SimpleDateFormat("MM/dd"); return sdf.format(date); } } @@ -85,6 +85,26 @@ public class UIHelper { return bitmap; } + + public static Bitmap getErrorPicture(int size) { + Bitmap bitmap = Bitmap + .createBitmap(size, size, Bitmap.Config.ARGB_8888); + Canvas canvas = new Canvas(bitmap); + + bitmap.eraseColor(0xFFe92727); + + Paint paint = new Paint(); + paint.setColor(0xffe5e5e5); + paint.setTextSize((float) (size * 0.9)); + paint.setAntiAlias(true); + Rect rect = new Rect(); + paint.getTextBounds("!", 0, 1, rect); + float width = paint.measureText("!"); + canvas.drawText("!", (size / 2) - (width / 2), (size / 2) + + (rect.height() / 2), paint); + + return bitmap; + } public static Notification getUnreadMessageNotification(Context context, Conversation conversation) { |