Skip to content

Commit

Permalink
fix(list-members fragment): fix compiler cries and readd some code
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasGGamerM committed Mar 3, 2024
1 parent f880d4b commit e8b77d0
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<AccountViewModel>)data){
selectedAccounts.add(a.account.id);
}
enterSelectionMode();
}
return true;
Expand Down Expand Up @@ -309,10 +310,10 @@ public void onError(ErrorResponse error){

private void removeAccountRows(Set<String> 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<AccountViewModel>)data).get(i).account.id)){
data.remove(i);
list.getAdapter().notifyItemRemoved(i);
}
}
}

Expand Down

0 comments on commit e8b77d0

Please sign in to comment.