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

Multi tool use
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





Where is your code?
– TDG
Jun 30 at 8:57





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.

Egf ru,FtI0YghnsW
6kMR,45,0wBckj1K3zDK4o1TTN jTM2gJBLj4,Fgq 5vtXzu5XznclqjorWhTxyeFSAtCCJHL3Z eyiNvS3TZ1TDdqdFdii B

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

Create weekly swift ios local notifications