StephenBlackWasAlreadyTaken / xDrip-Experimental

Experimental Branches for Collaboration on DexDrip
GNU General Public License v3.0
25 stars 62 forks source link

Make sure that the hour and date pickers are combined. #286

Closed tzachi-dar closed 8 years ago

tzachi-dar commented 8 years ago

Signed-off-by: Tzachi Dar tzachi.dar@gmail.com

Simple code to make sure that on start sensor the two pickers work together.

This is something that was annoying me from day one, happy to finally fix it.

AdrianLxM commented 8 years ago

This is a behaviour I would really dislike.

First I choose the date, then I choose the time... and then I have to correct the date again as the time picker changed the date. With the additional problem that you can't see the when you have scrolled down to the hour picker on small devices you can't see the date picker.

AdrianLxM commented 8 years ago

A possibility could be to have the time picker above the date picker?

tzachi-dar commented 8 years ago

OK, replaced the order, time is now first.

Please let me know if this looks good.

AdrianLxM commented 8 years ago

Today I would have fallen for this trap again :/

I sometimes start the sensor just a bit over 24 hours after insertion - sometimes I wait 48 hours until I switch transmitters. The bad translation and handling of "am" and "pm" and that 16:00 can be before 10:00 (and therefore cause a day jump) certainly has it's influence. Could you make the spinner adopt to 24 hour format, please? If I'm not mistaken, tp.setIs24HourView(android.text.format.DateFormat.is24HourFormat(getApplicationContext())); in onCreate() should suffice. (Not tested, not written in an IDE.)

tzachi-dar commented 8 years ago

I'll change that to 24 hours format, and if you fill it is still problematic I can add a checkbox saying link the date and time pickers. Since it will only be in this dialog it will not add anything else to the settings.

tzachi-dar commented 8 years ago

OK, made the time viewer use 24 hour format.

AdrianLxM commented 8 years ago

I'm fine with always 24h format. But how about the US guys? android.text.format.DateFormat.is24HourFormat(getApplicationContext()) should return true if the user setting in the phone are 24h format and false otherwise.

tzachi-dar commented 8 years ago

I thought that you wanted to always have it to 24 hours. what are the setting on your phone?

tzachi-dar commented 8 years ago

OK, fixed it to match the settings on the phone.

tzachi-dar commented 8 years ago

Ok, seems that setting the picker to use 24 hours format was causing a crash when rotating the phone when the dialog was opened.

following http://stackoverflow.com/questions/25880638/rotating-android-device-while-viewing-dialog-preference-with-timepicker-or-numbe, the fix was trivial.

Also added a button to make this entire "feature" optional.

Please let me know if there are any more comments.