1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2025-02-16 15:00:14 -05:00

Only prefix message with a space if there's an icon to show

This commit is contained in:
Sebastian Kaspari 2010-03-06 20:32:49 +01:00
parent b57a9c369c
commit bd932234f5

View File

@ -93,7 +93,11 @@ public class Message {
public SpannableString render(Context context) public SpannableString render(Context context)
{ {
if (canvas == null) { if (canvas == null) {
canvas = new SpannableString("\n " + text); String prefix = "\n";
if (hasIcon()) {
prefix = " " + prefix;
}
canvas = new SpannableString(prefix + text);
if (hasIcon()) { if (hasIcon()) {
Drawable drawable = context.getResources().getDrawable(icon); Drawable drawable = context.getResources().getDrawable(icon);
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight()); drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());