mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +00:00
Switch to QuickContactBadge.
This commit is contained in:
parent
44c221c9f1
commit
63250b33a8
BIN
res/drawable-hdpi/ic_contact_picture.png
Normal file
BIN
res/drawable-hdpi/ic_contact_picture.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.8 KiB |
BIN
res/drawable-mdpi/ic_contact_picture.png
Normal file
BIN
res/drawable-mdpi/ic_contact_picture.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.6 KiB |
BIN
res/drawable-xhdpi/ic_contact_picture.png
Normal file
BIN
res/drawable-xhdpi/ic_contact_picture.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB |
@ -12,15 +12,7 @@
|
||||
android:visibility="invisible"
|
||||
android:src="@drawable/ic_sms_unread_msg_indicator" />
|
||||
|
||||
<!-- <android.widget.QuickContactBadge android:id="@+id/contact_photo"-->
|
||||
<!-- android:layout_width="60dp"-->
|
||||
<!-- android:layout_height="60dp"-->
|
||||
<!-- android:cropToPadding="true"-->
|
||||
<!-- android:scaleType="centerCrop"-->
|
||||
<!-- android:layout_toRightOf="@id/unread_indicator"-->
|
||||
<!-- android:visibility="gone" />-->
|
||||
|
||||
<ImageView android:id="@+id/contact_photo"
|
||||
<QuickContactBadge android:id="@+id/contact_photo"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:cropToPadding="true"
|
||||
@ -101,4 +93,3 @@
|
||||
android:ellipsize="end" />
|
||||
|
||||
</org.thoughtcrime.securesms.ConversationHeaderView>
|
||||
|
@ -29,15 +29,11 @@
|
||||
/>
|
||||
|
||||
<ListView android:id="@android:id/list"
|
||||
style="?android:attr/listViewWhiteStyle"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:drawSelectorOnTop="false"
|
||||
android:scrollbarStyle="insideOverlay"
|
||||
android:fadingEdgeLength="16dip"
|
||||
android:background="@android:color/white"
|
||||
android:cacheColorHint="@android:color/white"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_above="@id/search_text" />
|
||||
|
||||
|
@ -17,8 +17,6 @@
|
||||
package org.thoughtcrime.securesms;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.text.Spannable;
|
||||
import android.text.format.DateUtils;
|
||||
import android.text.style.StyleSpan;
|
||||
@ -27,7 +25,7 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.QuickContactBadge;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
@ -57,14 +55,13 @@ public class ConversationHeaderView extends RelativeLayout {
|
||||
private View unreadIndicator;
|
||||
private View keyIndicator;
|
||||
private CheckBox checkbox;
|
||||
private ImageView contactPhoto;
|
||||
private QuickContactBadge contactPhoto;
|
||||
|
||||
public ConversationHeaderView(Context context, boolean first) {
|
||||
this(context, (Set<Long>)null);
|
||||
|
||||
this.first = true;
|
||||
contactPhoto.setVisibility(View.GONE);
|
||||
this.setBackgroundColor(Color.TRANSPARENT);
|
||||
}
|
||||
|
||||
public ConversationHeaderView(Context context, Set<Long> selectedThreads) {
|
||||
@ -80,7 +77,7 @@ public class ConversationHeaderView extends RelativeLayout {
|
||||
this.dateView = (TextView)findViewById(R.id.date);
|
||||
this.unreadIndicator = findViewById(R.id.unread_indicator);
|
||||
this.keyIndicator = findViewById(R.id.key_indicator);
|
||||
this.contactPhoto = (ImageView)findViewById(R.id.contact_photo);
|
||||
this.contactPhoto = (QuickContactBadge)findViewById(R.id.contact_photo);
|
||||
this.checkbox = (CheckBox)findViewById(R.id.checkbox);
|
||||
|
||||
intializeListeners();
|
||||
@ -117,15 +114,11 @@ public class ConversationHeaderView extends RelativeLayout {
|
||||
if (batchMode) checkbox.setVisibility(View.VISIBLE);
|
||||
else checkbox.setVisibility(View.GONE);
|
||||
|
||||
if (!PreferenceManager.getDefaultSharedPreferences(context).getBoolean(ApplicationPreferencesActivity.CONVERSATION_ICONS_LIST_PREF, ApplicationPreferencesActivity.showIcon())) {
|
||||
contactPhoto.setVisibility(View.GONE);
|
||||
} else {
|
||||
contactPhoto.setImageBitmap(message.getRecipients().getPrimaryRecipient().getContactPhoto());
|
||||
contactPhoto.setBackgroundResource(R.drawable.light_border_background);
|
||||
contactPhoto.setImageBitmap(this.recipients.getPrimaryRecipient().getContactPhoto());
|
||||
contactPhoto.assignContactFromPhone(this.recipients.getPrimaryRecipient().getNumber(), true);
|
||||
contactPhoto.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void intializeListeners() {
|
||||
checkbox.setOnCheckedChangeListener(new CheckedChangedListener());
|
||||
|
Loading…
x
Reference in New Issue
Block a user