mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2024-12-26 16:04:07 +08:00
Fix view recycling issue (#742)
Fix view issue Co-authored-by: M M Arif <mmarif@swatian.com> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/742
This commit is contained in:
parent
2064c40c7d
commit
3c7b505b5b
@ -50,12 +50,13 @@ public class AssigneesListAdapter extends RecyclerView.Adapter<AssigneesListAdap
|
||||
private ImageView assigneesAvatar;
|
||||
|
||||
private AssigneesViewHolder(View itemView) {
|
||||
|
||||
super(itemView);
|
||||
this.setIsRecyclable(false);
|
||||
|
||||
assigneesSelection = itemView.findViewById(R.id.assigneesSelection);
|
||||
assigneesName = itemView.findViewById(R.id.assigneesName);
|
||||
assigneesAvatar = itemView.findViewById(R.id.assigneesAvatar);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,9 +74,11 @@ public class AssigneesListAdapter extends RecyclerView.Adapter<AssigneesListAdap
|
||||
Collaborators currentItem = assigneesList.get(position);
|
||||
|
||||
if(currentItem.getFull_name().equals("")) {
|
||||
|
||||
holder.assigneesName.setText(currentItem.getLogin());
|
||||
}
|
||||
else {
|
||||
|
||||
holder.assigneesName.setText(currentItem.getFull_name());
|
||||
}
|
||||
PicassoService
|
||||
@ -90,6 +93,7 @@ public class AssigneesListAdapter extends RecyclerView.Adapter<AssigneesListAdap
|
||||
}
|
||||
|
||||
currentAssignees = new ArrayList<>(new LinkedHashSet<>(currentAssignees));
|
||||
|
||||
for(int i = 0; i < currentAssignees.size(); i++) {
|
||||
|
||||
if(currentAssignees.contains(currentItem.getLogin())) {
|
||||
@ -98,6 +102,7 @@ public class AssigneesListAdapter extends RecyclerView.Adapter<AssigneesListAdap
|
||||
assigneesStrings.add(currentAssignees.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
assigneesListener.assigneesInterface(assigneesStrings);
|
||||
|
||||
holder.assigneesSelection.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
@ -119,6 +124,7 @@ public class AssigneesListAdapter extends RecyclerView.Adapter<AssigneesListAdap
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
|
||||
return assigneesList.size();
|
||||
}
|
||||
|
||||
|
@ -48,12 +48,13 @@ public class LabelsListAdapter extends RecyclerView.Adapter<LabelsListAdapter.La
|
||||
private ImageView labelColor;
|
||||
|
||||
private LabelsViewHolder(View itemView) {
|
||||
|
||||
super(itemView);
|
||||
this.setIsRecyclable(false);
|
||||
|
||||
labelSelection = itemView.findViewById(R.id.labelSelection);
|
||||
labelText = itemView.findViewById(R.id.labelText);
|
||||
labelColor = itemView.findViewById(R.id.labelColor);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,6 +86,7 @@ public class LabelsListAdapter extends RecyclerView.Adapter<LabelsListAdapter.La
|
||||
}
|
||||
|
||||
currentLabelsIds = new ArrayList<>(new LinkedHashSet<>(currentLabelsIds));
|
||||
|
||||
for(int i = 0; i < currentLabelsIds.size(); i++) {
|
||||
|
||||
if(currentLabelsIds.contains(currentItem.getId())) {
|
||||
@ -93,6 +95,7 @@ public class LabelsListAdapter extends RecyclerView.Adapter<LabelsListAdapter.La
|
||||
labelsIds.add(currentLabelsIds.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
labelsListener.labelsIdsInterface(labelsIds);
|
||||
|
||||
holder.labelSelection.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||
@ -117,6 +120,7 @@ public class LabelsListAdapter extends RecyclerView.Adapter<LabelsListAdapter.La
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
|
||||
return labels.size();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user