aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/ui/adapter
diff options
context:
space:
mode:
Diffstat (limited to 'src/eu/siacs/conversations/ui/adapter')
-rw-r--r--src/eu/siacs/conversations/ui/adapter/ConversationAdapter.java22
-rw-r--r--src/eu/siacs/conversations/ui/adapter/MessageAdapter.java4
2 files changed, 15 insertions, 11 deletions
diff --git a/src/eu/siacs/conversations/ui/adapter/ConversationAdapter.java b/src/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
index fcc57601..c3ff5b22 100644
--- a/src/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
+++ b/src/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
@@ -6,6 +6,7 @@ import eu.siacs.conversations.R;
import eu.siacs.conversations.entities.Conversation;
import eu.siacs.conversations.entities.Message;
import eu.siacs.conversations.ui.ConversationActivity;
+import eu.siacs.conversations.ui.XmppActivity;
import eu.siacs.conversations.utils.UIHelper;
import android.content.Context;
import android.graphics.Color;
@@ -19,9 +20,9 @@ import android.widget.TextView;
public class ConversationAdapter extends ArrayAdapter<Conversation> {
- ConversationActivity activity;
+ private XmppActivity activity;
- public ConversationAdapter(ConversationActivity activity,
+ public ConversationAdapter(XmppActivity activity,
List<Conversation> conversations) {
super(activity, 0, conversations);
this.activity = activity;
@@ -36,18 +37,21 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
parent, false);
}
Conversation conv = getItem(position);
- if (!activity.getSlidingPaneLayout().isSlideable()) {
- if (conv == activity.getSelectedConversation()) {
- view.setBackgroundColor(0xffdddddd);
+ if (this.activity instanceof ConversationActivity) {
+ ConversationActivity activity = (ConversationActivity) this.activity;
+ if (!activity.getSlidingPaneLayout().isSlideable()) {
+ if (conv == activity.getSelectedConversation()) {
+ view.setBackgroundColor(0xffdddddd);
+ } else {
+ view.setBackgroundColor(Color.TRANSPARENT);
+ }
} else {
view.setBackgroundColor(Color.TRANSPARENT);
}
- } else {
- view.setBackgroundColor(Color.TRANSPARENT);
}
TextView convName = (TextView) view
.findViewById(R.id.conversation_name);
- convName.setText(conv.getName(true));
+ convName.setText(conv.getName());
TextView convLastMsg = (TextView) view
.findViewById(R.id.conversation_lastmsg);
ImageView imagePreview = (ImageView) view
@@ -59,7 +63,7 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
|| latestMessage.getType() == Message.TYPE_PRIVATE) {
if ((latestMessage.getEncryption() != Message.ENCRYPTION_PGP)
&& (latestMessage.getEncryption() != Message.ENCRYPTION_DECRYPTION_FAILED)) {
- convLastMsg.setText(conv.getLatestMessage().getBody());
+ convLastMsg.setText(UIHelper.transformAsciiEmoticons(conv.getLatestMessage().getBody()));
} else {
convLastMsg.setText(activity
.getText(R.string.encrypted_message_received));
diff --git a/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java
index 637711ab..08388ed8 100644
--- a/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java
+++ b/src/eu/siacs/conversations/ui/adapter/MessageAdapter.java
@@ -215,7 +215,7 @@ public class MessageAdapter extends ArrayAdapter<Message> {
viewHolder.messageBody.setVisibility(View.VISIBLE);
if (message.getBody() != null) {
if (message.getType() != Message.TYPE_PRIVATE) {
- viewHolder.messageBody.setText(message.getMergedBody());
+ viewHolder.messageBody.setText(UIHelper.transformAsciiEmoticons(message.getMergedBody()));
} else {
String privateMarker;
if (message.getStatus() <= Message.STATUS_RECEIVED) {
@@ -377,7 +377,7 @@ public class MessageAdapter extends ArrayAdapter<Message> {
@Override
public void onClick(View v) {
String name = item.getConversation()
- .getName(true);
+ .getName();
String read = getContext()
.getString(
R.string.contact_has_read_up_to_this_point,