display the image in recycler view along with its file name and file size

Multi tool use
display the image in recycler view along with its file name and file size
public class RecyclerViewAdapter extends RecyclerView.Adapter {
Context context;
List MainImageUploadInfoList;
public RecyclerViewAdapter(Context context, List<UploadInfo> MainImageUploadInfoList) {
this.MainImageUploadInfoList = MainImageUploadInfoList;
this.context = context;
//this.urls=urls;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.recyclerview_items, parent, false);
ViewHolder viewHolder = new ViewHolder(view);
//viewHolder.name.getText(MainImageUploadInfoList.get(position).name);
//return new ViewHolder(view);
return viewHolder;
}
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
ImageUploadInfo UploadInfo = MainImageUploadInfoList.get(position);
holder.name.setText(MainImageUploadInfoList.get(position).getName());
Glide.with(context).load(UploadInfo.getDate()).into(holder.imageView);
}
@Override
public int getItemCount() {
return MainImageUploadInfoList.size();
}
class ViewHolder extends RecyclerView.ViewHolder {
public ImageView imageView;
public TextView name;
public TextView dates;
public ViewHolder(View itemView) {
super(itemView);
this.name = (TextView) itemView.findViewById(R.id.txtTitle);
dates = (TextView) itemView.findViewById(R.id.txtSize);
imageView = (ImageView) itemView.findViewById(R.id.imageView);
}
}
}
public class UploadInfo {
public String name;
public String size;
public UploadInfo() {
}
public UploadInfo(String name, String size) {
this.name = name;
this.size= size;
}
public String getName() {
return name;
}
public String getSize() {
return size;
}
}
When the image is retrieved from Firebase I want the image to be displayed with the name of the image and its file size in recycler
view what should I do.
recycler
I have tried as much as I could but it's not working
more importantly, what is your question ??
– lenik
Jun 30 at 15:39
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Where is your code?
– TDG
Jun 30 at 8:57