--- a/res/layout/chat_msg_row_compact.xml Tue Feb 01 00:46:43 2011 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical" android:layout_width="fill_parent"
- android:layout_height="wrap_content">
- <TextView android:id="@+id/chatmessagedate"
- android:layout_width="wrap_content" android:layout_height="wrap_content"
- android:autoLink="none" android:layout_marginRight="4dp" />
- <TextView android:id="@+id/chatmessagename"
- android:layout_width="wrap_content" android:layout_height="wrap_content"
- android:textSize="14sp" android:textColor="#FFFFFF" android:textStyle="bold"
- android:layout_toRightOf="@id/chatmessagedate" android:layout_marginRight="4dp" />
- <TextView android:id="@+id/chatmessagetext"
- android:layout_width="wrap_content" android:layout_height="wrap_content"
- android:layout_toRightOf="@id/chatmessagename" android:autoLink="all" />
-</RelativeLayout>
-
--- a/src/com/beem/project/beem/ui/Chat.java Tue Feb 01 00:46:43 2011 +0100
+++ b/src/com/beem/project/beem/ui/Chat.java Wed Feb 02 22:20:21 2011 +0100
@@ -684,35 +684,27 @@
View sv;
if (convertView == null) {
LayoutInflater inflater = Chat.this.getLayoutInflater();
- if (!mCompact)
sv = inflater.inflate(R.layout.chat_msg_row, null);
- else
- sv = inflater.inflate(R.layout.chat_msg_row_compact, null);
} else {
sv = convertView;
}
DateFormat df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM);
MessageText msg = mListMessages.get(position);
- if (!mCompact) {
- TextView msgName = (TextView) sv.findViewById(R.id.chatmessagename);
- msgName.setText(msg.getName());
- msgName.setTextColor(Color.WHITE);
- msgName.setError(null);
- TextView msgText = (TextView) sv.findViewById(R.id.chatmessagetext);
- msgText.setText(msg.getMessage());
- TextView msgDate = (TextView) sv.findViewById(R.id.chatmessagedate);
- String date = df.format(msg.getTimestamp());
- msgDate.setText(date);
- if (msg.isError()) {
- String err = getString(R.string.chat_error);
- msgName.setText(err);
- msgName.setTextColor(Color.RED);
- msgName.setError(err);
- }
- } else {
- String str = "(" + df.format(msg.getTimestamp()) + ") " + msg.getName() + " : " + msg.getMessage();
- TextView msgText = (TextView) sv.findViewById(R.id.chatmessagetext);
- msgText.setText(str);
+ TextView msgName = (TextView) sv.findViewById(R.id.chatmessagename);
+ msgName.setText(msg.getName());
+ msgName.setTextColor(Color.WHITE);
+ msgName.setError(null);
+ TextView msgText = (TextView) sv.findViewById(R.id.chatmessagetext);
+ msgText.setText(msg.getMessage());
+ registerForContextMenu(msgText);
+ TextView msgDate = (TextView) sv.findViewById(R.id.chatmessagedate);
+ String date = df.format(msg.getTimestamp());
+ msgDate.setText(date);
+ if (msg.isError()) {
+ String err = getString(R.string.chat_error);
+ msgName.setText(err);
+ msgName.setTextColor(Color.RED);
+ msgName.setError(err);
}
return sv;
}