diff --git a/OsmAnd/res/layout/list_item_buttons.xml b/OsmAnd/res/layout/list_item_buttons.xml
new file mode 100644
index 0000000000..9ac9d244c1
--- /dev/null
+++ b/OsmAnd/res/layout/list_item_buttons.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OsmAnd/res/layout/list_item_date_spinners.xml b/OsmAnd/res/layout/list_item_date_spinners.xml
new file mode 100644
index 0000000000..d94f55522e
--- /dev/null
+++ b/OsmAnd/res/layout/list_item_date_spinners.xml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/list_item_edit_text.xml b/OsmAnd/res/layout/list_item_edit_text.xml
new file mode 100644
index 0000000000..2dafd55091
--- /dev/null
+++ b/OsmAnd/res/layout/list_item_edit_text.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/list_item_icon_with_title_and_descr.xml b/OsmAnd/res/layout/list_item_icon_with_title_and_descr.xml
new file mode 100644
index 0000000000..91884829c6
--- /dev/null
+++ b/OsmAnd/res/layout/list_item_icon_with_title_and_descr.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml
index 9e7f93a565..aab6485879 100644
--- a/OsmAnd/res/values/strings.xml
+++ b/OsmAnd/res/values/strings.xml
@@ -9,6 +9,14 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
-->
+ To
+ From
+ View images added in a certain period.
+ Dates
+ Type user name
+ View images added by a certain user.
+ Username
+ You can filter images by the name of the user or by the date.
Connection mode
Radius mode
Permissions
diff --git a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryMenu.java b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryMenu.java
index 1d943fc908..927425677c 100644
--- a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryMenu.java
+++ b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryMenu.java
@@ -1,6 +1,12 @@
package net.osmand.plus.mapillary;
+import android.widget.ArrayAdapter;
+
import net.osmand.plus.ContextMenuAdapter;
+import net.osmand.plus.ContextMenuItem;
+import net.osmand.plus.OsmandApplication;
+import net.osmand.plus.OsmandPlugin;
+import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
@@ -9,6 +15,88 @@ public class MapillaryMenu {
public static ContextMenuAdapter createListAdapter(final MapActivity mapActivity) {
ContextMenuAdapter adapter = new ContextMenuAdapter();
adapter.setDefaultLayoutId(R.layout.list_item_icon_and_menu);
+ createLayersItems(adapter, mapActivity);
return adapter;
}
+
+ private static void createLayersItems(final ContextMenuAdapter contextMenuAdapter, final MapActivity mapActivity) {
+ final OsmandApplication app = mapActivity.getMyApplication();
+ final OsmandSettings settings = app.getSettings();
+ final MapillaryPlugin plugin = OsmandPlugin.getPlugin(MapillaryPlugin.class);
+ if (plugin == null) {
+ return;
+ }
+
+ final boolean selected = settings.SHOW_MAPILLARY.get();
+ final int toggleActionStringId = selected ? R.string.shared_string_enabled : R.string.shared_string_disabled;
+
+ ContextMenuAdapter.OnRowItemClick l = new ContextMenuAdapter.OnRowItemClick() {
+ @Override
+ public boolean onContextMenuClick(ArrayAdapter adapter, int itemId, int position, boolean isChecked) {
+ if (itemId == toggleActionStringId) {
+ settings.SHOW_MAPILLARY.set(!settings.SHOW_MAPILLARY.get());
+ plugin.updateLayers(mapActivity.getMapView(), mapActivity);
+ mapActivity.getDashboard().refreshContent(true);
+ }
+ return false;
+ }
+ };
+
+ boolean light = settings.isLightContent();
+ int toggleIconColorId;
+ int toggleIconId;
+ if (selected) {
+ toggleIconId = R.drawable.ic_action_view;
+ toggleIconColorId = light ? R.color.color_dialog_buttons_light : R.color.color_dialog_buttons_dark;
+ } else {
+ toggleIconId = R.drawable.ic_action_hide;
+ toggleIconColorId = light ? R.color.icon_color : 0;
+ }
+
+ contextMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
+ .setTitleId(toggleActionStringId, mapActivity)
+ .setIcon(toggleIconId)
+ .setColor(toggleIconColorId)
+ .setListener(l)
+ .setSelected(selected)
+ .createItem());
+
+ contextMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
+ .setTitleId(R.string.search_poi_filter, mapActivity)
+ .setDescription(app.getString(R.string.mapillary_menu_filter_description))
+ .setCategory(true)
+ .setLayout(R.layout.list_group_title_with_descr)
+ .createItem());
+
+ contextMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
+ .setTitleId(R.string.mapillary_menu_title_username, mapActivity)
+ .setDescription(app.getString(R.string.mapillary_menu_descr_username))
+ .setIcon(R.drawable.ic_action_user)
+ .setClickable(false)
+ .setLayout(R.layout.list_item_icon_with_title_and_descr)
+ .createItem());
+
+ contextMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
+ .setLayout(R.layout.list_item_edit_text)
+ .setClickable(false)
+ .createItem());
+
+ contextMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
+ .setTitleId(R.string.mapillary_menu_title_dates, mapActivity)
+ .setDescription(app.getString(R.string.mapillary_menu_descr_dates))
+ .setIcon(R.drawable.ic_action_data)
+ .setClickable(false)
+ .setLayout(R.layout.list_item_icon_with_title_and_descr)
+ .createItem());
+
+ contextMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
+ .setLayout(R.layout.list_item_date_spinners)
+ .setClickable(false)
+ .createItem());
+
+ contextMenuAdapter.addItem(new ContextMenuItem.ItemBuilder()
+ .setLayout(R.layout.list_item_buttons)
+ .setClickable(false)
+ .createItem());
+ }
}