Quivr / iOS-Week-View

QVRWeekView is a framework which provides a calendar view that can be customized to display between 1 to 7 days in both portrait and landscape mode. Includes customization features to customize colours, fonts and sizes.
MIT License
39 stars 21 forks source link

day labels (top bar) don't resize in 7 day view #1

Closed ezmegy closed 7 years ago

ezmegy commented 7 years ago

Hi,

Cool project, I just tried it, great stuff! ;)

I'll post a few things I found (I'll look more into them, just after first impression).

Day labels (top bar) don't resize in 7 day view: the text gets squeezed, it does not resize or break lines, see screenshot here (Sorry about the locale:)

reilem commented 7 years ago

Hey there! Thanks for showing interest :) It's actually quite influenced by the android-week-view. It's all far from finished of course so any help would be great.

And I've actually been trying to figure out a way to solve this issue. I tried using the UILabel's minimumScaleFactor, but then you will get days of varying font size since not all Strings will always be of equal length. I'll have to have another look at how to solve this. :)

ezmegy commented 7 years ago

Thanks for the quick reply!

I have been using the android version for a few weeks now and I'm interested in iOS for the same project too. Hopefully I can help out a bit, we'll see :)

ezmegy commented 7 years ago

Regarding minimumScaleFactor: maybe calculate it for all the labels, and take the minimum? This would ensure that all the labels fit and have the same size.

But: I don't think there's much space, especially when you display 7 days. On Android I played around with it a bit and found no good (readable) solution without line breaks. So, in the end I had dates like: 15 09 Tue But some users (people who I asked to try what they think about the usability) even said that the 09 is not really intuitive, they would rather like Sept instead. However, with 15 Sept and a custom font type, the size that was fitting the space was back at 7-8pt (in the case of 7 days) which was again barely readable.

A totally different approach I have seen when researching calendar apps was having the days of the week (Tue) "fixed" at the top, and when swiping, only date part (15\nSept) was changing below it. However, I'm not sure how much more effort this would take to implement.

My conclusion so far: I would go for one, or maybe even two line breaks and have dates like:

15 Sept Tue

OR

Sept 15 Tue

Of course this is in no way a feature request, I'm just thinking out loud :)

reilem commented 7 years ago

I'm thinking it will probably end up being a combination of things. I will probably give minimum scale another go, or try to compute a minimum font myself. To prevent the font from becoming illegible I will put a ceiling on this minimising feature. If the ceiling is reached, the code will attempt increasingly smaller date formats. I have already implemented that the year is cut off when the label becomes too small. Perhaps cutting off the day of week, and then using month number instead of word.

I think going to new lines would complicate things seeing as that would require the resizing of a core "height" variables which is used in many calculations should only really be changed as a customisation feature not a dynamically changing one.

At the end of the day if the user wants 7 days, then I think doing this in landscape mode would be much cleaner. That's why I allow the changing of number of days in portrait and landscape independently :)

reilem commented 7 years ago

I've had a go at fixing this issue and I think it should be working now. It's a combination of format change and font resizing with minimum font being customisable. I'm probably gonna work on making the formats customisable as well some time in the future.

(I've also updated the README since it was missing a lot of features)

ezmegy commented 7 years ago

Cool! I tried it out and it looks really nice!