From 36008e7879f310dee569f01cd5753648f6b523a3 Mon Sep 17 00:00:00 2001 From: veliymolfar Date: Tue, 30 Jun 2020 15:41:40 +0300 Subject: [PATCH] show opens tomorrow if works later --- .../src/main/java/net/osmand/util/OpeningHoursParser.java | 4 ++++ OsmAnd/src/net/osmand/plus/search/QuickSearchListAdapter.java | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/util/OpeningHoursParser.java b/OsmAnd-java/src/main/java/net/osmand/util/OpeningHoursParser.java index 01fee5cd9e..9c0cedb2f7 100644 --- a/OsmAnd-java/src/main/java/net/osmand/util/OpeningHoursParser.java +++ b/OsmAnd-java/src/main/java/net/osmand/util/OpeningHoursParser.java @@ -389,6 +389,10 @@ public class OpeningHoursParser { return openingTime; } + public String getOpeningTomorrow(Calendar calendar) { + return getOpeningTomorrow(calendar, ALL_SEQUENCES); + } + public String getOpeningDay(Calendar calendar, int sequenceIndex) { Calendar cal = (Calendar) calendar.clone(); String openingTime = ""; diff --git a/OsmAnd/src/net/osmand/plus/search/QuickSearchListAdapter.java b/OsmAnd/src/net/osmand/plus/search/QuickSearchListAdapter.java index 57c35d79dc..c512c6d26c 100644 --- a/OsmAnd/src/net/osmand/plus/search/QuickSearchListAdapter.java +++ b/OsmAnd/src/net/osmand/plus/search/QuickSearchListAdapter.java @@ -413,7 +413,9 @@ public class QuickSearchListAdapter extends ArrayAdapter { timeLayout.setVisibility(View.VISIBLE); timeIcon.setImageDrawable(app.getUIUtilities().getIcon(R.drawable.ic_action_time_16, colorId)); timeText.setTextColor(app.getResources().getColor(colorId)); - String rt = amenity.isClosed() ? app.getResources().getString(R.string.poi_operational_status_closed) : rs.getCurrentRuleTime(inst); + String rt = amenity.isClosed() + ? app.getResources().getString(R.string.poi_operational_status_closed) + : worksNow ? rs.getCurrentRuleTime(inst) : app.getString(R.string.will_open_tomorrow_at) + " " + rs.getOpeningTomorrow(inst); timeText.setText(rt == null ? "" : rt); } else { timeLayout.setVisibility(View.GONE);