diff options
author | kruks23 <scardenas@openmailbox.org> | 2014-05-20 17:49:54 +0200 |
---|---|---|
committer | kruks23 <scardenas@openmailbox.org> | 2014-05-20 17:49:54 +0200 |
commit | 116456691dcb5484aaa8c11fb4d788a58177ac53 (patch) | |
tree | fe4ebf66a69103211679f4d469b143e0e40d3fff /src/eu/siacs/conversations/ui | |
parent | a5a356a7a7312c64d6d6c81ee773a36fe556233d (diff) | |
parent | ff6e51356f2e76418ed71f19b7232c840a1b6bce (diff) |
Merge branch 'development' of https://github.com/siacs/Conversations into development
Diffstat (limited to 'src/eu/siacs/conversations/ui')
-rw-r--r-- | src/eu/siacs/conversations/ui/ConversationFragment.java | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/src/eu/siacs/conversations/ui/ConversationFragment.java b/src/eu/siacs/conversations/ui/ConversationFragment.java index b551e6ad..7ab01936 100644 --- a/src/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/eu/siacs/conversations/ui/ConversationFragment.java @@ -392,20 +392,17 @@ public class ConversationFragment extends Fragment { if (type == RECIEVED) { if (item.getConversation().getMode() == Conversation.MODE_MULTI) { - if (item.getCounterpart() != null) { - viewHolder.contact_picture - .setImageBitmap(mBitmapCache.get(item - .getCounterpart(), null, - getActivity() - .getApplicationContext())); - } else { - viewHolder.contact_picture - .setImageBitmap(mBitmapCache.get( - item.getConversation().getName( - useSubject), null, - getActivity() - .getApplicationContext())); - } + viewHolder.contact_picture.setImageBitmap(mBitmapCache + .get(item.getCounterpart(), null, getActivity() + .getApplicationContext())); + viewHolder.contact_picture + .setOnClickListener(new OnClickListener() { + + @Override + public void onClick(View v) { + highlightInConference(item.getCounterpart()); + } + }); } } @@ -461,6 +458,22 @@ public class ConversationFragment extends Fragment { return view; } + protected void highlightInConference(String nick) { + if (chatMsg.getText().toString().isEmpty()) { + chatMsg.setText(nick+": "); + } else { + String oldString = chatMsg.getText().toString(); + if (oldString.endsWith(" ")) { + chatMsg.setText(oldString+nick+" "); + } else { + chatMsg.setText(oldString+" "+nick+" "); + } + } + int position = chatMsg.length(); + Editable etext = chatMsg.getText(); + Selection.setSelection(etext, position); + } + protected Bitmap findSelfPicture() { SharedPreferences sharedPref = PreferenceManager .getDefaultSharedPreferences(getActivity() |