Show correct message for empty archived screen.

This commit is contained in:
Sagar
2025-04-18 01:24:42 +05:30
committed by Cody Henthorne
parent 6ce01c6b0e
commit 050dcb3eb1
5 changed files with 34 additions and 1 deletions

View File

@@ -39,6 +39,7 @@ class ConversationListAdapter extends ListAdapter<Conversation, RecyclerView.Vie
private static final int TYPE_CLEAR_FILTER_FOOTER = 6;
private static final int TYPE_CLEAR_FILTER_EMPTY = 7;
private static final int TYPE_CHAT_FOLDER_EMPTY = 8;
private static final int TYPE_EMPTY_ARCHIVED = 9;
private enum Payload {
TYPING_INDICATOR,
@@ -113,6 +114,9 @@ class ConversationListAdapter extends ListAdapter<Conversation, RecyclerView.Vie
} else if (viewType == TYPE_HEADER) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.dsl_section_header, parent, false);
return new HeaderViewHolder(v);
} else if (viewType == TYPE_EMPTY_ARCHIVED) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.conversation_list_archived_empty_state, parent, false);
return new HeaderViewHolder(v);
} else if (viewType == TYPE_EMPTY) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.conversation_list_empty_state, parent, false);
return new HeaderViewHolder(v);
@@ -240,6 +244,8 @@ class ConversationListAdapter extends ListAdapter<Conversation, RecyclerView.Vie
return TYPE_CHAT_FOLDER_EMPTY;
case THREAD:
return TYPE_THREAD;
case ARCHIVED_EMPTY:
return TYPE_EMPTY_ARCHIVED;
case EMPTY:
return TYPE_EMPTY;
default:

View File

@@ -115,6 +115,8 @@ abstract class ConversationListDataSource implements PagedDataSource<Long, Conve
return Collections.singletonList(new Conversation(ConversationReader.buildThreadRecordForType(Conversation.Type.CONVERSATION_FILTER_EMPTY,
0,
showConversationFooterTip)));
} else if (this instanceof ArchivedConversationListDataSource) {
return Collections.singletonList(new Conversation(ConversationReader.buildThreadRecordForType(Conversation.Type.ARCHIVED_EMPTY, 0, false)));
} else if (chatFolder.getFolderType() != ChatFolderRecord.FolderType.ALL) {
return Collections.singletonList(new Conversation(ConversationReader.buildThreadRecordForType(Conversation.Type.CHAT_FOLDER_EMPTY, 0, false)));
} else {

View File

@@ -46,6 +46,7 @@ public class Conversation {
CONVERSATION_FILTER_FOOTER,
CONVERSATION_FILTER_EMPTY,
CHAT_FOLDER_EMPTY,
EMPTY
ARCHIVED_EMPTY,
EMPTY,
}
}