verified-icon not always visible in chat-titlebar #120

This commit is contained in:
daniel.boehrs
2018-11-09 15:23:32 +01:00
parent b459e9bd0e
commit fa8e9cefd3
4 changed files with 13 additions and 44 deletions
@@ -68,16 +68,6 @@
android:textColor="?attr/conversation_list_item_contact_color"
tools:text="Jules Bonnot" />
<ImageView
android:id="@+id/verified_indicator"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_gravity="center"
android:src="@drawable/ic_verified"
android:visibility="gone"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" />
</LinearLayout>
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
+10 -26
View File
@@ -48,33 +48,17 @@
android:layout_toEndOf="@id/contact_photo_image"
android:layout_toRightOf="@id/contact_photo_image">
<LinearLayout
android:orientation="horizontal"
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/title"
style="@style/TextSecure.TitleTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/title"
style="@style/TextSecure.TitleTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="5dp"
android:ellipsize="end"
android:maxLines="1"
android:textSize="18dp"
android:transitionName="recipient_name"
tools:text="Jules Bonnot" />
<ImageView
android:id="@+id/verified_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:src="@drawable/ic_verified"
android:visibility="gone" />
</LinearLayout>
android:layout_height="wrap_content"
android:drawablePadding="5dp"
android:ellipsize="end"
android:maxLines="1"
android:textSize="18dp"
android:transitionName="recipient_name"
tools:text="Jules Bonnot" />
<org.thoughtcrime.securesms.components.emoji.EmojiTextView
android:id="@+id/subtitle"
@@ -81,7 +81,6 @@ public class ConversationListItem extends RelativeLayout
private TextView archivedView;
private DeliveryStatusView deliveryStatusIndicator;
private ImageView unreadIndicator;
private ImageView verifiedIndicator;
private ImageView groupIndicator;
private long lastSeen;
@@ -106,7 +105,6 @@ public class ConversationListItem extends RelativeLayout
this.contactPhotoImage = findViewById(R.id.contact_photo_image);
this.archivedView = findViewById(R.id.archived);
this.unreadIndicator = findViewById(R.id.unread_indicator);
this.verifiedIndicator = findViewById(R.id.verified_indicator);
this.groupIndicator = findViewById(R.id.group_indicator);
ViewUtil.setTextViewGravityStart(this.fromView, getContext());
@@ -171,8 +169,7 @@ public class ConversationListItem extends RelativeLayout
else {
this.contactPhotoImage.setAvatar(glideRequests, recipient, true);
}
verifiedIndicator.setVisibility(thread.isVerified() ? VISIBLE : GONE);
fromView.setCompoundDrawablesWithIntrinsicBounds(0, 0, thread.isVerified() ? R.drawable.ic_verified : 0, 0);
groupIndicator.setVisibility(recipient.isGroupRecipient() ? VISIBLE : GONE);
int color = ResUtil.getColor(getContext(), R.attr.conversation_list_item_contact_color);
groupIndicator.setColorFilter(color);
@@ -26,7 +26,6 @@ public class ConversationTitleView extends RelativeLayout {
private AvatarImageView avatar;
private TextView title;
private TextView subtitle;
private ImageView verified;
public ConversationTitleView(Context context) {
this(context, null);
@@ -45,7 +44,6 @@ public class ConversationTitleView extends RelativeLayout {
this.content = ViewUtil.findById(this, R.id.content);
this.title = ViewUtil.findById(this, R.id.title);
this.subtitle = ViewUtil.findById(this, R.id.subtitle);
this.verified = ViewUtil.findById(this, R.id.verified_indicator);
this.avatar = ViewUtil.findById(this, R.id.contact_photo_image);
ViewUtil.setTextViewGravityStart(this.title, getContext());
@@ -61,7 +59,7 @@ public class ConversationTitleView extends RelativeLayout {
} else if (recipient != null && recipient.isMuted()) {
title.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_volume_off_white_18dp, 0, 0, 0);
} else*/ {
title.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
//title.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
}
if (dcChat != null) {
@@ -70,7 +68,7 @@ public class ConversationTitleView extends RelativeLayout {
}
public void setVerified(boolean verified) {
this.verified.setVisibility(verified ? View.VISIBLE : View.GONE);
title.setCompoundDrawablesWithIntrinsicBounds(0, 0, verified ? R.drawable.ic_verified : 0, 0);
}
public void hideAvatar() {