mirror of
https://github.com/moparisthebest/Yaaic
synced 2024-11-22 17:02:21 -05:00
Hide divider and remove line break on channel messages
This commit is contained in:
parent
63dfbc0034
commit
ecfa10f483
@ -194,6 +194,8 @@ public class DeckAdapter extends BaseAdapter
|
|||||||
list.setAdapter(new MessageListAdapter(channel, parent.getContext()));
|
list.setAdapter(new MessageListAdapter(channel, parent.getContext()));
|
||||||
|
|
||||||
// XXX: Refactor this crap :)
|
// 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 fw = (float) width;
|
||||||
float fh = (float) height;
|
float fh = (float) height;
|
||||||
@ -204,6 +206,7 @@ public class DeckAdapter extends BaseAdapter
|
|||||||
int w = (int) vwf;
|
int w = (int) vwf;
|
||||||
int h = (int) vhf;
|
int h = (int) vhf;
|
||||||
|
|
||||||
|
list.setDivider(null);
|
||||||
list.setLayoutParams(new Gallery.LayoutParams(w, h));
|
list.setLayoutParams(new Gallery.LayoutParams(w, h));
|
||||||
list.setBackgroundColor(0xff222222);
|
list.setBackgroundColor(0xff222222);
|
||||||
list.setPadding(5, 5, 5, 5);
|
list.setPadding(5, 5, 5, 5);
|
||||||
@ -211,32 +214,5 @@ public class DeckAdapter extends BaseAdapter
|
|||||||
list.setScrollContainer(false);
|
list.setScrollContainer(false);
|
||||||
|
|
||||||
return list;
|
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;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ public class Message {
|
|||||||
public SpannableString render(Context context)
|
public SpannableString render(Context context)
|
||||||
{
|
{
|
||||||
if (canvas == null) {
|
if (canvas == null) {
|
||||||
String prefix = hasIcon() ? "\n " : "\n";
|
String prefix = hasIcon() ? " " : "";
|
||||||
canvas = new SpannableString(prefix + text);
|
canvas = new SpannableString(prefix + text);
|
||||||
if (hasIcon()) {
|
if (hasIcon()) {
|
||||||
Drawable drawable = context.getResources().getDrawable(icon);
|
Drawable drawable = context.getResources().getDrawable(icon);
|
||||||
|
Loading…
Reference in New Issue
Block a user