From 3dafd2c73db9c698eea098422eef82bf9f5a2c52 Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Tue, 25 Oct 2016 23:10:44 +0300 Subject: [PATCH] Fix drawer divider position --- .../net/osmand/plus/activities/MapActivityActions.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 7d9fe155cc..5b68f41e7d 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -770,6 +770,14 @@ public class MapActivityActions implements DialogProvider { //////////// Others OsmandPlugin.registerOptionsMenu(mapActivity, optionsMenuHelper); + int pluginsItemIndex = -1; + for (int i = 0; i < optionsMenuHelper.length(); i++) { + if (optionsMenuHelper.getItem(i).getTitleId() == R.string.prefs_plugins) { + pluginsItemIndex = i; + break; + } + } + ItemBuilder divider = new ItemBuilder().setLayout(R.layout.drawer_divider); if (viewHeight > 0) { int listItemHeight = app.getResources().getDimensionPixelSize(R.dimen.list_item_height); @@ -780,7 +788,7 @@ public class MapActivityActions implements DialogProvider { divider.setMinHeight(AndroidUtils.dpToPx(app, 16f)); } } - divider.setPosition(7); + divider.setPosition(pluginsItemIndex >= 0 ? pluginsItemIndex : 7); optionsMenuHelper.addItem(divider.createItem()); getMyApplication().getAppCustomization().prepareOptionsMenu(mapActivity, optionsMenuHelper);