I wanted to attempt something ambitious as a learn...
# compose
o
I wanted to attempt something ambitious as a learning experience. Changing the PagerState and the way pager works to work with a mutable orientation state that can be changed to horizontal or vertical depending on the user swipe. So I've spent like a week studying PagerState internal architecture and LazyLayouts and stuff. But now when I wanted to write my custom version, I realized many of the functions or classes used in PagerState and the entire pager architecture (Pager measure policy, snap position, cache window) are internal. So I thought I'd just do some copy pasting into my custom CrossPager folder to make them available. But I've been going down that route for a while now, and it seems to be an endless rabbit hole of duplicate code that has no end. Every new file I copy has some more imports that are internal and need to be copied tooπŸ₯². Is there any better way to do this, like inheriting from a certain class that'll make me have access to these internal files and private functions, or will I just have to settle for something more simpler and not all the fancy way pager do thingsπŸ₯²
e
No better way. Its a conscious decision.
o
So I should keep going?πŸ™‚
s
We are slowly making progress on making these pieces public. Right now they are internal on purpose, as we don't have to commit to maintaining the API that can easily change as we update the implementation.
πŸ‘ 1
For your case, copy pasting them is correct.
t
This is something I always wondered, why wasn't everything open. In 99% of the cases we want to use the full implementation but in some cases that we need to customize some specific behaviour its a lot of copy and paste and also make hard to keep it in sync when updating the versions.
πŸ‘ 1
πŸ‘πŸΏ 1
s
Yeah, just blindly making everything open makes it hard to update or change behavior internally, as someone might be depending on those pieces externally
βž• 2
πŸ₯² 1
o
Alright. Will keep on hacking at it.πŸ™‚πŸ™‚πŸ€²πŸ½. Appreciate the effort on making them public eventually.πŸ‘πŸ½