Merge pull request #7887 from Dima-1/Issue_7244
Issue #7244 Sunrise/sunset time in the map mode
This commit is contained in:
commit
5e1062023c
1 changed files with 12 additions and 0 deletions
|
@ -55,10 +55,12 @@ import net.osmand.render.RenderingRuleProperty;
|
||||||
import net.osmand.render.RenderingRuleStorageProperties;
|
import net.osmand.render.RenderingRuleStorageProperties;
|
||||||
import net.osmand.render.RenderingRulesStorage;
|
import net.osmand.render.RenderingRulesStorage;
|
||||||
import net.osmand.util.Algorithms;
|
import net.osmand.util.Algorithms;
|
||||||
|
import net.osmand.util.SunriseSunset;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.text.DateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -581,6 +583,16 @@ public class ConfigureMapMenu {
|
||||||
items[i] = OsmandSettings.DayNightMode.values()[i].toHumanString(activity
|
items[i] = OsmandSettings.DayNightMode.values()[i].toHumanString(activity
|
||||||
.getMyApplication());
|
.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();
|
int i = view.getSettings().DAYNIGHT_MODE.get().ordinal();
|
||||||
bld.setSingleChoiceItems(items, i, new DialogInterface.OnClickListener() {
|
bld.setSingleChoiceItems(items, i, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue