From 2af746c3975290a1ebf5fa1cf3f8917b2d6bba7f Mon Sep 17 00:00:00 2001 From: Chumva Date: Wed, 18 Apr 2018 19:08:15 +0300 Subject: [PATCH] create method getGroupWptCategoriesString --- .../adapters/MapMarkersGroupsAdapter.java | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java index 4fd20400c5..f635804cce 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java @@ -552,24 +552,8 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter categories = group.getWptCategories(); - if (categories != null && !categories.isEmpty()) { - StringBuilder sb = new StringBuilder(); - Iterator it = categories.iterator(); - while (it.hasNext()) { - String category = it.next(); - if (category.equals("")) { - category = app.getResources().getString(R.string.waypoints); - } - sb.append(category); - if (it.hasNext()) { - sb.append(", "); - } - } - cat = sb.toString(); - } - categoriesViewHolder.title.setText(cat); + + categoriesViewHolder.title.setText(getGroupWptCategoriesString(group)); categoriesViewHolder.divider.setVisibility(View.VISIBLE); categoriesViewHolder.button.setCompoundDrawablesWithIntrinsicBounds( null, null, app.getIconsCache().getIcon(R.drawable.ic_action_filter, @@ -606,6 +590,25 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter categories = group.getWptCategories(); + if (categories != null && !categories.isEmpty()) { + Iterator it = categories.iterator(); + while (it.hasNext()) { + String category = it.next(); + if (category.equals("")) { + category = app.getResources().getString(R.string.waypoints); + } + sb.append(category); + if (it.hasNext()) { + sb.append(", "); + } + } + } + return sb.toString(); + } + @Override public int getItemViewType(int position) { Object item = items.get(position);