Revert "Revert "Fix #443 again""

This reverts commit f63bbeee79.
This commit is contained in:
LucasGGamerM 2022-12-13 12:02:30 -03:00
parent 7aabc1fa76
commit f3f5e4a887
1 changed files with 4 additions and 0 deletions

View File

@ -240,13 +240,17 @@ public class InstanceChooserLoginFragment extends InstanceCatalogFragment{
if(chosenInstance!=null){
int idx=filteredData.indexOf(chosenInstance);
if(idx!=-1){
boolean found=false;
for(int i=0;i<list.getChildCount();i++){
RecyclerView.ViewHolder holder=list.getChildViewHolder(list.getChildAt(i));
if(holder.getAbsoluteAdapterPosition()==mergeAdapter.getPositionForAdapter(adapter)+idx && holder instanceof InstanceViewHolder ivh){
ivh.radioButton.setChecked(false);
found=true;
break;
}
}
if(!found)
adapter.notifyItemChanged(idx);
}
}
radioButton.setChecked(true);