Skip to content

Instantly share code, notes, and snippets.

@iammert
Created August 24, 2016 08:35
Show Gist options
  • Save iammert/a6318f5a90a5989bc332d0ebe213b91b to your computer and use it in GitHub Desktop.
Save iammert/a6318f5a90a5989bc332d0ebe213b91b to your computer and use it in GitHub Desktop.
public class CustomInfoView implements GoogleMap.InfoWindowAdapter{
private LayoutInflater inflater;
private Context context;
private WeakHashMap<Marker, Hotel> hashMap;
public CustomInfoView(Context context, WeakHashMap<Marker, Hotel> hashMap) {
this.context = context;
this.hashMap = hashMap;
inflater = LayoutInflater.from(context);
}
@Override
public View getInfoWindow(Marker marker) {
return null;
}
@Override
public View getInfoContents(Marker marker) {
View view = inflater.inflate(R.layout.infoview_map, null);
ImageView imageView = (ImageView) view.findViewById(R.id.imageHotelThumb);
Picasso.with(context).load(hashMap.get(marker).imageURL).into(imageView);
return view;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment