simonpoole / OpeningHoursFragment

Android UI element for displaying and editing an opening hours value
MIT License
9 stars 2 forks source link

Easy adding mode #13

Closed HolgerJeromin closed 6 years ago

HolgerJeromin commented 7 years ago

It is cool, that vespucci can edit all complex opening hours. But entering an simple string is really cumbersome.

It would be great if there would be a gui like the one from streetcomplete for quick entering strings like: Mo-Fr 08:00-19:00;Sa 09:00—14:00;Su, PH off

simonpoole commented 7 years ago

Just create a corresponding template and use that (modifying the times slightly if necessary). For example the existing weekdays template.

See https://github.com/simonpoole/OpeningHoursFragment/blob/master/lib/documentation/docs/help/en/Opening%20hours.md for more information.

Note: normally you would set the most common pattern where you are mapping to the default template.

simonpoole commented 7 years ago

BTW Mo-Fr 08:00-19:00;Sa 09:00—14:00;Su, PH off is not a valid OH value, it should be (if that is what you ment):

Mo-Fr 08:00-19:00;Sa 09:00—14:00; PH,Su off

(See http://wiki.openstreetmap.org/wiki/Key:opening_hours/specification weekday_selector) Naturally setting Su to off is not necessary to start with and rather verbose.

simonpoole commented 7 years ago

Further note: this may be a bit of a workflow issue in vespucci itself, since we are assuming that you add the OH tag via a preset (or reapplying a preset) see: https://github.com/MarcusWolschon/osmeditor4android/issues/586

HolgerJeromin commented 7 years ago

OK, templates are nice. Thanks for the hint.

Perhaps with using them my problem is that my phone is too small (5 inch) or my finger not precise enough to change a hour/minute to the correct value on the first try. I need mostly three attempts on every change. That is why the the streetcomplete gui with the native time input is much easier to use.

HolgerJeromin commented 7 years ago

I have never seen a requirement to have the PH before a day... cc @ypid

simonpoole commented 7 years ago

The default time increment is 15 minutes which in my experience should work in most cases, alternatives would be to allow a number picker as an input method or add an additional larger increment on the bars.

ypid commented 7 years ago

Mo-Fr 08:00-19:00;Sa 09:00—14:00; PH,Su off

Good point. Thanks. According to the definition of weekday_selector @simonpoole is correct. I would say this is a bug in the spec. Su,PH off is quite common. @simonpoole What do you think?

HolgerJeromin commented 7 years ago

What about two time wheels (keeping 15/5/1 minutes increments for selecting speed) in the time row like this one http://blog.teamtreehouse.com/wp-content/uploads/2012/12/time.png Uses perhaps too much vertical space... Edit: perhaps a horizontal wheel is an option, too

simonpoole commented 7 years ago

@ypid IMHO even if this specific variant is easy to handle I still wouldn't make it "official" except if holidays are treated completely the same as weekdays which may have a lot of undesired consequences.

ypid commented 7 years ago

OK, valid point. I had similar issues already in opening_hours.js. On the other hand Mo-Fr 08:00-19:00; Sa 09:00-14:00; Su,PH off looks like the (for humans 😉) logical order (first all weekdays are handled, and the last rule conveniently also sets PH to closed). I guess this calls for a proper proposal once more. Added to my todo.

Related to: https://github.com/simonpoole/OpeningHoursParser/issues/6#issuecomment-229504126

simonpoole commented 7 years ago

https://github.com/simonpoole/OpeningHoursFragment/commit/089b56df23f1adaf75b31d124828ee1d471a5f37 adds a number picker as alternative method to edit time ranges screenshot_20170729-232305

simonpoole commented 6 years ago

No further comments, closing.