Messaging: Finish after no more contacts are blocked

The view doesn't have a "no items available" element and it doesn't
make sense to have one since the menu item is only visible once a contact
is blocked - so after removing the last blocked contact, simply return
back to the conversation list

Change-Id: I3372e26361f6919502cac6fd27ae849d559a4c05
This commit is contained in:
Michael W
2024-12-25 22:36:04 +01:00
parent e5eb059fbd
commit 0aa08c0c3b

View File

@@ -75,6 +75,7 @@ public class BlockedParticipantsFragment extends Fragment
* An adapter to display ParticipantListItemView based on ParticipantData.
*/
private class BlockedParticipantListAdapter extends CursorAdapter {
public BlockedParticipantListAdapter(final Context context, final Cursor cursor) {
super(context, cursor, 0);
}
@@ -96,5 +97,8 @@ public class BlockedParticipantsFragment extends Fragment
@Override
public void onBlockedParticipantsCursorUpdated(Cursor cursor) {
mAdapter.swapCursor(cursor);
if (mAdapter.getCount() == 0) {
requireActivity().finish();
}
}
}