Created
August 24, 2016 08:35
-
-
Save iammert/a6318f5a90a5989bc332d0ebe213b91b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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