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

View File

@ -102,7 +102,11 @@ public class ThreadRecord extends DisplayRecord {
@Override @Override
public CharSequence getDisplayBody(@NonNull Context context) { 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); return context.getString(R.string.groupUpdated);
} else if (isOpenGroupInvitation()) { } else if (isOpenGroupInvitation()) {
return context.getString(R.string.communityInvitation); return context.getString(R.string.communityInvitation);

View File

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