Enforce two line limit on group description.

Sorry.
This commit is contained in:
Cody Henthorne
2021-05-19 11:57:53 -04:00
committed by GitHub
parent 5d5d61d8ed
commit f890ae8ddc
11 changed files with 75 additions and 57 deletions

View File

@@ -19,6 +19,7 @@ import androidx.core.widget.ImageViewCompat;
import org.signal.core.util.concurrent.SignalExecutors;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.components.AvatarImageView;
import org.thoughtcrime.securesms.components.emoji.EmojiTextView;
import org.thoughtcrime.securesms.contacts.avatars.FallbackContactPhoto;
import org.thoughtcrime.securesms.contacts.avatars.ResourceContactPhoto;
import org.thoughtcrime.securesms.database.DatabaseFactory;
@@ -31,7 +32,7 @@ public class ConversationBannerView extends ConstraintLayout {
private TextView contactTitle;
private TextView contactAbout;
private TextView contactSubtitle;
private TextView contactDescription;
private EmojiTextView contactDescription;
private View tapToView;
public ConversationBannerView(Context context) {
@@ -91,6 +92,10 @@ public class ConversationBannerView extends ConstraintLayout {
contactDescription.setVisibility(TextUtils.isEmpty(description) ? GONE : VISIBLE);
}
public @NonNull EmojiTextView getDescription() {
return contactDescription;
}
public void showBackgroundBubble(boolean enabled) {
if (enabled) {
setBackgroundResource(R.drawable.wallpaper_bubble_background_12);

View File

@@ -541,13 +541,15 @@ public class ConversationFragment extends LoggingFragment {
} else {
conversationBanner.setLinkifyDescription(true);
boolean linkifyWebLinks = recipientInfo.getMessageRequestState() == MessageRequestState.NONE;
conversationBanner.setDescription(GroupDescriptionUtil.style(context,
recipientInfo.getGroupDescription(),
linkifyWebLinks,
() -> GroupDescriptionDialog.show(getChildFragmentManager(),
recipient.getDisplayName(context),
recipientInfo.getGroupDescription(),
linkifyWebLinks)));
conversationBanner.showDescription();
GroupDescriptionUtil.setText(context,
conversationBanner.getDescription(),
recipientInfo.getGroupDescription(),
linkifyWebLinks,
() -> GroupDescriptionDialog.show(getChildFragmentManager(),
recipient.getDisplayName(context),
recipientInfo.getGroupDescription(),
linkifyWebLinks));
}
} else {
final String description;