I want to create a grid view with add button at the end of the grid after displaying the list of images as show in the pic below. I am able to fetch the list of images from network and add to the grid. However, unable to add the button at the end.
Image for the add button is available in the R.drawable folder. Appreciate any suggestion to achieve this.
Here is my adapter code.
public class PhotosGridAdapter extends ArrayAdapter<PhotoAlbum.Edge> {
public PhotosGridAdapter(Context context, List<PhotoAlbum.Edge> photos) {
super(context, 0, photos);
}
@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
PhotoAlbum.Edge photoItem = getItem(position);
if(convertView == null){
convertView = LayoutInflater.from(getContext()).inflate(R.layout.grid_item_photo, parent, false);
}
ImageView ivPhoto = (ImageView) convertView.findViewById(R.id.grid_image);
Picasso.with(getContext()).load(photoItem.node.mediaItem.url).into(ivPhoto);
return convertView;
}
}
