aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2014-03-13 13:28:16 +0100
committerDaniel Gultsch <daniel@gultsch.de>2014-03-13 13:28:16 +0100
commit53fa87b414b87de73a79f0e60aa1a4d7d21c3dc9 (patch)
tree2984a7fa06196135a022e614b5ce01cc4eeec86c /src
parenteec39066928c65bc7d2a36913ec21f83c5a763b6 (diff)
removed unnecessary uihelper method
Diffstat (limited to 'src')
-rw-r--r--src/eu/siacs/conversations/ui/ConversationActivity.java2
-rw-r--r--src/eu/siacs/conversations/ui/ConversationFragment.java7
-rw-r--r--src/eu/siacs/conversations/ui/MucDetailsActivity.java2
-rw-r--r--src/eu/siacs/conversations/ui/NewConversationActivity.java2
-rw-r--r--src/eu/siacs/conversations/utils/UIHelper.java10
5 files changed, 7 insertions, 16 deletions
diff --git a/src/eu/siacs/conversations/ui/ConversationActivity.java b/src/eu/siacs/conversations/ui/ConversationActivity.java
index a4309cd0..e471d46d 100644
--- a/src/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/eu/siacs/conversations/ui/ConversationActivity.java
@@ -179,7 +179,7 @@ public class ConversationActivity extends XmppActivity {
.setText(UIHelper.readableTimeDifference(conv.getLatestMessage().getTimeSent()));
ImageView imageView = (ImageView) view.findViewById(R.id.conversation_image);
- imageView.setImageBitmap(UIHelper.getContactPicture(getItem(position).getContact(), 200, activity.getApplicationContext()));
+ imageView.setImageBitmap(UIHelper.getContactPicture(conv.getContact(), conv.getName(),200, activity.getApplicationContext()));
return view;
}
diff --git a/src/eu/siacs/conversations/ui/ConversationFragment.java b/src/eu/siacs/conversations/ui/ConversationFragment.java
index 208f6f6f..2aabec87 100644
--- a/src/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/eu/siacs/conversations/ui/ConversationFragment.java
@@ -563,12 +563,7 @@ public class ConversationFragment extends Fragment {
if (bitmaps.containsKey(name)) {
return bitmaps.get(name);
} else {
- Bitmap bm;
- if (contact == null) {
- bm = UIHelper.getContactPictureByName(name, 200);
- } else {
- bm = UIHelper.getContactPicture(contact, 200, context);
- }
+ Bitmap bm = UIHelper.getContactPicture(contact, name, 200, context);
bitmaps.put(name, bm);
return bm;
}
diff --git a/src/eu/siacs/conversations/ui/MucDetailsActivity.java b/src/eu/siacs/conversations/ui/MucDetailsActivity.java
index 124fdadc..5bd3556c 100644
--- a/src/eu/siacs/conversations/ui/MucDetailsActivity.java
+++ b/src/eu/siacs/conversations/ui/MucDetailsActivity.java
@@ -162,7 +162,7 @@ public class MucDetailsActivity extends XmppActivity {
role.setText(getReadableRole(contact.getRole()));
ImageView imageView = (ImageView) view
.findViewById(R.id.contact_photo);
- imageView.setImageBitmap(UIHelper.getContactPictureByName(contact.getName(), 90));
+ imageView.setImageBitmap(UIHelper.getContactPicture(null,contact.getName(), 90,this.getApplicationContext()));
membersView.addView(view);
}
}
diff --git a/src/eu/siacs/conversations/ui/NewConversationActivity.java b/src/eu/siacs/conversations/ui/NewConversationActivity.java
index e4fb6d14..0ad830ec 100644
--- a/src/eu/siacs/conversations/ui/NewConversationActivity.java
+++ b/src/eu/siacs/conversations/ui/NewConversationActivity.java
@@ -137,7 +137,7 @@ public class NewConversationActivity extends XmppActivity {
contactJid.setText(contact.getJid());
ImageView imageView = (ImageView) view
.findViewById(R.id.contact_photo);
- imageView.setImageBitmap(UIHelper.getContactPicture(contact,90,this.getContext()));
+ imageView.setImageBitmap(UIHelper.getContactPicture(contact,null,90,this.getContext()));
return view;
}
};
diff --git a/src/eu/siacs/conversations/utils/UIHelper.java b/src/eu/siacs/conversations/utils/UIHelper.java
index 528a0bb2..544f9429 100644
--- a/src/eu/siacs/conversations/utils/UIHelper.java
+++ b/src/eu/siacs/conversations/utils/UIHelper.java
@@ -91,9 +91,9 @@ public class UIHelper {
return bitmap;
}
- public static Bitmap getContactPicture(Contact contact, int size, Context context) {
+ public static Bitmap getContactPicture(Contact contact, String fallback, int size, Context context) {
if (contact==null) {
- return getUnknownContactPicture(contact.getDisplayName(), size);
+ return getUnknownContactPicture(fallback, size);
}
String uri = contact.getProfilePhoto();
if (uri==null) {
@@ -171,7 +171,7 @@ public class UIHelper {
conversation.getName(),
(int) res
.getDimension(android.R.dimen.notification_large_icon_width)));*/
- mBuilder.setLargeIcon(UIHelper.getContactPicture(conversation.getContact(), (int) res
+ mBuilder.setLargeIcon(UIHelper.getContactPicture(conversation.getContact(), conversation.getName(), (int) res
.getDimension(android.R.dimen.notification_large_icon_width), context));
mBuilder.setContentTitle(conversation.getName());
if (notify) {
@@ -315,8 +315,4 @@ public class UIHelper {
}
return getUnknownContactPicture(account.getJid(), size);
}
-
- public static Bitmap getContactPictureByName(String name, int size) {
- return getUnknownContactPicture(name, size);
- }
}