mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
Don't add "archive (n)" placeholder to list of batch selected
Fixes #4750 // FREEBIE
This commit is contained in:
parent
cdb122d3d1
commit
3bf8052811
@ -107,16 +107,6 @@ public class ConversationListAdapter extends CursorRecyclerViewAdapter<Conversat
|
||||
}
|
||||
}
|
||||
|
||||
public void onSwiped(@NonNull RecyclerView.ViewHolder viewHolder, boolean archived) {
|
||||
ConversationListItem listItem = (ConversationListItem)viewHolder.itemView;
|
||||
|
||||
if (!archived) {
|
||||
DatabaseFactory.getThreadDatabase(getContext()).archiveConversation(listItem.getThreadId());
|
||||
} else {
|
||||
DatabaseFactory.getThreadDatabase(getContext()).unarchiveConversation(listItem.getThreadId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewHolder onCreateItemViewHolder(ViewGroup parent, int viewType) {
|
||||
if (viewType == MESSAGE_TYPE_SWITCH_ARCHIVE) {
|
||||
@ -182,7 +172,7 @@ public class ConversationListAdapter extends CursorRecyclerViewAdapter<Conversat
|
||||
public void toggleThreadInBatchSet(long threadId) {
|
||||
if (batchSet.contains(threadId)) {
|
||||
batchSet.remove(threadId);
|
||||
} else {
|
||||
} else if (threadId != -1) {
|
||||
batchSet.add(threadId);
|
||||
}
|
||||
}
|
||||
@ -203,7 +193,8 @@ public class ConversationListAdapter extends CursorRecyclerViewAdapter<Conversat
|
||||
|
||||
public void selectAllThreads() {
|
||||
for (int i = 0; i < getItemCount(); i++) {
|
||||
batchSet.add(getThreadRecord(getCursorAtPositionOrThrow(i)).getThreadId());
|
||||
long threadId = getThreadRecord(getCursorAtPositionOrThrow(i)).getThreadId();
|
||||
if (threadId != -1) batchSet.add(threadId);
|
||||
}
|
||||
this.notifyDataSetChanged();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user