Advertisement
sandi_s

InfoWindows.java

Feb 17th, 2018
1,453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.10 KB | None | 0 0
  1. package lokadin.sandy.example.com.lokadin;
  2. import android.content.Context;
  3. import android.view.LayoutInflater;
  4. import android.view.View;
  5. import android.widget.TextView;
  6. import com.google.android.gms.maps.GoogleMap;
  7. import com.google.android.gms.maps.model.Marker;
  8. /**
  9.  * Created by sandy on 7/11/2017.
  10.  */
  11. public class InfoWindows implements GoogleMap.InfoWindowAdapter {
  12.     private View myContentsView;
  13.     LayoutInflater inflater;
  14.     public InfoWindows (Context context){
  15.         myContentsView = LayoutInflater.from(context).inflate(R.layout.infowindows, null);
  16.     }
  17.     @Override
  18.     public View getInfoWindow(Marker marker) {
  19.         return null;
  20.     }
  21.     @Override
  22.     public View getInfoContents(Marker marker) {
  23.         TextView tvTitle = ((TextView)myContentsView.findViewById(R.id.title));
  24.         tvTitle.setText(marker.getTitle());
  25. //        ImageView img = ((ImageView)myContentsView.findViewById(R.id.imgWindow));
  26.         TextView tvSnippet = ((TextView)myContentsView.findViewById(R.id.snippet));
  27.         tvSnippet.setText(marker.getSnippet());
  28.         return myContentsView;
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement