[android] #4959 - Dynamic Sizing Of Default InfoWindow Based On Availability Of Title And Snippet Data
This commit is contained in:
@@ -3,6 +3,7 @@ package com.mapbox.mapboxsdk.annotations;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.PointF;
|
||||
import android.support.annotation.LayoutRes;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -222,9 +223,22 @@ public class InfoWindow {
|
||||
}
|
||||
mMapboxMap = new WeakReference<>(mapboxMap);
|
||||
String title = overlayItem.getTitle();
|
||||
((TextView) view.findViewById(R.id.infowindow_title)).setText(title);
|
||||
TextView titleTextView = ((TextView) view.findViewById(R.id.infowindow_title));
|
||||
if (!TextUtils.isEmpty(title)) {
|
||||
titleTextView.setText(title);
|
||||
titleTextView.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
titleTextView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
String snippet = overlayItem.getSnippet();
|
||||
((TextView) view.findViewById(R.id.infowindow_description)).setText(snippet);
|
||||
TextView snippetTextView = ((TextView) view.findViewById(R.id.infowindow_description));
|
||||
if (!TextUtils.isEmpty(snippet)) {
|
||||
snippetTextView.setText(snippet);
|
||||
snippetTextView.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
snippetTextView.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
InfoWindow setBoundMarker(Marker boundMarker) {
|
||||
|
||||
Reference in New Issue
Block a user