worldclockwidget icon indicating copy to clipboard operation
worldclockwidget copied to clipboard

Replace Joda-Time by Time4A

Open MenoData opened this issue 6 years ago • 3 comments

This first step is a library switch from Joda-Time-Android to Time4A. It enables the project to exploit the astronomical features of Time4A in order to solve the issue #46 (calculating sunrise/sunset).

Two minor optimizations had also been done:

  • A project-wide unique clock instance had been introduced (PlatformClock) which also takes into account possible adjustments of mobile device clocks (done by app users as compensation for bad timezone data on old Android versions). The new clock logically replaces the Joda-method DateTimeUtils.currentTimeMillis()
  • Some method signatures in the class TimeZoneInfo had been enhanced by an extra moment-parameter in order to avoid multiple calls of current clock time inside the same method call.

Examples for calculating sunrise or sunset can be found in the documentation of class SolarTime.

MenoData avatar Apr 08 '18 13:04 MenoData

will check and do act accordingly.

dasbiswajit avatar Apr 08 '18 22:04 dasbiswajit

Does this need changes in the proguard config to build properly?

arminha avatar Jul 18 '18 20:07 arminha

Sorry for late update of this pull request but the latest commits have now solved the travis build error as predicted in my previous commit. Based on this change, sunrise/sunset-calculations are easy to be added to your app. In case of any questions about usage, just ask a question i.e. open an issue on the issue tracker of Time4J.

MenoData avatar Nov 02 '18 03:11 MenoData