SES-2814 - show empty state when conversations are empty

This commit is contained in:
ThomasSession 2024-10-22 13:49:45 +11:00
parent c9c9078c2e
commit 61fe7b17d0
3 changed files with 11 additions and 7 deletions

View File

@ -1123,8 +1123,8 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
val openGroup = viewModel.openGroup
// Get the correct placeholder text for this type of empty conversation
val isNoteToSelf = recipient.isLocalNumber
val txtCS: CharSequence = when {
// note to self
recipient.isLocalNumber -> getString(R.string.noteToSelfEmpty)
// If this is a community which we cannot write to
@ -1141,8 +1141,8 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
.format()
}
recipient.isGroupRecipient -> {
// If this is a group or community that we CAN send messages to
// 10n1 and groups
recipient.is1on1 || recipient.isGroupRecipient -> {
Phrase.from(applicationContext, R.string.groupNoMessages)
.put(GROUP_NAME_KEY, recipient.toShortString())
.format()

View File

@ -102,7 +102,11 @@ public class ThreadRecord extends DisplayRecord {
@Override
public CharSequence getDisplayBody(@NonNull Context context) {
if (isGroupUpdateMessage()) {
// no need to display anything if there are no messages
if(lastMessage == null){
return "";
}
else if (isGroupUpdateMessage()) {
return context.getString(R.string.groupUpdated);
} else if (isOpenGroupInvitation()) {
return context.getString(R.string.communityInvitation);

View File

@ -271,14 +271,14 @@
<TextView
android:padding="@dimen/medium_spacing"
android:textSize="@dimen/small_font_size"
android:textColor="?android:textColorSecondary"
style="@style/Signal.Text.Preview"
android:textColor="?android:textColorTertiary"
android:textAlignment="center"
android:id="@+id/placeholderText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/large_spacing"
app:layout_constraintTop_toBottomOf="@+id/outdatedBanner"
android:elevation="8dp"
android:contentDescription="@string/AccessibilityId_control_message"
tools:text="Some Control Message Text"
/>