mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-24 17:52:17 -05:00
highlight people in conferences by clicken on their picture
This commit is contained in:
parent
13f9f23946
commit
f79d92ab67
@ -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()
|
||||
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()));
|
||||
.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()
|
||||
|
Loading…
Reference in New Issue
Block a user