mirror of
https://github.com/oxen-io/session-android.git
synced 2025-04-21 11:31:30 +00:00
Add deselect to batch selection mode
This commit is contained in:
parent
f3fdde6040
commit
c7b39eca11
@ -69,9 +69,13 @@ public class ConversationListAdapter extends CursorAdapter implements AbsListVie
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addToBatchSet(long threadId) {
|
public void toggleThreadInBatchSet(long threadId) {
|
||||||
|
if (batchSet.contains(threadId)) {
|
||||||
|
batchSet.remove(threadId);
|
||||||
|
} else {
|
||||||
batchSet.add(threadId);
|
batchSet.add(threadId);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Set<Long> getBatchSelections() {
|
public Set<Long> getBatchSelections() {
|
||||||
return batchSet;
|
return batchSet;
|
||||||
|
@ -106,7 +106,7 @@ public class ConversationListFragment extends SherlockListFragment
|
|||||||
headerView.getDistributionType());
|
headerView.getDistributionType());
|
||||||
} else {
|
} else {
|
||||||
ConversationListAdapter adapter = (ConversationListAdapter)getListAdapter();
|
ConversationListAdapter adapter = (ConversationListAdapter)getListAdapter();
|
||||||
adapter.addToBatchSet(headerView.getThreadId());
|
adapter.toggleThreadInBatchSet(headerView.getThreadId());
|
||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -146,7 +146,7 @@ public class ConversationListFragment extends SherlockListFragment
|
|||||||
batchMode = true;
|
batchMode = true;
|
||||||
|
|
||||||
adapter.initializeBatchMode(true);
|
adapter.initializeBatchMode(true);
|
||||||
adapter.addToBatchSet(((ConversationListItem) v).getThreadId());
|
adapter.toggleThreadInBatchSet(((ConversationListItem) v).getThreadId());
|
||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user