use of net.osmand.plus.dialogs.ConfigureMapMenu in project Osmand by osmandapp.
the class DashboardOnMap method updateListAdapter.
private void updateListAdapter() {
listEmptyTextView.setVisibility(View.GONE);
listView.setEmptyView(null);
ContextMenuAdapter cm = null;
if (DashboardType.WAYPOINTS == visibleType || DashboardType.WAYPOINTS_FLAT == visibleType) {
StableArrayAdapter listAdapter = waypointDialogHelper.getWaypointsDrawerAdapter(true, deletedPoints, mapActivity, running, DashboardType.WAYPOINTS_FLAT == visibleType, nightMode);
OnItemClickListener listener = waypointDialogHelper.getDrawerItemClickListener(mapActivity, running, listAdapter);
setDynamicListItems(listView, listAdapter);
updateListAdapter(listAdapter, listener);
if (listAdapter.getObjects().size() == 0) {
listEmptyTextView.setText(mapActivity.getString(R.string.no_waypoints_found));
if (landscape) {
listView.setEmptyView(listEmptyTextView);
} else {
listEmptyTextView.setVisibility(View.VISIBLE);
}
}
} else {
if (visibleType == DashboardType.CONFIGURE_SCREEN) {
cm = mapActivity.getMapLayers().getMapWidgetRegistry().getViewConfigureMenuAdapter(mapActivity);
} else if (visibleType == DashboardType.CONFIGURE_MAP) {
cm = new ConfigureMapMenu().createListAdapter(mapActivity);
} else if (visibleType == DashboardType.LIST_MENU) {
cm = mapActivity.getMapActions().createMainOptionsMenu();
} else if (visibleType == DashboardType.ROUTE_PREFERENCES) {
RoutePreferencesMenu routePreferencesMenu = new RoutePreferencesMenu(mapActivity);
ArrayAdapter<LocalRoutingParameter> listAdapter = routePreferencesMenu.getRoutePreferencesDrawerAdapter(nightMode);
OnItemClickListener listener = routePreferencesMenu.getItemClickListener(listAdapter);
updateListAdapter(listAdapter, listener);
} else if (visibleType == DashboardType.UNDERLAY_MAP) {
cm = RasterMapMenu.createListAdapter(mapActivity, OsmandRasterMapsPlugin.RasterMapType.UNDERLAY);
} else if (visibleType == DashboardType.OVERLAY_MAP) {
cm = RasterMapMenu.createListAdapter(mapActivity, OsmandRasterMapsPlugin.RasterMapType.OVERLAY);
} else if (visibleType == DashboardType.CONTOUR_LINES) {
cm = ContourLinesMenu.createListAdapter(mapActivity);
} else if (visibleType == DashboardType.HILLSHADE) {
cm = HillshadeMenu.createListAdapter(mapActivity);
} else if (visibleType == DashboardType.OSM_NOTES) {
cm = OsmNotesMenu.createListAdapter(mapActivity);
}
if (cm != null) {
updateListAdapter(cm);
}
}
}
Aggregations