I am using a InfoWindowAdapter to add a custom infowindow to my marker.Everything is fine except for one thing, I cant find a way to have a round edge for my infowindow
I am using google mapV2.Any code snippet regarding this would be really helpfull
gMap.setInfoWindowAdapter(new InfoWindowAdapter() {
@Override
public View getInfoWindow(Marker arg0)
{
View vMapInfo = ((Activity) context).getLayoutInflater().inflate(R.layout.map_info_layout, null);
return vMapInfo;
}
@Override
public View getInfoContents(Marker arg0)
{
//View v = getLayoutInflater().inflate(R.layout.map_info_layout, null);
return null;
}
});
map_info_layout.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/bg_map_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal"
>
<RelativeLayout
android:layout_width="250dp"
android:layout_height="45dp"
android:background="@drawable/bg_map_info"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
>
<TextView
android:id="@+id/tvMapStoreName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="3dp"
android:layout_marginTop="2dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_toLeftOf="@+id/ivMapGo"
android:ellipsize="end"
android:lines="1"
android:text="test text test text test text test text "
android:textColor="#ffffff"
android:textSize="@dimen/txt_size_common"
android:textStyle="bold" />
<ImageView
android:id="@+id/ivMapGo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_launcher" />
<TextView
android:id="@+id/tvMapStoreDistance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/tvMapStoreName"
android:layout_below="@+id/tvMapStoreName"
android:lines="1"
android:text="100 Miles"
android:textColor="#FFFFFF"
android:textSize="12dp"
android:textStyle="normal" />
</RelativeLayout>
</LinearLayout>
and the below is the XML of info window background.
bg_map_info.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<gradient android:angle="-90" android:startColor="#a0333333"
android:endColor="#a0000000" />
<corners
android:bottomLeftRadius="5dp"
android:bottomRightRadius="5dp"
android:topLeftRadius="5dp"
android:topRightRadius="5dp" />
</shape>
</item>
<item android:top="20dp">
<shape android:shape="rectangle">
<gradient android:angle="-90" android:startColor="#70000000"
android:endColor="#70000000" />
<corners
android:bottomLeftRadius="5dp"
android:bottomRightRadius="5dp"
android:topLeftRadius="5dp"
android:topRightRadius="5dp" /> </shape>
</item>
</layer-list>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With