Revert "Revert "Fix #443""

This reverts commit e0c072ab9c.
This commit is contained in:
LucasGGamerM 2022-12-13 12:02:21 -03:00
parent e0c072ab9c
commit dcb5e36041
1 changed files with 6 additions and 3 deletions

View File

@ -240,9 +240,12 @@ public class InstanceChooserLoginFragment extends InstanceCatalogFragment{
if(chosenInstance!=null){
int idx=filteredData.indexOf(chosenInstance);
if(idx!=-1){
RecyclerView.ViewHolder holder=list.findViewHolderForAdapterPosition(mergeAdapter.getPositionForAdapter(adapter)+idx);
if(holder instanceof InstanceViewHolder ivh){
ivh.radioButton.setChecked(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);
break;
}
}
}
}