From 0aa08c0c3b854a20780639067ff25fb13601f1e9 Mon Sep 17 00:00:00 2001 From: Michael W Date: Wed, 25 Dec 2024 22:36:04 +0100 Subject: [PATCH] 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 --- src/com/android/messaging/ui/BlockedParticipantsFragment.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/android/messaging/ui/BlockedParticipantsFragment.java b/src/com/android/messaging/ui/BlockedParticipantsFragment.java index d80bb30..6dcb8f4 100644 --- a/src/com/android/messaging/ui/BlockedParticipantsFragment.java +++ b/src/com/android/messaging/ui/BlockedParticipantsFragment.java @@ -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(); + } } }