remove position

This commit is contained in:
veliymolfar 2020-05-05 11:52:51 +03:00
parent 23a7b701a7
commit 5a788a4d70
7 changed files with 5 additions and 19 deletions

View file

@ -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();
}

View file

@ -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());
}

View file

@ -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) {

View file

@ -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());
}

View file

@ -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());
}
}

View file

@ -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());
}

View file

@ -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()
);
}