# HG changeset patch # User "Vincent Veronis" # Date 1296681621 -3600 # Node ID 136dc663f6d58348ce704bc214b9e1b80fa19a91 # Parent f0f107c35a07f922a16620c4d8d808b22ad45786 Compact chat layout modification diff -r f0f107c35a07 -r 136dc663f6d5 res/layout/chat_msg_row_compact.xml --- 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 @@ - - - - - - - diff -r f0f107c35a07 -r 136dc663f6d5 src/com/beem/project/beem/ui/Chat.java --- 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; }