kopia lustrzana https://github.com/ryukoposting/Signal-Android
Fix diplay issue with note to self banner.
rodzic
e85adad2b4
commit
8efd07b3e2
|
@ -2100,7 +2100,7 @@ public class ConversationParentFragment extends Fragment
|
|||
unverifiedBannerView.get().hide();
|
||||
}
|
||||
|
||||
titleView.setVerified(isSecureText && identityRecords.isVerified());
|
||||
titleView.setVerified(isSecureText && identityRecords.isVerified() && !recipient.get().isSelf());
|
||||
|
||||
future.set(true);
|
||||
}
|
||||
|
@ -2634,7 +2634,7 @@ public class ConversationParentFragment extends Fragment
|
|||
|
||||
Log.i(TAG, "onModified(" + recipient.getId() + ") " + recipient.getRegistered());
|
||||
titleView.setTitle(glideRequests, recipient);
|
||||
titleView.setVerified(identityRecords.isVerified());
|
||||
titleView.setVerified(identityRecords.isVerified() && !recipient.isSelf());
|
||||
setBlockedUserState(recipient, isSecureText, isDefaultSms);
|
||||
updateReminders();
|
||||
updateDefaultSubscriptionId(recipient.getDefaultSubscriptionId());
|
||||
|
|
|
@ -2,6 +2,8 @@ package org.thoughtcrime.securesms.conversation;
|
|||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
@ -30,6 +32,9 @@ import org.thoughtcrime.securesms.util.ViewUtil;
|
|||
|
||||
public class ConversationTitleView extends RelativeLayout {
|
||||
|
||||
private static final String STATE_ROOT = "root";
|
||||
private static final String STATE_IS_SELF = "is_self";
|
||||
|
||||
private AvatarView avatar;
|
||||
private BadgeImageView badge;
|
||||
private TextView title;
|
||||
|
@ -39,6 +44,7 @@ public class ConversationTitleView extends RelativeLayout {
|
|||
private View verifiedSubtitle;
|
||||
private View expirationBadgeContainer;
|
||||
private TextView expirationBadgeTime;
|
||||
private boolean isSelf;
|
||||
|
||||
public ConversationTitleView(Context context) {
|
||||
this(context, null);
|
||||
|
@ -66,7 +72,33 @@ public class ConversationTitleView extends RelativeLayout {
|
|||
ViewUtil.setTextViewGravityStart(this.subtitle, getContext());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected @NonNull Parcelable onSaveInstanceState() {
|
||||
Bundle bundle = new Bundle();
|
||||
|
||||
bundle.putParcelable(STATE_ROOT, super.onSaveInstanceState());
|
||||
bundle.putBoolean(STATE_IS_SELF, isSelf);
|
||||
|
||||
return bundle;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onRestoreInstanceState(Parcelable state) {
|
||||
if (state instanceof Bundle) {
|
||||
Parcelable rootState = ((Bundle) state).getParcelable(STATE_ROOT);
|
||||
super.onRestoreInstanceState(rootState);
|
||||
|
||||
isSelf = ((Bundle) state).getBoolean(STATE_IS_SELF, false);
|
||||
} else {
|
||||
super.onRestoreInstanceState(state);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void showExpiring(@NonNull LiveRecipient recipient) {
|
||||
isSelf = recipient.get().isSelf();
|
||||
|
||||
expirationBadgeTime.setText(ExpirationUtil.getExpirationAbbreviatedDisplayValue(getContext(), recipient.get().getExpiresInSeconds()));
|
||||
expirationBadgeContainer.setVisibility(View.VISIBLE);
|
||||
updateSubtitleVisibility();
|
||||
|
@ -78,6 +110,8 @@ public class ConversationTitleView extends RelativeLayout {
|
|||
}
|
||||
|
||||
public void setTitle(@NonNull GlideRequests glideRequests, @Nullable Recipient recipient) {
|
||||
isSelf = recipient != null && recipient.isSelf();
|
||||
|
||||
this.subtitleContainer.setVisibility(View.VISIBLE);
|
||||
|
||||
if (recipient == null) setComposeTitle();
|
||||
|
@ -169,7 +203,7 @@ public class ConversationTitleView extends RelativeLayout {
|
|||
|
||||
private void setSelfTitle() {
|
||||
this.title.setText(R.string.note_to_self);
|
||||
this.subtitleContainer.setVisibility(View.GONE);
|
||||
updateSubtitleVisibility();
|
||||
}
|
||||
|
||||
private void setIndividualRecipientTitle(@NonNull Recipient recipient) {
|
||||
|
@ -177,15 +211,14 @@ public class ConversationTitleView extends RelativeLayout {
|
|||
this.title.setText(displayName);
|
||||
this.subtitle.setText(null);
|
||||
updateSubtitleVisibility();
|
||||
updateVerifiedSubtitleVisibility();
|
||||
}
|
||||
|
||||
private void updateVerifiedSubtitleVisibility() {
|
||||
verifiedSubtitle.setVisibility(subtitle.getVisibility() != VISIBLE && verified.getVisibility() == VISIBLE ? VISIBLE : GONE);
|
||||
verifiedSubtitle.setVisibility(!isSelf && subtitle.getVisibility() != VISIBLE && verified.getVisibility() == VISIBLE ? VISIBLE : GONE);
|
||||
}
|
||||
|
||||
private void updateSubtitleVisibility() {
|
||||
subtitle.setVisibility(expirationBadgeContainer.getVisibility() != VISIBLE && !TextUtils.isEmpty(subtitle.getText()) ? VISIBLE : GONE);
|
||||
subtitle.setVisibility(!isSelf && expirationBadgeContainer.getVisibility() != VISIBLE && !TextUtils.isEmpty(subtitle.getText()) ? VISIBLE : GONE);
|
||||
updateVerifiedSubtitleVisibility();
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue