From 5874a3b9cdaf548e1de59078c9d6d28538dcea2c Mon Sep 17 00:00:00 2001 From: Sagar Date: Fri, 10 Jan 2025 00:30:35 +0530 Subject: [PATCH] Fixes #13870 - Showing SwipeProgressBar on Remove/Block contact --- .../thoughtcrime/securesms/ContactSelectionListFragment.java | 4 ++++ .../org/thoughtcrime/securesms/NewConversationActivity.java | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/ContactSelectionListFragment.java b/app/src/main/java/org/thoughtcrime/securesms/ContactSelectionListFragment.java index 1a9978b5ee0..8c8c06b4cfd 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ContactSelectionListFragment.java +++ b/app/src/main/java/org/thoughtcrime/securesms/ContactSelectionListFragment.java @@ -570,6 +570,10 @@ public void setRefreshing(boolean refreshing) { swipeRefresh.setRefreshing(refreshing); } + public boolean isRefreshing() { + return swipeRefresh.isRefreshing(); + } + public void reset() { contactSearchMediator.clearSelection(); fastScroller.setVisibility(View.GONE); diff --git a/app/src/main/java/org/thoughtcrime/securesms/NewConversationActivity.java b/app/src/main/java/org/thoughtcrime/securesms/NewConversationActivity.java index 2dfb02dd8ce..7af97ff622a 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/NewConversationActivity.java +++ b/app/src/main/java/org/thoughtcrime/securesms/NewConversationActivity.java @@ -356,6 +356,7 @@ public boolean onLongClick(View anchorView, ContactSearchKey contactSearchKey, R recipient, () -> { disposables.add(viewModel.blockContact(recipient).subscribe(() -> { + handleManualRefresh(); displaySnackbar(R.string.NewConversationActivity__s_has_been_blocked, recipient.getDisplayName(this)); contactsFragment.reset(); })); @@ -381,8 +382,9 @@ private void displayRemovalDialog(@NonNull Recipient recipient) { .setPositiveButton(R.string.NewConversationActivity__remove, (dialog, which) -> { disposables.add(viewModel.hideContact(recipient).subscribe(() -> { - onRefresh(); + handleManualRefresh(); displaySnackbar(R.string.NewConversationActivity__s_has_been_removed, recipient.getDisplayName(this)); + contactsFragment.reset(); })); } )