From e8b77d0dfaad75f655b77a10dbc2f7747fc85297 Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Sun, 3 Mar 2024 15:42:05 -0300 Subject: [PATCH] fix(list-members fragment): fix compiler cries and readd some code --- .../android/fragments/ListMembersFragment.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ListMembersFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ListMembersFragment.java index 284482da87..83259e1551 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ListMembersFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ListMembersFragment.java @@ -32,6 +32,7 @@ import org.joinmastodon.android.ui.viewholders.AccountViewHolder; import org.parceler.Parcels; +import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.List; @@ -130,9 +131,9 @@ public boolean onOptionsItemSelected(MenuItem item){ if(id==R.id.select){ enterSelectionMode(); }else if(id==R.id.select_all){ -// for(AccountViewModel a:data){ -// selectedAccounts.add(a.account.id); -// } + for(AccountViewModel a:(ArrayList)data){ + selectedAccounts.add(a.account.id); + } enterSelectionMode(); } return true; @@ -309,10 +310,10 @@ public void onError(ErrorResponse error){ private void removeAccountRows(Set ids){ for(int i=data.size()-1;i>=0;i--){ -// if(ids.contains(data.get(i).account.id)){ -// data.remove(i); -// list.getAdapter().notifyItemRemoved(i); -// } + if(ids.contains(((ArrayList)data).get(i).account.id)){ + data.remove(i); + list.getAdapter().notifyItemRemoved(i); + } } }