-
Notifications
You must be signed in to change notification settings - Fork 26
Replace Joda-Time by Time4A #77
base: master
Are you sure you want to change the base?
Conversation
will check and do act accordingly. |
Does this need changes in the proguard config to build properly? |
worldclockwidget/build.gradle
Outdated
@@ -109,7 +109,7 @@ dependencies{ | |||
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar' | |||
compile 'com.android.support:support-v4:19.1.0' | |||
compile 'com.google.code.gson:gson:2.3.1' | |||
compile 'net.danlew:android.joda:2.9.4.1' | |||
compile group: 'net.time4j', name: 'time4j-android', version: '3.41-2018d' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This version should be updated to 3.44-2018e so at least two warnings or more of the travis build would disappear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build complains mainly about two unresolved references to library class members. This problem is solved by the newer version 3.44-2018e. About Proguard: There is already a special consumer-proguard-file in the library. For example, let's look at the build note
Note: net.time4j.base.ResourceLoader calls '(net.time4j.base.ResourceLoader)Class.forName(variable).newInstance()'
This should not be a problem because the delivered proguard-file already keeps the class net.time4j.android.spi.AndroidResourceLoader
, see also the file content.
was removed in Time4A-v4.0
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. |
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:
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-methodDateTimeUtils.currentTimeMillis()
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.