diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java index 840b2e7122..e0d5eb2b04 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java @@ -213,8 +213,8 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter= 2 || currentYear != markerYear; + createdEarly = currentDay - markerDay >= 2 || currentYear != markerYear; } - if (markerInHistory) { + if (markerInHistory || createdEarly) { itemViewHolder.point.setVisibility(View.VISIBLE); itemViewHolder.description.setVisibility(View.VISIBLE); - itemViewHolder.description.setText(app.getString(R.string.passed, new SimpleDateFormat("MMM dd", Locale.getDefault()).format(new Date(marker.visitedDate)))); - } else if (noGroup && early) { - itemViewHolder.point.setVisibility(View.VISIBLE); - itemViewHolder.description.setVisibility(View.VISIBLE); - Date date = new Date(marker.creationDate); + Date date; + if (markerInHistory) { + date = new Date(marker.visitedDate); + } else { + date = new Date(marker.creationDate); + } String month = new SimpleDateFormat("MMM", Locale.getDefault()).format(date); if (month.length() > 1) { month = Character.toUpperCase(month.charAt(0)) + month.substring(1); } String day = new SimpleDateFormat("dd", Locale.getDefault()).format(date); - itemViewHolder.description.setText(month + " " + day); + itemViewHolder.description.setText(app.getString(R.string.passed, month + " " + day)); } else { itemViewHolder.point.setVisibility(View.GONE); itemViewHolder.description.setVisibility(View.GONE); @@ -428,7 +429,10 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter 1) { + monthStr = Character.toUpperCase(monthStr.charAt(0)) + monthStr.substring(1); + } + return monthStr; } private int getLastDisplayItemIndexOfGroup(MapMarkersGroup group) { diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersHistoryAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersHistoryAdapter.java index 65558af2e3..06211e0253 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersHistoryAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersHistoryAdapter.java @@ -9,7 +9,6 @@ import android.view.ViewGroup; import android.widget.TextView; import net.osmand.plus.IconsCache; -import net.osmand.plus.MapMarkersHelper; import net.osmand.plus.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; @@ -125,7 +124,13 @@ public class MapMarkersHistoryAdapter extends RecyclerView.Adapter 1) { + month = Character.toUpperCase(month.charAt(0)) + month.substring(1); + } + String day = new SimpleDateFormat("dd", Locale.getDefault()).format(date); + itemViewHolder.description.setText(app.getString(R.string.passed, month + " " + day)); itemViewHolder.optionsBtn.setBackgroundDrawable(app.getResources().getDrawable(night ? R.drawable.marker_circle_background_dark_with_inset : R.drawable.marker_circle_background_light_with_inset)); itemViewHolder.optionsBtn.setImageDrawable(iconsCache.getThemedIcon(R.drawable.ic_action_reset_to_default_dark)); @@ -219,7 +224,10 @@ public class MapMarkersHistoryAdapter extends RecyclerView.Adapter 1) { + monthStr = Character.toUpperCase(monthStr.charAt(0)) + monthStr.substring(1); + } + return monthStr; } public interface MapMarkersHistoryAdapterListener {