timetable icon indicating copy to clipboard operation
timetable copied to clipboard

Allow to specify min hour height

Open TatsuUkraine opened this issue 3 years ago • 9 comments

Prev version of the package had the ability to specify min cell height. New package version forces you to provide min duration. With various screen sizes this type of config a little bit problematic. Especially if take into account that there is no setter for this value.

So whenever screen size change only one option is to grab screen size or layout constraints, calculate min duration somehow, dispose existing controller, and create a new one. And this flow may happen quite often due to device rotate.

Proposition Add ability specify min cell height.

An additional feature that may be useful - allow changing min duration in time controller

TatsuUkraine avatar Jun 10 '21 13:06 TatsuUkraine

So whenever screen size change only one option is to grab screen size or layout constraints, calculate min duration somehow, dispose existing controller, and create a new one. And this flow may happen quite often due to device rotate.

it appears that there is no workaround. Since when you try to dispose one controller to create a new one, timetable fails with an error that this controller was used after being disposed.

TatsuUkraine avatar Jun 10 '21 14:06 TatsuUkraine

@JonasWanke just curious, what is your thoughts regarding this?

TatsuUkraine avatar Aug 07 '21 13:08 TatsuUkraine

@TatsuUkraine Sounds good, though I'm not yet sure how I'll implement this. The TimeController currently does not know how large the individual widgets are that are using it. Theoretically, multiple TimeZoom widgets with different heights could use the same controller. Should the minimum size refer to the widget that the user is currently scaling, or to the shortest widget?

JonasWanke avatar Aug 07 '21 13:08 JonasWanke

Oh, not quite sure. I was thinking that it may be height of the cell, and since it belongs to time controller, it may restrict all TimeZoom widget that using it. The use case of this is that - when dev is working with the UI there is no exact dimensions except constraints. Even harder to manipulate with calendar appearance when you making responsive UI.

TatsuUkraine avatar Aug 07 '21 13:08 TatsuUkraine

@JonasWanke For instance like min and max duration values from #95 aims to solve UX problems, this particular feature is may be useful when you want to make the min height which is equals to tapable height value or something like that, to simplify user interaction with calendar

TatsuUkraine avatar Aug 07 '21 13:08 TatsuUkraine

@JonasWanke hi) just curious if you have any ideas how this can be solved? Recently I tried the most recent version in my app, and noticed one more problem which I don't know how to solve properly since there is no straightforward way to control min height of the row

Снимок экрана 2021-10-21 в 15 11 20

TatsuUkraine avatar Oct 21 '21 12:10 TatsuUkraine

@JonasWanke do you have any recommendation on how the issue from my prev comment with overflow can be solved?

TatsuUkraine avatar Aug 02 '22 10:08 TatsuUkraine

@TatsuUkraine You could use auto_size_text to decrease the text size automatically instead of overflowing the available space, or you could show fewer labels depending on the zoom factor.

Unfortunately, I'm still not quite sure about the best way to implement the minimum height, but I could give it a try, hopefully, next week. However, keep in mind that even a minimum height for hours or the day doesn't fully solve the overflowing labels because the user could set a text-scale factor for their device, making the numbers larger than expected

JonasWanke avatar Aug 02 '22 11:08 JonasWanke

However, keep in mind that even a minimum height for hours or the day doesn't fully solve the overflowing labels because the user could set a text-scale factor for their device, making the numbers larger than expected

@JonasWanke true, only one thing that we consider this as an edge case, since we can't fully control it though) for me main issue is that I need to match the design that we currently have with prev version of the package since it's going to be majority of usage cases

TatsuUkraine avatar Aug 02 '22 11:08 TatsuUkraine

I've added this as part of v1.0.0-alpha.9: timeController.minDayHeight.

JonasWanke avatar Aug 19 '22 13:08 JonasWanke

@JonasWanke you're my savior!)

TatsuUkraine avatar Aug 19 '22 13:08 TatsuUkraine