dustin-johnson / timezonemap

Java/Kotlin library to map locations or regions to time zones
MIT License
50 stars 8 forks source link

Fixed library to get it working for Android #3

Closed eugene-galkine closed 4 years ago

eugene-galkine commented 5 years ago

removed any uses of Stream and Optional (except for in the data builder) since they require Java 8 and will not work on older versions of Android

codecov[bot] commented 5 years ago

Codecov Report

Merging #3 into master will decrease coverage by 1.11%. The diff coverage is 91.76%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master       #3      +/-   ##
============================================
- Coverage     96.68%   95.56%   -1.12%     
+ Complexity      122      117       -5     
============================================
  Files            11       11              
  Lines           241      248       +7     
  Branches         26       43      +17     
============================================
+ Hits            233      237       +4     
- Misses            8       10       +2     
- Partials          0        1       +1
Impacted Files Coverage Δ Complexity Δ
...map/src/main/java/us/dustinj/timezonemap/Util.java 100% <100%> (ø) 8 <0> (+1) :arrow_up:
.../java/us/dustinj/timezonemap/utils/Properties.java 75% <73.33%> (-25%) 3 <0> (-2)
.../main/java/us/dustinj/timezonemap/TimeZoneMap.java 92.92% <95.31%> (+0.85%) 30 <1> (-4) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update db8f5da...b41f157. Read the comment docs.

dustin-johnson commented 4 years ago

@eugene-galkine, sorry for the delay. I agree that it is poor form that this library doesn't support older version of Android very well. I would very much like to keep the clean syntax that Java 8's streams provided, however, so I opted to migrate this library to Kotlin. With Kotlin we can use sequences, which are very much like streams but don't require an update to the JVM or JDK to work, thus they are compatible with older versions of Android. I've made the needed changes, tested them all the way back to Android 19 (KitKat 4.4, released in 2013). The newest release (4.0, since it breaks API compatibility slightly by removing Optional) has been created and should be live in Maven central in a couple hours.

Please let me know if this works for your use case, and thank you for pushing me to more carefully consider older Android releases.

dustin-johnson commented 4 years ago

Declining this PR as older devices are now supported by leveraging Kotlin's language features instead of Java 8's.