I am working on android with google map marker, look at the images below
I want to change the color of Y & N according to the response, like if it is Y I want the color should be GREEN & if it is N then the color should be RED.
Right now both Y & N are having RED color because I have written following code:
<TextView
android:id="@+id/response"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_toRightOf="@id/response_lbl"
android:textAllCaps="true"
android:textColor="@color/event_response_s"
android:textSize="18sp" />
Where event_response_s = RED.
I tried this by removing the this android:textColor="@color/event_response_s" xml code.
if (marker.getSnippet().equals("Y")){
response.setTextColor(context.getResources().getColor(R.color.green));
}
if (marker.getSnippet().equals("N")) {
response.setTextColor(context.getResources().getColor(R.color.red));
}
Please let me know if you need more information or to know whatelse I tried. Thanks.
0 comments:
Post a Comment