mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-28 03:46:00 +01:00
Display answers by group
This commit is contained in:
@@ -73,7 +73,6 @@ public class AdapterAnswer extends RecyclerView.Adapter<AdapterAnswer.ViewHolder
|
||||
private View view;
|
||||
private View vwColor;
|
||||
private TextView tvName;
|
||||
private TextView tvGroup;
|
||||
private ImageView ivExternal;
|
||||
private ImageView ivStandard;
|
||||
private ImageView ivFavorite;
|
||||
@@ -89,7 +88,6 @@ public class AdapterAnswer extends RecyclerView.Adapter<AdapterAnswer.ViewHolder
|
||||
view = itemView.findViewById(R.id.clItem);
|
||||
vwColor = itemView.findViewById(R.id.vwColor);
|
||||
tvName = itemView.findViewById(R.id.tvName);
|
||||
tvGroup = itemView.findViewById(R.id.tvGroup);
|
||||
ivExternal = itemView.findViewById(R.id.ivExternal);
|
||||
ivStandard = itemView.findViewById(R.id.ivStandard);
|
||||
ivFavorite = itemView.findViewById(R.id.ivFavorite);
|
||||
@@ -112,8 +110,6 @@ public class AdapterAnswer extends RecyclerView.Adapter<AdapterAnswer.ViewHolder
|
||||
view.setAlpha(answer.hide ? Helper.LOW_LIGHT : 1.0f);
|
||||
vwColor.setBackgroundColor(answer.color == null ? Color.TRANSPARENT : answer.color);
|
||||
tvName.setText(answer.name);
|
||||
tvGroup.setText(answer.group);
|
||||
tvGroup.setVisibility(TextUtils.isEmpty(answer.group) ? View.GONE : View.VISIBLE);
|
||||
ivExternal.setVisibility(answer.external ? View.VISIBLE : View.GONE);
|
||||
ivStandard.setVisibility(answer.standard ? View.VISIBLE : View.GONE);
|
||||
ivFavorite.setVisibility(answer.favorite ? View.VISIBLE : View.GONE);
|
||||
@@ -406,6 +402,13 @@ public class AdapterAnswer extends RecyclerView.Adapter<AdapterAnswer.ViewHolder
|
||||
return selected.get(position).id;
|
||||
}
|
||||
|
||||
public EntityAnswer getItemAtPosition(int pos) {
|
||||
if (pos >= 0 && pos < selected.size())
|
||||
return selected.get(pos);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return selected.size();
|
||||
|
||||
Reference in New Issue
Block a user