android - How to draw anchor part of google map infowindow? -
i able customize infowindow setting drawable infowindowadapter's view's background. don't have idea how draw anchor part of infowindow.
this did.
infowindowadapter
public class markerinfowindowadapter implements googlemap.infowindowadapter { private context context; private pelicanapplication appstate; public markerinfowindowadapter(context context,activity act) { this.context=context; appstate = ((pelicanapplication)act.getapplication()); } @override public view getinfowindow(marker marker) { layoutinflater inflater = layoutinflater.from(context); view v = inflater.inflate(r.layout.custom_infowindow, null); return v; } @override public view getinfocontents(marker marker) { return null; } }
infowindow view
<?xml version="1.0" encoding="utf-8"?> <framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <linearlayout android:orientation="vertical" android:layout_width="300dp" android:background="@drawable/bg_infowindow" android:layout_height="wrap_content"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancelarge" android:text="large text" android:textcolor="@color/primary_text_color" android:id="@+id/lbl_pickup_address" android:layout_gravity="center_horizontal" android:gravity="center_horizontal" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancemedium" android:textcolor="@color/primary_text_color" android:text="(1km, 5min)" android:id="@+id/lbl_info_to_get_sender" android:layout_gravity="center_horizontal" /> <view android:layout_width="match_parent" android:layout_height="@dimen/drawer_divider_width" android:background="@color/selector_color" android:layout_margintop="@dimen/drawer_divider2line_width" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancelarge" android:text="large text" android:textcolor="@color/primary_text_color" android:id="@+id/lbl_recipient_address" android:layout_gravity="center_horizontal" android:gravity="center_horizontal" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancemedium" android:textcolor="@color/primary_text_color" android:text="(1km, 5min)" android:id="@+id/lbl_info_to_get_recipient" android:layout_gravity="center_horizontal" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="large text" android:textcolor="@color/primary_text_color" android:id="@+id/lbl_price" android:layout_gravity="center_horizontal" android:textsize="25dp" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancemedium" android:textcolor="@color/primary_text_color" android:text="(1km, 5min)" android:id="@+id/lbl_package_details" android:layout_gravity="center_horizontal" /> <view android:layout_width="match_parent" android:layout_height="@dimen/drawer_divider_width" android:background="@color/selector_color" android:layout_margintop="@dimen/drawer_divider2line_width" /> <linearlayout android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_horizontal"> <imageview android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_view_details" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textcolor="@color/primary_text_color" android:textappearance="?android:attr/textappearancemedium" android:text="view details" android:layout_gravity="center_vertical" /> </linearlayout> <view android:layout_width="match_parent" android:layout_height="@dimen/drawer_divider_width" android:background="@color/selector_color" android:layout_margintop="@dimen/drawer_divider2line_width" /> <linearlayout android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_horizontal"> <imageview android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_accept_delivery" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textcolor="@color/primary_text_color" android:textappearance="?android:attr/textappearancemedium" android:text="accept delivery" android:layout_gravity="center_vertical" /> </linearlayout> </linearlayout> </framelayout>
as can see set bg_infowindow background.
bg_infowindow.xml
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="@color/primary_color" /> <stroke android:width="1dp" android:color="@color/selector_color" /> <corners android:radius="5dp" /> </shape>
what got far
what want(i marked part want draw). in screenshot anchor on right side of infowindow. want on bottom of infowindow
i don't want set image background
Comments
Post a Comment