get rid of 'use phones self contact picture option'

This commit is contained in:
iNPUTmice 2014-07-31 15:18:55 +02:00
parent 990f0f6d73
commit 88d1bd356c
2 changed files with 5 additions and 18 deletions

View file

@ -62,11 +62,6 @@
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory <PreferenceCategory
android:title="@string/pref_ui_options"> android:title="@string/pref_ui_options">
<CheckBoxPreference
android:key="show_phone_selfcontact_picture"
android:title="@string/pref_use_phone_self_picture"
android:summary="@string/pref_use_phone_self_picture_summary"
android:defaultValue="true"/>
<CheckBoxPreference <CheckBoxPreference
android:key="use_subject_in_muc" android:key="use_subject_in_muc"
android:title="@string/pref_conference_name" android:title="@string/pref_conference_name"

View file

@ -13,10 +13,8 @@ import eu.siacs.conversations.utils.UIHelper;
import eu.siacs.conversations.xmpp.jingle.JingleConnection; import eu.siacs.conversations.xmpp.jingle.JingleConnection;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.preference.PreferenceManager;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -37,7 +35,7 @@ public class MessageAdapter extends ArrayAdapter<Message> {
private ConversationActivity activity; private ConversationActivity activity;
private Bitmap selfBitmap2; private Bitmap accountBitmap;
private BitmapCache mBitmapCache = new BitmapCache(); private BitmapCache mBitmapCache = new BitmapCache();
private DisplayMetrics metrics; private DisplayMetrics metrics;
@ -51,20 +49,14 @@ public class MessageAdapter extends ArrayAdapter<Message> {
} }
private Bitmap getSelfBitmap() { private Bitmap getSelfBitmap() {
if (this.selfBitmap2 == null) { if (this.accountBitmap == null) {
if (getCount() > 0) { if (getCount() > 0) {
SharedPreferences preferences = PreferenceManager this.accountBitmap = getItem(0)
.getDefaultSharedPreferences(getContext()); .getConversation().getAccount().getImage(getContext(), 48);
boolean showPhoneSelfContactPicture = preferences.getBoolean(
"show_phone_selfcontact_picture", true);
this.selfBitmap2 = UIHelper.getSelfContactPicture(getItem(0)
.getConversation().getAccount(), 48,
showPhoneSelfContactPicture, getContext());
} }
} }
return this.selfBitmap2; return this.accountBitmap;
} }
public void setOnContactPictureClicked(OnContactPictureClicked listener) { public void setOnContactPictureClicked(OnContactPictureClicked listener) {