package example.com.velezguiatour;

import android.annotation.SuppressLint;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;


@SuppressLint("Instantiatable")
public class HotelGalleryAdapter extends BaseAdapter {
	Context content;

	public Integer[] hotels = { 
			R.drawable.africano,
			R.drawable.proamar,
			R.drawable.patioandaluz,
			R.drawable.avenida,
			R.drawable.palacio,
			R.drawable.torremar,
			R.drawable.mainake,
			R.drawable.titas,
			R.drawable.dila
	};

	@SuppressLint("Instantiatable")
	public HotelGalleryAdapter(Context content) {
		this.content = content;
	}

	public int getCount() {
		return hotels.length;
	}

	public Object getItem(int position) {
		return position;
	}

	public long getItemId(int position) {
		return position;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		ImageView imageView = new ImageView(content);
		imageView.setImageResource(hotels[position]);
		imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
		imageView.setLayoutParams(new GridView.LayoutParams(200, 200));
		return imageView;
	}

}
