https://kotlinlang.org logo
Title
s

Stefan Oltmann

07/14/2021, 6:26 AM
I'm looking for a ViewPager like https://google.github.io/accompanist/pager/ that also works for Compose for Desktop in a KMP project. Can someone recommend a solution?
1
As far as I can see they tried to build it for KMP, but are "not there yet": https://github.com/google/accompanist/issues/546
m

Mitchell Syer

07/16/2021, 6:27 PM
I ported the non-android specific accompaniest libraries to Compose desktop for my usage, feel free to use them https://github.com/Syer10/accompanist
👍 1
:thank-you: 1
s

Stefan Oltmann

07/17/2021, 7:40 PM
I will give it a try 🙂
@Mitchell Syer I use the ViewPager now in my project. Works good. Thank you for your effort. 🙂 Did you think about contributing your changes back to the main project? Looks like they could need help.
👍 1
This works for both Android and Desktop without any issues.
m

Mitchell Syer

07/19/2021, 5:51 PM
Most of my changes were just the build files and libraries used. I just ported them to Compose Desktop, not KMP, which is what they want for desktop support. I could try rewriting it for KMP, but I dont have that much time currently.
s

Stefan Oltmann

07/20/2021, 6:27 AM
I don't know what they mean by "KMP", because I just copied the three files that implement the ViewPager into my "commonMain" module and now it works for Android & Desktop...