I'm trying to set Custom info windows
using this tutorial.
Here's my code:
public class MyActivity extends AppCompatActivity implements OnMapReadyCallback, ClickListenerChatFirebase, GoogleMap.InfoWindowAdapter {
public void showMap() {
venueMarker = mMap.addMarker(new MarkerOptions().position(new LatLng(Double.parseDouble(venueLat), Double.parseDouble(venueLng))).title(venue.trim()));
venueMarker.showInfoWindow();
getInfoWindow(venueMarker);
}
public AcceptedRequest(LayoutInflater inflater){
this.inflater = inflater;
}
@Override
public View getInfoWindow(Marker marker) {
// Getting view from the layout file
// inflater = getLayoutInflater();
View v = inflater.inflate(R.layout.venue_infowindow_background, null);
TextView title = (TextView) v.findViewById(R.id.venue_txt);
title.setText(marker.getTitle());
return v;
}
@Override
public View getInfoContents(Marker arg0) {
// TODO Auto-generated method stub
return null;
}
}
}
Here's venue_infowindow_background.xml
:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:background="@color/colorPrimary"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/venue_txt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="venue"
android:textSize="14sp"
android:textStyle="bold"
android:textColor="@android:color/white"/>
</LinearLayout>
The problem is that no change is happening and the info window is showing the default text-color and background-color.
Please help with this issue.