From 5a788a4d70b12040cbbb0ee81b48442876f011f8 Mon Sep 17 00:00:00 2001 From: veliymolfar Date: Tue, 5 May 2020 11:52:51 +0300 Subject: [PATCH] remove position --- OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java | 7 +------ .../net/osmand/plus/audionotes/AudioVideoNotesPlugin.java | 1 - .../net/osmand/plus/download/ui/LocalIndexesFragment.java | 8 ++++---- OsmAnd/src/net/osmand/plus/mapillary/MapillaryPlugin.java | 1 - OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java | 3 --- .../osmand/plus/rastermaps/OsmandRasterMapsPlugin.java | 2 -- OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java | 2 -- 7 files changed, 5 insertions(+), 19 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java b/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java index 7caba071a1..27181c67a5 100644 --- a/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java +++ b/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java @@ -90,12 +90,7 @@ public class ContextMenuAdapter { item.setHidden(isItemHidden(id)); item.setOrder(getItemOrder(id, item.getOrder())); } - int pos = item.getPos(); - if (pos >= 0 && pos < items.size()) { - items.add(item.getPos(), item); - } else { - items.add(item); - } + items.add(item); sortItemsByOrder(); } diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java index fc70ac67ca..ba8dc4c8b8 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java @@ -652,7 +652,6 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { .setSelected(SHOW_RECORDINGS.get()) .setIcon(R.drawable.ic_action_micro_dark) .setColor(SHOW_RECORDINGS.get() ? R.color.osmand_orange : ContextMenuItem.INVALID_ID) - .setPosition(12) .setListener(listener).createItem()); } diff --git a/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java index cffef21b6e..bbb0f694e9 100644 --- a/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java @@ -196,26 +196,26 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement adapter.addItem(new ContextMenuItem.ItemBuilder() .setTitleId(R.string.local_index_mi_backup, getContext()) .setListener(listener) - .setPosition(1).createItem()); + .createItem()); } } if (info.isBackupedData()) { adapter.addItem(new ContextMenuItem.ItemBuilder() .setTitleId(R.string.local_index_mi_restore, getContext()) .setListener(listener) - .setPosition(2).createItem()); + .createItem()); } if (info.getType() != LocalIndexType.TTS_VOICE_DATA && info.getType() != LocalIndexType.VOICE_DATA && info.getType() != LocalIndexType.FONT_DATA) { adapter.addItem(new ContextMenuItem.ItemBuilder() .setTitleId(R.string.shared_string_rename, getContext()) .setListener(listener) - .setPosition(3).createItem()); + .createItem()); } adapter.addItem(new ContextMenuItem.ItemBuilder() .setTitleId(R.string.shared_string_delete, getContext()) .setListener(listener) - .setPosition(4).createItem()); + .createItem()); } private boolean performBasicOperation(int resId, final LocalIndexInfo info) { diff --git a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryPlugin.java b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryPlugin.java index 0f8dd0ffca..60fd23c047 100644 --- a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryPlugin.java +++ b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryPlugin.java @@ -186,7 +186,6 @@ public class MapillaryPlugin extends OsmandPlugin { .setIcon(R.drawable.ic_action_mapillary) .setSecondaryIcon(R.drawable.ic_action_additional_option) .setListener(listener) - .setPosition(11) .createItem()); } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java index 7657e99abc..7a0f79e1c2 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java @@ -364,7 +364,6 @@ public class OsmEditingPlugin extends OsmandPlugin { return true; } }) - .setPosition(16) .createItem()); adapter.addItem(new ContextMenuItem.ItemBuilder() @@ -386,7 +385,6 @@ public class OsmEditingPlugin extends OsmandPlugin { return true; } }) - .setPosition(17) .createItem()); } @@ -434,7 +432,6 @@ public class OsmEditingPlugin extends OsmandPlugin { return true; } }) - .setPosition(5) .createItem()); } } diff --git a/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java b/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java index c64bc6b475..3172bf0416 100644 --- a/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java +++ b/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java @@ -358,7 +358,6 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin { .setIcon(R.drawable.ic_layer_top) .setSecondaryIcon(R.drawable.ic_action_additional_option) .setListener(listener) - .setPosition(14) .createItem()); String underlayMapDescr = settings.MAP_UNDERLAY.get(); if (underlayMapDescr!=null && underlayMapDescr.contains(".sqlitedb")) { @@ -374,7 +373,6 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin { .setIcon(R.drawable.ic_layer_bottom) .setSecondaryIcon(R.drawable.ic_action_additional_option) .setListener(listener) - .setPosition(15) .createItem()); } diff --git a/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java b/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java index bdcdb63506..4c0cdf30db 100644 --- a/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java +++ b/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java @@ -348,7 +348,6 @@ public class SRTMPlugin extends OsmandPlugin { .setDescription(app.getString(R.string.display_zoom_level, descr)) .setColor(contourLinesSelected ? R.color.osmand_orange : ContextMenuItem.INVALID_ID) .setSecondaryIcon(R.drawable.ic_action_additional_option) - .setPosition(12) .setListener(listener).createItem()); } boolean terrainEnabled = settings.TERRAIN.get(); @@ -364,7 +363,6 @@ public class SRTMPlugin extends OsmandPlugin { .setIcon(R.drawable.ic_action_hillshade_dark) .setSecondaryIcon(R.drawable.ic_action_additional_option) .setListener(listener) - .setPosition(13) .createItem() ); }