SimplicityApks / ReminderDatePicker

A Google Keep-like Date and Time Picker for reminders
Apache License 2.0
74 stars 26 forks source link

Wording DropDown - Next Friday #15

Closed chrisonline closed 9 years ago

chrisonline commented 9 years ago

A lot of users are writing that the wording is wrong. It show "Next Friday", but means "This Friday". "Next" means the 2. Friday.

Can you change it like in the "Google Notes" app? If I select this Friday it shows the Date instead of the text. Only Today, Tomorrow and Next Tuesday is shown as text. All others are only the Date as text.

SimplicityApks commented 9 years ago

Oh my god what the hell happened there... Well good that you found that, I'll see what I can do to make that work properly. In fact, the "Next ..." should probably only be showing for the day in exactly one week from today as it is in Google Keep. And maybe for tomorrow in one week as well. Everything after that should really be numbers only being just too far away. Would you rather have "This Friday" or just simple "Friday" for the day after tomorrow? I think I might be going with the plain weekday since that seems good enough to me and requires no work translating.

It might also be good if we had a flag (something like FLAG_PREFER_DAY_NAMES) so that when that is off, it behaves exactly like the picker in Keep, and with that set it shows "Friday" for the day after tomorrow and "Saturday" for the next one etc.

chrisonline commented 9 years ago

I would prefer like the Google Notes app. If I select the day after tomorrow I get the date and day - - > Fr. 13.2. But a flag would be better to have both. Only day or Date and Day.

SimplicityApks commented 9 years ago

Ah so you want both name and date... Well in Google Notes it is only date (Febuary 13)! What you are suggesting however is possible in the current version with a custom date format, just use new SimpleDateFormat("E. d.M.") for instance. For the "This Friday" text, I'm having a look at it right now and the changes required wouldn't be too many, the question is what behaviour ("This Friday" or "Friday", still not sure which is clearer) and what flag(s) we need exactly.

I'd go with "Friday" and a flag to turn that on (FLAG_SHOW_WEEKDAY_NAMES) and when it is off it uses the default date format as if the day were next month. But not quite sure, so tell me if you want something else.

chrisonline commented 9 years ago

Yes I think Friday is good. And a flag to display the day name or the date. Thanks for your support.

SimplicityApks commented 9 years ago

So there is your fix, didn't take as much effort as I thought it would ;).

While I was testing this I had an idea that maybe if the FLAG_NUMBERS is set, it would show "Friday 13.2." the same way it shows the time... That would be only for the weekdays, not for Today, Yesterday, Tomorrow or Next Wednesday (the former are only distracting and obvious, the latter would be too long to fit in the Spinner). That would, however, require a bit more work I think and I'd have to see if it's worth it. What do you think?

chrisonline commented 9 years ago

Great, thank you for the quick change.

Yes would be a great addition. But the same affect would be to set a date format. So it depends how much work it is.

chrisonline commented 9 years ago

You wrote earlier: What you are suggesting however is possible in the current version with a custom date format, just use new SimpleDateFormat("E. d.M.") for instance. F


But how can I do this? There exists only a setTimeFormat, but no setDateFormat. Can you add a setDateFormat too?

SimplicityApks commented 9 years ago

Lol you're right, I thought we had that already... I thought about implementing the setDateFormat method when I was doing setTimeFormat, but I came to the conclusion that it was not needed. One reason was that the date is formatted using DateUtils, not using a TimeFormat at all. It should probably fall back to using DateUtils when no custom DateFormat is set. That way the getDateFormat method will return null when no format is set but that is ok imo. To clarify this, I'll probably name it getCustomDateFormat instead. Well I guess I'll start writing that method since we obviously need it now ;), after that I'll have a look at the FLAG_NUMBERS affecting the date.

SimplicityApks commented 9 years ago

There you go, you can now actually do what I wrote above :P. Note that you'd want to use "new SimpleDateFormat("E d.M.") without the dot after the E as that already includes one ;). I'm still not quite sure about the numbers flag, once I've made that decision I'll upload a new version to maven central.

chrisonline commented 9 years ago

Great! Just added and it works... Thanks again for your quick support and help!!

The FLAG_NUMBERS would be a great addition, but if it is too much work I would not added it.

SimplicityApks commented 9 years ago

So I started working on the FLAG_NUMBERS thingy, and so far it is working quite well: screenshot_2015-02-14-22-42-42

The only major issue is that as it is implemented right now, when you set the FLAG_NUMBERS (even without having FLAG_WEEKDAY_NAMES set) the date spinner will increase its size by quite a bit to fit the extra TextView, same as the TimeSpinner does in the current version. This is especially apparent in other languages with longer translations, as it can even be too wide to fit on the screen... I'll see what I can do about that, at least when FLAG_WEEKDAY_NAMES is set it should not increase in size.

By the way I made it so you can customize that second date format as well ;). I was really amazed at how little coding was required to get it up and running, I guess this means this lib is well-written xD.

chrisonline commented 9 years ago

Great news. Thanks. And yes this lib is really well-written!! :-)

SimplicityApks commented 9 years ago

And there you have it: 99a92740, although there is one little spacing issue that can occur with some strings:

screenshot_2015-02-15-23-00-11

That is quite hard to fix (I think), as the adapter has to somehow know how large the temporary items will be when it is measuring. But before that the adapter needs to know if he's really measuring or getView is being called in an actual layout. Or we could make the spinner larger when a temporaray, large item is selected (I tried this without luck), but it would be kind of funny (read: horrible to use and predict developing with this lib) having the spinner suddenly grow in size... Whatever, this is what you'll need to suffer if you use those two flags together xD. If you have a solution, let me know, otherwise I'll leave it like this... (a very stupid fix would be to add whitespace to the "Pick a Date..." string lol)

chrisonline commented 9 years ago

I think we will leave it as it is at the moment. No idea to make it better as "add white space" to "Pick a Date".

SimplicityApks commented 9 years ago

I'll close this issue now as the new version is in maven central. We'll leave the spacing issue unfixed because we'd need to completely rewrite the Spinner's layout measuring and adapter model so it can handle the temporary items, which is overkill for such a minor and rare issue.