mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-15 21:45:07 -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 (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()
|
||||||
|
Loading…
Reference in New Issue
Block a user