Hide divider and remove line break on channel messages

This commit is contained in:
Sebastian Kaspari 2010-03-08 21:54:20 +01:00
parent 63dfbc0034
commit ecfa10f483
2 changed files with 4 additions and 28 deletions

View File

@ -194,6 +194,8 @@ public class DeckAdapter extends BaseAdapter
list.setAdapter(new MessageListAdapter(channel, parent.getContext()));
// XXX: Refactor this crap :)
// XXX: In addition to that we need to resize the lists if the
// screen is resized or rotated
float fw = (float) width;
float fh = (float) height;
@ -204,6 +206,7 @@ public class DeckAdapter extends BaseAdapter
int w = (int) vwf;
int h = (int) vhf;
list.setDivider(null);
list.setLayoutParams(new Gallery.LayoutParams(w, h));
list.setBackgroundColor(0xff222222);
list.setPadding(5, 5, 5, 5);
@ -211,32 +214,5 @@ public class DeckAdapter extends BaseAdapter
list.setScrollContainer(false);
return list;
/*
TextView canvas = new TextView(parent.getContext());
SpannableString welcome = new SpannableString("Joined " + channel.getName());
canvas.setText(welcome);
for (Message message : channel.getHistory()) {
canvas.append(message.render(canvas.getContext()));
}
// XXX: Refactor this crap :)
float fw = (float) width;
float fh = (float) height;
float vwf = fw / 100 * 80;
float vhf = fh / 100 * 80;
int w = (int) vwf;
int h = (int) vhf;
//channelView.setLayoutParams(new Gallery.LayoutParams(w, h));
canvas.setLayoutParams(new Gallery.LayoutParams(w, h));
return canvas;
*/
}
}

View File

@ -109,7 +109,7 @@ public class Message {
public SpannableString render(Context context)
{
if (canvas == null) {
String prefix = hasIcon() ? "\n " : "\n";
String prefix = hasIcon() ? " " : "";
canvas = new SpannableString(prefix + text);
if (hasIcon()) {
Drawable drawable = context.getResources().getDrawable(icon);