From 615e869a03252f75bd777096b8c5168e4df5b86d Mon Sep 17 00:00:00 2001 From: GaidamakUA Date: Mon, 4 Apr 2016 17:15:15 +0300 Subject: [PATCH] Fixed item layout. --- OsmAnd/res/layout/drawer_list_doubleitem.xml | 50 --------------- ...ist_item_single_line_descrition_narrow.xml | 63 +++++++++++++++++++ .../list_item_single_line_descrition_wide.xml | 63 +++++++++++++++++++ .../osmand/plus/dashboard/DashboardOnMap.java | 3 +- .../osmand/plus/dialogs/ConfigureMapMenu.java | 14 ++--- .../rastermaps/OsmandRasterMapsPlugin.java | 4 +- .../osmand/plus/srtmplugin/SRTMPlugin.java | 1 - 7 files changed, 137 insertions(+), 61 deletions(-) delete mode 100644 OsmAnd/res/layout/drawer_list_doubleitem.xml create mode 100644 OsmAnd/res/layout/list_item_single_line_descrition_narrow.xml create mode 100644 OsmAnd/res/layout/list_item_single_line_descrition_wide.xml diff --git a/OsmAnd/res/layout/drawer_list_doubleitem.xml b/OsmAnd/res/layout/drawer_list_doubleitem.xml deleted file mode 100644 index b4b125932f..0000000000 --- a/OsmAnd/res/layout/drawer_list_doubleitem.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/OsmAnd/res/layout/list_item_single_line_descrition_narrow.xml b/OsmAnd/res/layout/list_item_single_line_descrition_narrow.xml new file mode 100644 index 0000000000..90bbb2f622 --- /dev/null +++ b/OsmAnd/res/layout/list_item_single_line_descrition_narrow.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/layout/list_item_single_line_descrition_wide.xml b/OsmAnd/res/layout/list_item_single_line_descrition_wide.xml new file mode 100644 index 0000000000..f1c56bac7f --- /dev/null +++ b/OsmAnd/res/layout/list_item_single_line_descrition_wide.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java b/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java index 0021161ba3..64078a488d 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java @@ -862,7 +862,8 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis if (visibleType != DashboardType.WAYPOINTS && visibleType != DashboardType.MAP_MARKERS && visibleType != DashboardType.MAP_MARKERS_SELECTION - && visibleType != DashboardType.CONFIGURE_SCREEN) { + && visibleType != DashboardType.CONFIGURE_SCREEN + && visibleType != DashboardType.CONFIGURE_MAP) { listView.setDivider(dividerDrawable); listView.setDividerHeight(dpToPx(1f)); } else { diff --git a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java index 5f47fdc4db..c1e48954e7 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java @@ -273,7 +273,7 @@ public class ConfigureMapMenu { bld.show(); return false; } - }).setDescription(descr).setLayout(R.layout.drawer_list_doubleitem).createItem()); + }).setDescription(descr).setLayout(R.layout.list_item_single_line_descrition_narrow).createItem()); adapter.addItem(new ContextMenuItem.ItemBuilder() .setTitleId(R.string.map_widget_day_night, activity) @@ -304,7 +304,7 @@ public class ConfigureMapMenu { bld.show(); return false; } - }).setLayout(R.layout.drawer_list_doubleitem).createItem()); + }).setLayout(R.layout.list_item_single_line_descrition_narrow).createItem()); adapter.addItem(new ContextMenuItem.ItemBuilder() .setTitleId(R.string.map_magnifier, activity).setListener(new ContextMenuAdapter.ItemClickListener() { @@ -357,7 +357,7 @@ public class ConfigureMapMenu { return false; } }).setDescription(String.format("%.0f", 100f * activity.getMyApplication().getSettings().MAP_DENSITY.get()) + " %") - .setLayout(R.layout.drawer_list_doubleitem) + .setLayout(R.layout.list_item_single_line_descrition_narrow) .createItem()); adapter.addItem(new ContextMenuItem.ItemBuilder() @@ -391,7 +391,7 @@ public class ConfigureMapMenu { b.show(); return false; } - }).setDescription(getScale(activity)).setLayout(R.layout.drawer_list_doubleitem).createItem()); + }).setDescription(getScale(activity)).setLayout(R.layout.list_item_single_line_descrition_narrow).createItem()); adapter.addItem(new ContextMenuItem.ItemBuilder() .setTitleId(R.string.map_locale, activity).setListener(new ContextMenuAdapter.ItemClickListener() { @@ -426,7 +426,7 @@ public class ConfigureMapMenu { } }) .setDescription(activity.getMyApplication().getSettings().MAP_PREFERRED_LOCALE.get()) - .setLayout(R.layout.drawer_list_doubleitem).createItem()); + .setLayout(R.layout.list_item_single_line_descrition_narrow).createItem()); RenderingRulesStorage renderer = activity.getMyApplication().getRendererRegistry().getCurrentSelectedRenderer(); if (renderer != null) { @@ -515,7 +515,7 @@ public class ConfigureMapMenu { adapter.addItem(new ContextMenuItem.ItemBuilder() .setTitleId(strId, activity) .setDescription(descr) - .setLayout(R.layout.drawer_list_doubleitem) + .setLayout(R.layout.list_item_single_line_descrition_narrow) .setListener(new ContextMenuAdapter.ItemClickListener() { @Override @@ -687,7 +687,7 @@ public class ConfigureMapMenu { b.show(); return false; } - }).setDescription(descr).setLayout(R.layout.drawer_list_doubleitem).createItem()); + }).setDescription(descr).setLayout(R.layout.list_item_single_line_descrition_narrow).createItem()); } } } diff --git a/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java b/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java index 51441d2c31..d8b5805fe5 100644 --- a/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java +++ b/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java @@ -256,7 +256,7 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin { String overlayMapDescr = settings.MAP_OVERLAY.get(); overlayMapDescr = overlayMapDescr != null ? overlayMapDescr : mapActivity.getString(R.string.shared_string_none); adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.layer_overlay, mapActivity) - .setLayout(R.layout.drawer_list_doubleitem) + .setLayout(R.layout.list_item_single_line_descrition_wide) .setDescription(overlayMapDescr) .setIcon(R.drawable.ic_layer_top_dark) .setListener(listener) @@ -265,7 +265,7 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin { String underlayMapDescr = settings.MAP_UNDERLAY.get(); underlayMapDescr = underlayMapDescr != null ? underlayMapDescr : mapActivity.getString(R.string.shared_string_none); adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.layer_underlay, mapActivity) - .setLayout(R.layout.drawer_list_doubleitem) + .setLayout(R.layout.list_item_single_line_descrition_wide) .setDescription(underlayMapDescr) .setIcon(R.drawable.ic_layer_bottom_dark) .setListener(listener) diff --git a/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java b/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java index 35ddfa37c2..5a89098365 100644 --- a/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java +++ b/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java @@ -121,7 +121,6 @@ public class SRTMPlugin extends OsmandPlugin { .setIcon(R.drawable.ic_action_hillshade_dark) .setListener(listener) .setPosition(13) - .setLayout(R.layout.drawer_list_item) .createItem()); }