Renaming methods.
This commit is contained in:
parent
4b695ba06c
commit
5d335f5dab
22 changed files with 85 additions and 81 deletions
|
@ -145,7 +145,7 @@ public class ContextMenuAdapter {
|
|||
if (this.layoutId == R.layout.simple_list_menu_item) {
|
||||
int color = ContextCompat.getColor(getContext(),
|
||||
holoLight ? R.color.icon_color : R.color.dashboard_subheader_text_dark);
|
||||
Drawable imageId = ContextCompat.getDrawable(getContext(), item.getLightIcon());
|
||||
Drawable imageId = ContextCompat.getDrawable(getContext(), item.getIcon());
|
||||
DrawableCompat.setTint(imageId, color);
|
||||
float density = getContext().getResources().getDisplayMetrics().density;
|
||||
int paddingInPixels = (int) (24 * density);
|
||||
|
@ -154,8 +154,8 @@ public class ContextMenuAdapter {
|
|||
tv.setCompoundDrawables(imageId, null, null, null);
|
||||
tv.setCompoundDrawablePadding(paddingInPixels);
|
||||
} else {
|
||||
if (item.getLightIcon() != -1) {
|
||||
Drawable drawable = ContextCompat.getDrawable(getContext(), item.getLightIcon());
|
||||
if (item.getIcon() != -1) {
|
||||
Drawable drawable = ContextCompat.getDrawable(getContext(), item.getIcon());
|
||||
DrawableCompat.setTint(drawable, item.getThemedColor(getContext()));
|
||||
((AppCompatImageView) convertView.findViewById(R.id.icon)).setImageDrawable(drawable);
|
||||
convertView.findViewById(R.id.icon).setVisibility(View.VISIBLE);
|
||||
|
|
|
@ -14,9 +14,9 @@ public class ContextMenuItem {
|
|||
private final int titleId;
|
||||
private String title;
|
||||
@DrawableRes
|
||||
private final int lightIcon;
|
||||
private final int mIcon;
|
||||
@ColorRes
|
||||
private final int colorRes;
|
||||
private int colorRes;
|
||||
@DrawableRes
|
||||
private final int secondaryIcon;
|
||||
private Boolean selected;
|
||||
|
@ -32,7 +32,7 @@ public class ContextMenuItem {
|
|||
|
||||
private ContextMenuItem(@StringRes int titleId,
|
||||
String title,
|
||||
@DrawableRes int lightIcon,
|
||||
@DrawableRes int icon,
|
||||
@ColorRes int colorRes,
|
||||
@DrawableRes int secondaryIcon,
|
||||
Boolean selected,
|
||||
|
@ -46,7 +46,7 @@ public class ContextMenuItem {
|
|||
ContextMenuAdapter.OnIntegerValueChangedListener integerListener) {
|
||||
this.titleId = titleId;
|
||||
this.title = title;
|
||||
this.lightIcon = lightIcon;
|
||||
this.mIcon = icon;
|
||||
this.colorRes = colorRes;
|
||||
this.secondaryIcon = secondaryIcon;
|
||||
this.selected = selected;
|
||||
|
@ -70,8 +70,8 @@ public class ContextMenuItem {
|
|||
}
|
||||
|
||||
@DrawableRes
|
||||
public int getLightIcon() {
|
||||
return lightIcon;
|
||||
public int getIcon() {
|
||||
return mIcon;
|
||||
}
|
||||
|
||||
@ColorRes
|
||||
|
@ -146,6 +146,10 @@ public class ContextMenuItem {
|
|||
this.title = title;
|
||||
}
|
||||
|
||||
public void setColorRes(int colorRes) {
|
||||
this.colorRes = colorRes;
|
||||
}
|
||||
|
||||
public void setSelected(boolean selected) {
|
||||
this.selected = selected;
|
||||
}
|
||||
|
@ -171,7 +175,7 @@ public class ContextMenuItem {
|
|||
private int mTitleId;
|
||||
private String mTitle;
|
||||
@DrawableRes
|
||||
private int mLightIcon = -1;
|
||||
private int mIcon = -1;
|
||||
@ColorRes
|
||||
private int mColor = -1;
|
||||
@DrawableRes
|
||||
|
@ -206,8 +210,8 @@ public class ContextMenuItem {
|
|||
return this;
|
||||
}
|
||||
|
||||
public ItemBuilder setColorIcon(@DrawableRes int lightIcon) {
|
||||
mLightIcon = lightIcon;
|
||||
public ItemBuilder setIcon(@DrawableRes int icon) {
|
||||
mIcon = icon;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -262,7 +266,7 @@ public class ContextMenuItem {
|
|||
}
|
||||
|
||||
public ContextMenuItem createItem() {
|
||||
return new ContextMenuItem(mTitleId, mTitle, mLightIcon, mColor, mSecondaryIcon,
|
||||
return new ContextMenuItem(mTitleId, mTitle, mIcon, mColor, mSecondaryIcon,
|
||||
mSelected, mProgress, mLayout, mLoading, mIsCategory, mPosition, mDescription,
|
||||
mItemClickListener, mIntegerListener);
|
||||
}
|
||||
|
|
|
@ -283,15 +283,15 @@ public class MapActivityActions implements DialogProvider {
|
|||
final ContextMenuAdapter adapter = iadapter == null ? new ContextMenuAdapter() : iadapter;
|
||||
ContextMenuItem.ItemBuilder itemBuilder = new ContextMenuItem.ItemBuilder();
|
||||
adapter.addItem(itemBuilder.setTitleId(R.string.context_menu_item_search, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_search_dark).createItem());
|
||||
.setIcon(R.drawable.ic_action_search_dark).createItem());
|
||||
if (!mapActivity.getRoutingHelper().isFollowingMode() && !mapActivity.getRoutingHelper().isRoutePlanningMode()) {
|
||||
adapter.addItem(itemBuilder.setTitleId(R.string.context_menu_item_directions_from, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_gdirections_dark).createItem());
|
||||
.setIcon(R.drawable.ic_action_gdirections_dark).createItem());
|
||||
}
|
||||
if (getMyApplication().getTargetPointsHelper().getPointToNavigate() != null &&
|
||||
(mapActivity.getRoutingHelper().isFollowingMode() || mapActivity.getRoutingHelper().isRoutePlanningMode())) {
|
||||
adapter.addItem(itemBuilder.setTitleId(R.string.context_menu_item_last_intermediate_point, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_intermediate).createItem());
|
||||
.setIcon(R.drawable.ic_action_intermediate).createItem());
|
||||
}
|
||||
OsmandPlugin.registerMapContextMenu(mapActivity, latitude, longitude, adapter, selectedObj);
|
||||
|
||||
|
@ -599,7 +599,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
ContextMenuAdapter optionsMenuHelper = new ContextMenuAdapter();
|
||||
|
||||
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.home, mapActivity)
|
||||
.setColorIcon(R.drawable.map_dashboard)
|
||||
.setIcon(R.drawable.map_dashboard)
|
||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
||||
|
@ -611,7 +611,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
}).createItem());
|
||||
if (settings.USE_MAP_MARKERS.get()) {
|
||||
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.map_markers, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_flag_dark)
|
||||
.setIcon(R.drawable.ic_action_flag_dark)
|
||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
||||
|
@ -622,7 +622,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
}).createItem());
|
||||
} else {
|
||||
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.waypoints, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_intermediate)
|
||||
.setIcon(R.drawable.ic_action_intermediate)
|
||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
||||
|
@ -633,7 +633,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
}).createItem());
|
||||
}
|
||||
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.get_directions, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_gdirections_dark)
|
||||
.setIcon(R.drawable.ic_action_gdirections_dark)
|
||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
||||
|
@ -652,7 +652,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
}).createItem());
|
||||
// Default actions (Layers, Configure Map screen, Settings, Search, Favorites)
|
||||
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.search_button, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_search_dark)
|
||||
.setIcon(R.drawable.ic_action_search_dark)
|
||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
||||
|
@ -671,7 +671,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
}).createItem());
|
||||
|
||||
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.shared_string_my_places, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_fav_dark)
|
||||
.setIcon(R.drawable.ic_action_fav_dark)
|
||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
||||
|
@ -685,7 +685,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
|
||||
|
||||
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.show_point_options, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_marker_dark)
|
||||
.setIcon(R.drawable.ic_action_marker_dark)
|
||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
||||
|
@ -696,7 +696,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
}).createItem());
|
||||
|
||||
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.configure_map, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_layers_dark)
|
||||
.setIcon(R.drawable.ic_action_layers_dark)
|
||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
||||
|
@ -707,7 +707,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
}).createItem());
|
||||
|
||||
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.layer_map_appearance, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_configure_screen_dark)
|
||||
.setIcon(R.drawable.ic_configure_screen_dark)
|
||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
||||
|
@ -725,7 +725,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
}
|
||||
}
|
||||
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.index_settings, null)
|
||||
.setTitle(d).setColorIcon(R.drawable.ic_type_archive)
|
||||
.setTitle(d).setIcon(R.drawable.ic_type_archive)
|
||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
||||
|
@ -739,7 +739,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
|
||||
if (Version.isGooglePlayEnabled(app)) {
|
||||
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.osm_live, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_osm_live)
|
||||
.setIcon(R.drawable.ic_action_osm_live)
|
||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
||||
|
@ -752,7 +752,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
}
|
||||
|
||||
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.prefs_plugins, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_extension_dark)
|
||||
.setIcon(R.drawable.ic_extension_dark)
|
||||
.setListener(new ItemClickListener() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
||||
|
@ -766,7 +766,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
|
||||
|
||||
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.shared_string_settings, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_settings)
|
||||
.setIcon(R.drawable.ic_action_settings)
|
||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
||||
|
@ -778,7 +778,7 @@ public class MapActivityActions implements DialogProvider {
|
|||
}
|
||||
}).createItem());
|
||||
optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.shared_string_help, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_help)
|
||||
.setIcon(R.drawable.ic_action_help)
|
||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
||||
|
|
|
@ -264,7 +264,7 @@ public class MapActivityLayers {
|
|||
final ContextMenuAdapter adapter = new ContextMenuAdapter();
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(R.string.shared_string_search, app)
|
||||
.setColorIcon(R.drawable.ic_action_search_dark).createItem());
|
||||
.setIcon(R.drawable.ic_action_search_dark).createItem());
|
||||
final List<PoiUIFilter> list = new ArrayList<PoiUIFilter>();
|
||||
list.add(poiFilters.getCustomPOIFilter());
|
||||
for (PoiUIFilter f : poiFilters.getTopDefinedPoiFilters()) {
|
||||
|
@ -306,9 +306,9 @@ public class MapActivityLayers {
|
|||
ContextMenuItem.ItemBuilder builder = new ContextMenuItem.ItemBuilder();
|
||||
builder.setTitle(f.getName());
|
||||
if (RenderingIcons.containsBigIcon(f.getIconId())) {
|
||||
builder.setColorIcon(RenderingIcons.getBigIconResourceId(f.getIconId()));
|
||||
builder.setIcon(RenderingIcons.getBigIconResourceId(f.getIconId()));
|
||||
} else {
|
||||
builder.setColorIcon(R.drawable.mx_user_defined);
|
||||
builder.setIcon(R.drawable.mx_user_defined);
|
||||
}
|
||||
builder.setColor(R.color.color_white);
|
||||
adapter.addItem(builder.createItem());
|
||||
|
|
|
@ -593,7 +593,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
|
|||
};
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.layer_recordings, app)
|
||||
.setSelected(SHOW_RECORDINGS.get())
|
||||
.setColorIcon(R.drawable.ic_action_micro_dark)
|
||||
.setIcon(R.drawable.ic_action_micro_dark)
|
||||
.setPosition(12)
|
||||
.setListener(listener).createItem());
|
||||
}
|
||||
|
@ -605,7 +605,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
|
|||
return;
|
||||
}
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.recording_context_menu_arecord, app)
|
||||
.setColorIcon(R.drawable.ic_action_micro_dark)
|
||||
.setIcon(R.drawable.ic_action_micro_dark)
|
||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||
|
||||
@Override
|
||||
|
@ -617,7 +617,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
|
|||
.setPosition(6)
|
||||
.createItem());
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.recording_context_menu_vrecord, app)
|
||||
.setColorIcon(R.drawable.ic_action_video_dark)
|
||||
.setIcon(R.drawable.ic_action_video_dark)
|
||||
.setListener(new ItemClickListener() {
|
||||
|
||||
@Override
|
||||
|
@ -629,7 +629,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
|
|||
.setPosition(7)
|
||||
.createItem());
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.recording_context_menu_precord, app)
|
||||
.setColorIcon(R.drawable.ic_action_photo_dark)
|
||||
.setIcon(R.drawable.ic_action_photo_dark)
|
||||
.setListener(new ItemClickListener() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
||||
|
|
|
@ -58,7 +58,7 @@ public class OsmandDevelopmentPlugin extends OsmandPlugin {
|
|||
if (Version.isDeveloperVersion(mapActivity.getMyApplication())) {
|
||||
helper.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(R.string.version_settings, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_gabout_dark)
|
||||
.setIcon(R.drawable.ic_action_gabout_dark)
|
||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
||||
|
|
|
@ -179,32 +179,32 @@ public class ConfigureMapMenu {
|
|||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(R.string.layer_poi, activity)
|
||||
.setSelected(settings.SELECTED_POI_FILTER_FOR_MAP.get() != null)
|
||||
.setColorIcon(R.drawable.ic_action_info_dark)
|
||||
.setIcon(R.drawable.ic_action_info_dark)
|
||||
.setListener(l).createItem());
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(R.string.layer_amenity_label, activity)
|
||||
.setSelected(settings.SHOW_POI_LABEL.get())
|
||||
.setColorIcon(R.drawable.ic_action_text_dark)
|
||||
.setIcon(R.drawable.ic_action_text_dark)
|
||||
.setListener(l).createItem());
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(R.string.shared_string_favorites, activity)
|
||||
.setSelected(settings.SHOW_FAVORITES.get())
|
||||
.setColorIcon(R.drawable.ic_action_fav_dark)
|
||||
.setIcon(R.drawable.ic_action_fav_dark)
|
||||
.setListener(l).createItem());
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(R.string.layer_gpx_layer, activity)
|
||||
.setSelected(app.getSelectedGpxHelper().isShowingAnyGpxFiles())
|
||||
.setColorIcon(R.drawable.ic_action_polygom_dark)
|
||||
.setIcon(R.drawable.ic_action_polygom_dark)
|
||||
.setListener(l).createItem());
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(R.string.layer_map, activity)
|
||||
.setColorIcon(R.drawable.ic_world_globe_dark)
|
||||
.setIcon(R.drawable.ic_world_globe_dark)
|
||||
.setListener(l).createItem());
|
||||
if (TransportRouteHelper.getInstance().routeIsCalculated()) {
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(R.string.layer_transport_route, activity)
|
||||
.setSelected(true)
|
||||
.setColorIcon(R.drawable.ic_action_bus_dark)
|
||||
.setIcon(R.drawable.ic_action_bus_dark)
|
||||
.setListener(l).createItem());
|
||||
}
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ public class RasterMapMenu {
|
|||
contextMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(mapTypeStringTransparency, mapActivity)
|
||||
.setLayout(R.layout.progress_list_item)
|
||||
.setColorIcon(R.drawable.ic_action_opacity)
|
||||
.setIcon(R.drawable.ic_action_opacity)
|
||||
.setProgress(mapTransparencyPreference.get())
|
||||
.setListener(l)
|
||||
.setIntegerListener(integerListener).createItem());
|
||||
|
|
|
@ -677,7 +677,7 @@ public class DistanceCalculatorPlugin extends OsmandPlugin {
|
|||
};
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(R.string.delete_point, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_delete_dark)
|
||||
.setIcon(R.drawable.ic_action_delete_dark)
|
||||
.setListener(listener).createItem());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -590,12 +590,12 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
|
|||
};
|
||||
optionsMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(R.string.local_index_mi_reload, getContext())
|
||||
.setColorIcon(R.drawable.ic_action_refresh_dark)
|
||||
.setIcon(R.drawable.ic_action_refresh_dark)
|
||||
.setListener(listener)
|
||||
.createItem());
|
||||
optionsMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(R.string.shared_string_delete, getContext())
|
||||
.setColorIcon(R.drawable.ic_action_delete_dark)
|
||||
.setIcon(R.drawable.ic_action_delete_dark)
|
||||
.setListener(listener)
|
||||
.createItem());
|
||||
optionsMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
|
@ -626,8 +626,8 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
|
|||
item = menu.add(0, contextMenuItem.getTitleId(), j + 1, contextMenuItem.getTitle());
|
||||
MenuItemCompat.setShowAsAction(item, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
|
||||
}
|
||||
if (contextMenuItem.getLightIcon() != -1) {
|
||||
item.setIcon(contextMenuItem.getLightIcon());
|
||||
if (contextMenuItem.getIcon() != -1) {
|
||||
item.setIcon(contextMenuItem.getIcon());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -212,7 +212,7 @@ public class GpxUiHelper {
|
|||
s = s.replace('_', ' ');
|
||||
|
||||
adapter.addItem(ContextMenuItem.createBuilder(s).setSelected(multipleChoice)
|
||||
.setColorIcon(R.drawable.ic_action_polygom_dark).createItem());
|
||||
.setIcon(R.drawable.ic_action_polygom_dark).createItem());
|
||||
|
||||
//if there's some selected files - need to mark them as selected
|
||||
if (selectedGpxList != null) {
|
||||
|
@ -276,7 +276,7 @@ public class GpxUiHelper {
|
|||
}
|
||||
final ContextMenuItem item = adapter.getItem(position);
|
||||
ImageView iconView = (ImageView) v.findViewById(R.id.icon);
|
||||
Drawable icon = ContextCompat.getDrawable(activity, item.getLightIcon());
|
||||
Drawable icon = ContextCompat.getDrawable(activity, item.getIcon());
|
||||
DrawableCompat.setTint(icon, item.getThemedColor(activity));
|
||||
iconView.setImageDrawable(icon);
|
||||
final ArrayAdapter<String> arrayAdapter = this;
|
||||
|
|
|
@ -142,14 +142,14 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
|
|||
};
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(R.string.context_menu_item_add_waypoint, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_gnew_label_dark)
|
||||
.setIcon(R.drawable.ic_action_gnew_label_dark)
|
||||
.setListener(listener).createItem());
|
||||
if (selectedObj instanceof WptPt) {
|
||||
WptPt pt = (WptPt) selectedObj;
|
||||
if (app.getSelectedGpxHelper().getSelectedGPXFile(pt) != null) {
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(R.string.context_menu_item_edit_waypoint, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_edit_dark)
|
||||
.setIcon(R.drawable.ic_action_edit_dark)
|
||||
.setListener(listener).createItem());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -349,12 +349,12 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
|
|||
}
|
||||
};
|
||||
optionsMenuAdapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.shared_string_show_on_map, getActivity())
|
||||
.setColorIcon(R.drawable.ic_show_on_map)
|
||||
.setIcon(R.drawable.ic_show_on_map)
|
||||
.setListener(listener).createItem());
|
||||
optionsMenuAdapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.shared_string_delete, getActivity())
|
||||
.setColorIcon(R.drawable.ic_action_delete_dark).setListener(listener).createItem());
|
||||
.setIcon(R.drawable.ic_action_delete_dark).setListener(listener).createItem());
|
||||
optionsMenuAdapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.local_index_mi_reload, getActivity())
|
||||
.setColorIcon(R.drawable.ic_action_refresh_dark).setListener(listener).createItem());
|
||||
.setIcon(R.drawable.ic_action_refresh_dark).setListener(listener).createItem());
|
||||
OsmandPlugin.onOptionsMenuActivity(getActivity(), this, optionsMenuAdapter);
|
||||
for (int j = 0; j < optionsMenuAdapter.length(); j++) {
|
||||
final MenuItem item;
|
||||
|
@ -370,8 +370,8 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
|
|||
}
|
||||
});
|
||||
}
|
||||
if (contextMenuItem.getLightIcon() != -1) {
|
||||
item.setIcon(contextMenuItem.getLightIcon());
|
||||
if (contextMenuItem.getIcon() != -1) {
|
||||
item.setIcon(contextMenuItem.getIcon());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -218,30 +218,30 @@ public class OsmEditingPlugin extends OsmandPlugin {
|
|||
}
|
||||
if (isEditable) {
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.poi_context_menu_modify, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_edit_dark)
|
||||
.setIcon(R.drawable.ic_action_edit_dark)
|
||||
.setListener(listener)
|
||||
.setPosition(1)
|
||||
.createItem());
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.poi_context_menu_delete, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_delete_dark)
|
||||
.setIcon(R.drawable.ic_action_delete_dark)
|
||||
.setListener(listener)
|
||||
.setPosition(2)
|
||||
.createItem());
|
||||
} else if (selectedObj instanceof OpenstreetmapPoint && ((OpenstreetmapPoint) selectedObj).getAction() != Action.DELETE) {
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.poi_context_menu_modify_osm_change, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_edit_dark)
|
||||
.setIcon(R.drawable.ic_action_edit_dark)
|
||||
.setListener(listener)
|
||||
.setPosition(1)
|
||||
.createItem());
|
||||
} else {
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.context_menu_item_create_poi, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_plus_dark)
|
||||
.setIcon(R.drawable.ic_action_plus_dark)
|
||||
.setListener(listener)
|
||||
.setPosition(-1)
|
||||
.createItem());
|
||||
}
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.context_menu_item_open_note, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_bug_dark)
|
||||
.setIcon(R.drawable.ic_action_bug_dark)
|
||||
.setListener(listener).createItem());
|
||||
}
|
||||
|
||||
|
@ -259,7 +259,7 @@ public class OsmEditingPlugin extends OsmandPlugin {
|
|||
public void registerLayerContextMenuActions(OsmandMapTileView mapView, ContextMenuAdapter adapter, final MapActivity mapActivity) {
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.layer_osm_bugs, mapActivity)
|
||||
.setSelected(settings.SHOW_OSM_BUGS.get())
|
||||
.setColorIcon(R.drawable.ic_action_bug_dark)
|
||||
.setIcon(R.drawable.ic_action_bug_dark)
|
||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||
|
||||
@Override
|
||||
|
@ -285,7 +285,7 @@ public class OsmEditingPlugin extends OsmandPlugin {
|
|||
public void contextMenuFragment(final Activity la, final Fragment fragment, final Object info, ContextMenuAdapter adapter) {
|
||||
if (fragment instanceof AvailableGPXFragment) {
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.local_index_mi_upload_gpx, la)
|
||||
.setColorIcon(R.drawable.ic_action_export)
|
||||
.setIcon(R.drawable.ic_action_export)
|
||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||
|
||||
@Override
|
||||
|
@ -302,7 +302,7 @@ public class OsmEditingPlugin extends OsmandPlugin {
|
|||
if (fragment instanceof AvailableGPXFragment) {
|
||||
final AvailableGPXFragment f = ((AvailableGPXFragment) fragment);
|
||||
optionsMenuAdapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.local_index_mi_upload_gpx, activity)
|
||||
.setColorIcon(R.drawable.ic_action_export)
|
||||
.setIcon(R.drawable.ic_action_export)
|
||||
.setColor(R.color.color_white)
|
||||
.setListener(new ItemClickListener() {
|
||||
|
||||
|
|
|
@ -275,7 +275,7 @@ public class OsMoPlugin extends OsmandPlugin implements OsMoReactor {
|
|||
@Override
|
||||
public void registerOptionsMenuItems(final MapActivity mapActivity, ContextMenuAdapter helper) {
|
||||
helper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.osmo_groups, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_osmo_dark)
|
||||
.setIcon(R.drawable.ic_osmo_dark)
|
||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
|
||||
|
|
|
@ -229,7 +229,7 @@ public class ParkingPositionPlugin extends OsmandPlugin {
|
|||
};
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(R.string.context_menu_item_add_parking_point, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_parking_dark)
|
||||
.setIcon(R.drawable.ic_action_parking_dark)
|
||||
.setListener(addListener)
|
||||
.createItem());
|
||||
}
|
||||
|
|
|
@ -258,7 +258,7 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
|
|||
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.layer_overlay, mapActivity)
|
||||
.setLayout(R.layout.drawer_list_doubleitem)
|
||||
.setDescription(overlayMapDescr)
|
||||
.setColorIcon(R.drawable.ic_layer_top_dark)
|
||||
.setIcon(R.drawable.ic_layer_top_dark)
|
||||
.setListener(listener)
|
||||
.setPosition(14)
|
||||
.createItem());
|
||||
|
@ -267,7 +267,7 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
|
|||
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.layer_underlay, mapActivity)
|
||||
.setLayout(R.layout.drawer_list_doubleitem)
|
||||
.setDescription(underlayMapDescr)
|
||||
.setColorIcon(R.drawable.ic_layer_bottom_dark)
|
||||
.setIcon(R.drawable.ic_layer_bottom_dark)
|
||||
.setListener(listener)
|
||||
.setPosition(15)
|
||||
.createItem());
|
||||
|
@ -293,11 +293,11 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
|
|||
};
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(R.string.context_menu_item_update_map, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_refresh_dark)
|
||||
.setIcon(R.drawable.ic_action_refresh_dark)
|
||||
.setListener(listener).createItem());
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(R.string.shared_string_download_map, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_import)
|
||||
.setIcon(R.drawable.ic_action_import)
|
||||
.setListener(listener).createItem());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,13 +112,13 @@ public class RoutePointsLayer extends OsmandMapLayer implements ContextMenuLaye
|
|||
if (plugin.getCurrentRoute().getPointStatus(point)){
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(R.string.mark_as_not_visited, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_gremove_dark)
|
||||
.setIcon(R.drawable.ic_action_gremove_dark)
|
||||
.setListener(listener)
|
||||
.createItem());
|
||||
} else {
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(R.string.mark_as_visited, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_done)
|
||||
.setIcon(R.drawable.ic_action_done)
|
||||
.setListener(listener)
|
||||
.createItem());
|
||||
}
|
||||
|
@ -128,13 +128,13 @@ public class RoutePointsLayer extends OsmandMapLayer implements ContextMenuLaye
|
|||
if (routePoint.isNextNavigate) {
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(R.string.navigate_to_next, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_gnext_dark)
|
||||
.setIcon(R.drawable.ic_action_gnext_dark)
|
||||
.setListener(listener)
|
||||
.createItem());
|
||||
} else {
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(R.string.mark_as_current, mapActivity)
|
||||
.setColorIcon(R.drawable.ic_action_signpost_dark)
|
||||
.setIcon(R.drawable.ic_action_signpost_dark)
|
||||
.setListener(listener)
|
||||
.createItem());
|
||||
}
|
||||
|
|
|
@ -118,7 +118,7 @@ public class SRTMPlugin extends OsmandPlugin {
|
|||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(R.string.layer_hillshade, mapActivity)
|
||||
.setSelected(HILLSHADE.get())
|
||||
.setColorIcon(R.drawable.ic_action_hillshade_dark)
|
||||
.setIcon(R.drawable.ic_action_hillshade_dark)
|
||||
.setListener(listener)
|
||||
.setPosition(13)
|
||||
.setLayout(R.layout.drawer_list_item)
|
||||
|
|
|
@ -145,7 +145,7 @@ public class ContextMenuLayer extends OsmandMapLayer {
|
|||
};
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(R.string.shared_string_show_description, activity)
|
||||
.setColorIcon(R.drawable.ic_action_note_dark).setListener(listener)
|
||||
.setIcon(R.drawable.ic_action_note_dark).setListener(listener)
|
||||
.createItem());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -178,7 +178,7 @@ public class ImpassableRoadsLayer extends OsmandMapLayer implements ContextMenuL
|
|||
};
|
||||
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.avoid_road, activity)
|
||||
.setColorIcon(R.drawable.ic_action_road_works_dark)
|
||||
.setIcon(R.drawable.ic_action_road_works_dark)
|
||||
.setListener(listener)
|
||||
.createItem());
|
||||
}
|
||||
|
|
|
@ -391,7 +391,7 @@ public class MapWidgetRegistry {
|
|||
}
|
||||
contextMenuAdapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(r.messageId, map)
|
||||
.setSelected(r.visibleCollapsed(mode) || r.visible(mode))
|
||||
.setColorIcon(r.drawableMenu)
|
||||
.setIcon(r.drawableMenu)
|
||||
.setSecondaryIcon(R.drawable.ic_action_additional_option)
|
||||
.setListener(new ContextMenuAdapter.OnRowItemClick() {
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue