You'll have to build this functionality yourself, but it's actually pretty easy to accomplish by defining a custom Marker and Tooltip Layout.
Start by defining your Tooltip layout. It has to be a RelativeLayout obviously to position the callout image. Set your context to whatever Activity is creating the markers. The TipView at the bottom must be included, because it controls sizing of the custom Tooltip.
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:background="@color/white"
android:id="@+id/parent_layout"
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:context="com.XXX.MainActivity">
<TextView
android:id="@+id/tooltip_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="18sp"
android:maxEms="17"
android:layout_gravity="left"
android:layout_weight="1"
android:text="@string/toolTipTitle"/>
<TextView
android:id="@+id/tooltip_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="14sp"
android:maxEms="17"
android:text="@string/toolTipDescription"
android:layout_below="@+id/tooltip_title"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/marker_about"
android:src="@drawable/ic_action_about"
android:layout_toEndOf="@+id/tooltip_description"
android:layout_toRightOf="@+id/tooltip_description"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="10dp" />
<com.mapbox.mapboxsdk.views.TipView
android:layout_width="132dp"
android:layout_height="10dp"/>
</RelativeLayout>
Then create a custom Marker class and override the createTooltip method to return an InfoWindow with the new layout:
public class CustomMarker extends Marker {
public CustomMarker(MapView mv, String aTitle, String aDescription, LatLng aLatLng){
super(mv, aTitle, aDescription, aLatLng);
}
@Override
protected InfoWindow createTooltip(MapView mv) {
return new InfoWindow(R.layout.custom_tooltip, mv);
}
}
This shouldn't change any other functionality, so the code you have will still work. Just change Marker to the custom class name and you should be set.
EDIT: Here's the code that actually sets the CustomMarker and InfoWindow up with my map. You can see that I'm launching another activity on click and that I've set a custom Icon for the marker, but that stuff isn't necessary:
CustomMarker m =
new CustomMarker(mv, report.issue, report.getFormattedDateString(), latLng);
m.setIcon(new Icon(this, Icon.Size.LARGE, "oil-well", "FF0000"));
//get the InfoWindow's view so that you can set a touch listener which will switch
//to the marker's detailed view when clicked
final InfoWindow infoWindow = m.getToolTip(mv);
View view = infoWindow.getView();
view.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
//make sure to choose action down or up, otherwise the intent will launch twice
if(motionEvent.getAction() == MotionEvent.ACTION_DOWN){
startActivity(intent);
//close the InfoWindow so it's not still open when coming back to the map
infoWindow.close();
}
return true;
}
});
mv.addMarker(m);
I'm also using SDK 0.5.0-SNAPSHOT. I'm not sure if this will work on older versions of the SDK.