mercredi 28 mai 2014

Problema with InfoWindowAdapter laytout


Vote count:

0




I implemented one layout to use on popup of map marker (Maps V2), but I cant configure my layout as I need.


In the image bellow, you can see that the popup with informations about the marker have a white border, I need remove it. I neet fill the popup background with yellow (as the center box).


What is wrong in my layout xml?


enter image description here


My XML (info_window_map)



<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/pastel" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@color/blue_nightsky"
android:orientation="horizontal"
>

<TextView
android:id="@+id/linha_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Linha "
android:textColor="@color/white"
android:textSize="13sp"
android:textStyle="bold" />

<TextView
android:id="@+id/cod_linha"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:textColor="@color/white"
android:textSize="13sp"
android:layout_gravity="left"
android:layout_marginLeft="5dp"
android:textStyle="bold" />
</LinearLayout>

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >

<TextView
android:id="@+id/onibus_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Ônibus....: "
android:textColor="@color/black"
android:textSize="12sp"
android:textStyle="bold" />

<TextView
android:id="@+id/cod_onibus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="12sp" />
</LinearLayout>

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >

<TextView
android:id="@+id/previsao_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Previsão..: "
android:textColor="@color/black"
android:textSize="12sp"
android:textStyle="bold" />

<TextView
android:id="@+id/previsao"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>


</LinearLayout>


My Adapter (that use the xml)



class MyInfoWindowAdapter implements InfoWindowAdapter{

private final View myContentsView;

MyInfoWindowAdapter(){
myContentsView = getLayoutInflater().inflate(R.layout.info_window_map, null);
}

@Override
public View getInfoContents(Marker marker) {

//Seta a linha no infowindow
TextView txtTitle = ((TextView)myContentsView.findViewById(R.id.cod_linha));
txtTitle.setText(marker.getTitle());

//Pega a informação em snippet e separa linha, codOnibus do endereço
String snippet = marker.getSnippet();
Snippet snp = new Snippet();
snp.fillSnippet(snippet);

TextView txtCodLinha = ((TextView)myContentsView.findViewById(R.id.cod_linha));
txtCodLinha.setText(snp.getLinha());

TextView txtCodOnibus = ((TextView)myContentsView.findViewById(R.id.cod_onibus));
txtCodOnibus.setText(snp.getCodOnibus());

TextView txtPrevisao = ((TextView)myContentsView.findViewById(R.id.previsao));
txtPrevisao.setText(snp.getPrevisao());

return myContentsView;
}

@Override
public View getInfoWindow(Marker marker) {
// TODO Auto-generated method stub
return null;
}
}


asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire