Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate the hours from Pager #155

Open
imsakuu opened this issue Sep 5, 2022 · 17 comments
Open

Separate the hours from Pager #155

imsakuu opened this issue Sep 5, 2022 · 17 comments

Comments

@imsakuu
Copy link
Member

imsakuu commented Sep 5, 2022

Idea Description
see #151

The hours is built in the Pager because of ScreenScrollState issues.
If possible, it is preferable that the Hours be separated from the Pager.

Hours is in the Pager, so when we switch pages (tabs), the hours moves with it.
We want to detach the Hours from the Pager.

To do this, I think we need to consider how to handle ScreenScrollState.

Reference images and links
#109
#151

@surajsau
Copy link
Contributor

surajsau commented Sep 7, 2022

I would like to give this a try 🙋‍♂️

@imsakuu
Copy link
Member Author

imsakuu commented Sep 7, 2022

@surajsau
Thanks!! Assigned👍

@surajsau
Copy link
Contributor

surajsau commented Sep 11, 2022

@t-yusaku
You can unassign me from this task. I tried several approaches but wasn't able to come up with a proper solution. Would love to see someone else attempt this.

  • Separate vertical scroll and horizontal scroll states.
    • share the vertical scroll state common with Hours and ViewPager
    • individual horizontal scroll states for each ViewPager page
  • Custom HorizontalPager behvaior
    • All 3 days TimeTable are combined to a single @composable
    • adjust offset of the page when tabs are switched
    • layout the Hour and Timetable in a box (No need for a HorizontalViewPager @composable)

@imsakuu
Copy link
Member Author

imsakuu commented Sep 11, 2022

@surajsau
First, thanks you so much for trying this issue and your contribution. I know it is challenging.
And thanks for sharing the approaches. This should help others. 👍

@Pon57
Copy link

Pon57 commented Sep 12, 2022

I have a question about this issue.

Right now the vertical scroll position is on each page. If we implement this issue, does this mean that the vertical scroll position should be shared between each page and Hours?

For example, if the first page is scrolled to 14:00 and then switched to the second page, would the same vertical scroll position (14:00) be displayed?

@takahirom
Copy link
Member

I think it has a tradeoff.
But, I'd like to share the scroll state because I want to see that!

@Pon57
Copy link

Pon57 commented Sep 12, 2022

I see. Thank you!
If I come up with something, I will request to have it assigned.

@takahirom
Copy link
Member

@Pon57 Would you like me to assign this issue to you?

@Pon57
Copy link

Pon57 commented Sep 13, 2022

@takahirom
I am not confident that I can solve it, but I would like to give it a try.
Please assign me!

@Pon57
Copy link

Pon57 commented Sep 13, 2022

@t-yusaku @takahirom
Sorry for repeating myself. I'm asking because the problem to be solved in this issue was not clear to me.
Does this issue mean that Hours should be shared like this video?

device-2022-09-13-223900.mp4

@imsakuu
Copy link
Member Author

imsakuu commented Sep 13, 2022

@Pon57
Thanks for asking. 👍

The most important thing in this issue is to separate Hours from HorizontalPager.
In the current timetable, HorizontalPager contains Hours and each page have its own Hours.
In this issue, we want to stop them and have Hours exist outside of HorizontalPager.

The next important thing is to share the Hours's position between the pages as you have shown.

It is prefereable to resolve both in this issue.
However, if it is difficult to resolve both, you can focus on the first thing only.

@Pon57
Copy link

Pon57 commented Sep 13, 2022

@t-yusaku
Thanks for the reply! My question was completely answered by your reply.
I will try to work on it 🙏

@takahirom
Copy link
Member

@Pon57 Can you have time to develop this? 👀

@Pon57
Copy link

Pon57 commented Sep 29, 2022

@takahirom
Sorry for the late response on this issue.

I am working on it a little bit, but I am not able to spend as much time on it as I would like.
I have been able to understand the source code, figure out how it works, and come up with a few ideas based on that. However, I am still trying to implement it and see if it works as intended or if it is even possible to implement it in the first place.

If this issue is urgent or very important, please remove my assignment. Sorry.

@takahirom
Copy link
Member

@Pon57 You can open PR with the work in progress.
You don't have to do all the things.
#807

@Pon57
Copy link

Pon57 commented Sep 30, 2022

@takahirom
I understand. 🙏
Since I have not been able to do most of the commits yet (not even a test implementation), I will work on it this Saturday and Sunday to create a PR. Can you wait until then?
I will also let you know if that work proves to be impossible with my ideas.

@takahirom
Copy link
Member

@Pon57 It's ok. All we can do is to do the best what we can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants