How to beat the everlasting GridView in ScrollView issue?

It must be a very old issue, and people usually use adapters for that, but I don't think its the best solution in my case

I have a relative layout as something like header, and a gridview under it: enter image description here

The GridView is used for displaying pictures from the server (the count is not fixed), and it already has adapter set:

public class ImageListAdapter extends ArrayAdapter {
private Context context;
private LayoutInflater inflater;

private ArrayList<String> imageUrls;

public ImageListAdapter(Context context, ArrayList<String> imageUrls) {
    super(context, R.layout.listview_item_image, imageUrls);
    this.context = context;
    this.imageUrls = imageUrls;

    inflater = LayoutInflater.from(context);

public View getView(int position, View convertView, ViewGroup parent) {
    if (null == convertView) {
        convertView = inflater.inflate(R.layout.listview_item_image, parent, false);

            .into((ImageView) convertView);

    return convertView;
} }

So I'm not sure if I can use this with ExpandableGridView usually suggested.

My main problem is that gridview is pretty long and the header + BottomNavView cover about 30% of the screen. So I need to hide the header on scroll.

Can you suggest me any other way? Maybe you know any other modified GridView which I can apply the same adapter to?