merge
author"Vincent Veronis"
Sat, 05 Feb 2011 21:13:31 +0100
changeset 871 9b8914162ed2
parent 870 d1b0d878eac9 (current diff)
parent 869 136dc663f6d5 (diff)
child 872 1a0caf61fc7c
merge
res/layout/chat_msg_row_compact.xml
--- a/res/layout/chat_msg_row_compact.xml	Sat Feb 05 21:12:06 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	Sat Feb 05 21:12:06 2011 +0100
+++ b/src/com/beem/project/beem/ui/Chat.java	Sat Feb 05 21:13:31 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;
 	}