From 222ac7210cd211abac405f0df1de8546860811bf Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Sat, 9 Nov 2019 22:10:03 +0300 Subject: [PATCH] Issue #7244 Sunrise/sunset time in the map mode --- .../net/osmand/plus/dialogs/ConfigureMapMenu.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java index 8b1d2a47fe..a9947bf290 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java @@ -55,10 +55,12 @@ import net.osmand.render.RenderingRuleProperty; import net.osmand.render.RenderingRuleStorageProperties; import net.osmand.render.RenderingRulesStorage; import net.osmand.util.Algorithms; +import net.osmand.util.SunriseSunset; import org.apache.commons.logging.Log; import java.io.File; +import java.text.DateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -581,6 +583,16 @@ public class ConfigureMapMenu { items[i] = OsmandSettings.DayNightMode.values()[i].toHumanString(activity .getMyApplication()); } + + SunriseSunset sunriseSunset = activity.getMyApplication().getDaynightHelper().getSunriseSunset(); + if (sunriseSunset != null) { + DateFormat dateFormat = DateFormat.getTimeInstance(DateFormat.SHORT); + String sunriseSunsetTime = "\n" + dateFormat.format(activity.getMyApplication() + .getDaynightHelper().getSunriseSunset().getSunrise()) + "/" + + dateFormat.format(activity.getMyApplication() + .getDaynightHelper().getSunriseSunset().getSunset()); + items[0] += sunriseSunsetTime; + } int i = view.getSettings().DAYNIGHT_MODE.get().ordinal(); bld.setSingleChoiceItems(items, i, new DialogInterface.OnClickListener() { @Override