aboutsummaryrefslogtreecommitdiffstats
path: root/src/de/gultsch/chat/utils/UIHelper.java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-02-20 17:00:50 +0100
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-02-20 17:00:50 +0100
commitc82179c0b8728a9c2cd567d4227c60c758a1e682 (patch)
treeb866a099bb79225bf31a6498374f24f757af163e /src/de/gultsch/chat/utils/UIHelper.java
parent94ab61d5c0b060e2aea5caf58ac06864f980956b (diff)
adding and removing roster items now possible. basic error display on error messages
Diffstat (limited to 'src/de/gultsch/chat/utils/UIHelper.java')
-rw-r--r--src/de/gultsch/chat/utils/UIHelper.java22
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 52292a0f..5e81f099 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) {