highlight people in conferences by clicken on their picture

This commit is contained in:
Daniel Gultsch 2014-05-20 11:44:43 +02:00
parent 13f9f23946
commit f79d92ab67

View File

@ -392,20 +392,17 @@ public class ConversationFragment extends Fragment {
if (type == RECIEVED) { if (type == RECIEVED) {
if (item.getConversation().getMode() == Conversation.MODE_MULTI) { if (item.getConversation().getMode() == Conversation.MODE_MULTI) {
if (item.getCounterpart() != null) { viewHolder.contact_picture.setImageBitmap(mBitmapCache
viewHolder.contact_picture .get(item.getCounterpart(), null, getActivity()
.setImageBitmap(mBitmapCache.get(item .getApplicationContext()));
.getCounterpart(), null, viewHolder.contact_picture
getActivity() .setOnClickListener(new OnClickListener() {
.getApplicationContext()));
} else { @Override
viewHolder.contact_picture public void onClick(View v) {
.setImageBitmap(mBitmapCache.get( highlightInConference(item.getCounterpart());
item.getConversation().getName( }
useSubject), null, });
getActivity()
.getApplicationContext()));
}
} }
} }
@ -461,6 +458,22 @@ public class ConversationFragment extends Fragment {
return view; 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() { protected Bitmap findSelfPicture() {
SharedPreferences sharedPref = PreferenceManager SharedPreferences sharedPref = PreferenceManager
.getDefaultSharedPreferences(getActivity() .getDefaultSharedPreferences(getActivity()