本文整理汇总了Java中com.google.samples.apps.iosched.util.MapUtils.hasInfoFirstDescriptionOnly方法的典型用法代码示例。如果您正苦于以下问题:Java MapUtils.hasInfoFirstDescriptionOnly方法的具体用法?Java MapUtils.hasInfoFirstDescriptionOnly怎么用?Java MapUtils.hasInfoFirstDescriptionOnly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.samples.apps.iosched.util.MapUtils
的用法示例。
在下文中一共展示了MapUtils.hasInfoFirstDescriptionOnly方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: selectMarker
import com.google.samples.apps.iosched.util.MapUtils; //导入方法依赖的package包/类
private void selectMarker(GeoJsonFeature feature) {
if (feature == null) {
mCallbacks.onInfoHide();
return;
}
String type = feature.getProperty("type");
int markerType = MapUtils.detectMarkerType(type);
String id = feature.getProperty("id");
String title = feature.getProperty("title");
String subtitle = feature.getProperty("description");
if (MapUtils.hasInfoTitleOnly(markerType)) {
// Show a basic info window with a title only
mCallbacks.onInfoShowTitle(title, subtitle, markerType, type);
selectActiveMarker(feature);
} else if (MapUtils.hasInfoSessionList(markerType) || MapUtils.hasInfoSessionListIcons(markerType)) {
// Type has sessions to display
mCallbacks.onInfoShowSessionList(id, title, markerType, type);
selectActiveMarker(feature);
} else if (MapUtils.hasInfoFirstDescriptionOnly(markerType)) {
// Display the description of the first session only
mCallbacks.onInfoShowFirstSessionTitle(id, title, markerType, type);
selectActiveMarker(feature);
} else {
// Hide the bottom sheet for unknown markers
mCallbacks.onInfoHide();
}
}
示例2: onMarkerClick
import com.google.samples.apps.iosched.util.MapUtils; //导入方法依赖的package包/类
@Override
public boolean onMarkerClick(Marker marker) {
final String title = marker.getTitle();
final MarkerModel model = mMarkers.get(title);
// Log clicks on all markers (regardless of type)
// ANALYTICS EVENT: Click on marker on the map.
// Contains: Marker ID (for example room UUID)
AnalyticsHelper.sendEvent("Map", "markerclick", title);
deselectActiveMarker();
// The Moscone marker can be compared directly.
// For all other markers the model needs to be looked up first.
if (marker.equals(mMosconeMaker)) {
// Return camera to Moscone
LOGD(TAG, "Clicked on Moscone marker, return to initial display.");
centerOnMoscone(true);
} else if (model != null && MapUtils.hasInfoTitleOnly(model.type)) {
// Show a basic info window with a title only
mCallbacks.onInfoShowTitle(model.label, model.type);
selectActiveMarker(marker);
} else if (model != null && MapUtils.hasInfoSessionList(model.type)) {
// Type has sessions to display
mCallbacks.onInfoShowSessionlist(model.id, model.label, model.type);
selectActiveMarker(marker);
} else if (model != null && MapUtils.hasInfoFirstDescriptionOnly(model.type)) {
// Display the description of the first session only
mCallbacks.onInfoShowFirstSessionTitle(model.id, model.label, model.type);
selectActiveMarker(marker);
} else {
// Hide the bottom sheet for unknown markers
mCallbacks.onInfoHide();
}
return true;
}