conference-app-2017 icon indicating copy to clipboard operation
conference-app-2017 copied to clipboard

Show local time on/Off + Device Time Zone Change

Open Pluu opened this issue 8 years ago • 5 comments

Issue

  • https://github.com/DroidKaigi/conference-app-2017/issues/198

Overview (Required)

Session#stime / Session#etime changes from Date to ZonedDateTime. Since Date has GMT, it turned out that the value changes depending on the time zone of the device.

https://github.com/DroidKaigi/conference-app-2017/issues/198#issuecomment-280082697

So we added processing below.

  • Add, com.jakewharton.threetenabp:threetenabp:1.0.5
  • Custom Gson registerTypeAdapter (String <-> ZonedDateTime)
    • ZonedDateTime is fixed Asia/Tokyo TimeZone
  • Custom orma annotation.StaticTypeAdapter (String <-> ZonedDateTime)
    • ZonedDateTime is fixed Asia/Tokyo TimeZone

By using the above, Session#stime / Session#etime certainly maintains the state of Asia/Tokyo.

Also, we will process it using the current location on/off and timezone in LocaleUtil#getDisplayDate. Please note that GMT is forcibly modified by time zone.

I'm sorry. The commit log became cluttered due to various trials. 🙇 🙇 🙇

Links

Screenshot

Before After
https://youtu.be/XAu4TpAg4hI

Pluu avatar Feb 17 '17 15:02 Pluu

:eyes:

konifar avatar Feb 17 '17 16:02 konifar

Thanks for contribution! 😄 Sorry, let me consider we should localize this app or not. Because we will have to think localization during development. I guess it's hard for the contributors. I'll reply by evening!

konifar avatar Feb 18 '17 20:02 konifar

it's ok. Is only PR as a way to solve issue.

Pluu avatar Feb 19 '17 05:02 Pluu

Sorry to be late 🙇 I'll review this tonight!

konifar avatar Feb 23 '17 05:02 konifar

^^ no problem

Pluu avatar Feb 23 '17 05:02 Pluu