Zoomable icon indicating copy to clipboard operation
Zoomable copied to clipboard

Support for KMP

Open phillipsk opened this issue 11 months ago • 9 comments

Java/Android compose ui tooling library references are preventing the library from being a pure kotlin multiplatform library

phillipsk avatar Mar 02 '24 05:03 phillipsk

@phillipsk Thank you for creating an issue.

I am not familiar with KMP, so please let me know. I don't think the zoomable library depends on ui-tooling, since ui-tooling is only used in the app module. How should I deal with this?

usuiat avatar Mar 07 '24 13:03 usuiat

It's mainly build system changes. Mostly going to be on the gradle build files and publishing. A good start is adding the kotlin multiplatform gradle plugin and moving all of the library code to commonMain.

You might hit an issue with @FloatRange annotations if they aren't a KMP module. I've successfully used your project in a Compose multiplatform project of mine. Can confirm it works in both iOS and Android.

amrfarid140 avatar Mar 11 '24 21:03 amrfarid140

@amrfarid140 You mean you forked it and change the build system, right? Otherwise, I don't see how it could work on iOS side.

romainbsl avatar Mar 19 '24 09:03 romainbsl

Yes @romainbsl that's what I meant.

amrfarid140 avatar Mar 19 '24 10:03 amrfarid140

@usuiat I probably can help providing Compose Multiplatform support. I'll prepare a PR

romainbsl avatar Mar 19 '24 10:03 romainbsl

@romainbsl Thank you! I'm looking forward it.

usuiat avatar Mar 19 '24 14:03 usuiat

Is there any progress in this subject?

szczepanski-k avatar May 29 '24 16:05 szczepanski-k

@szczepanski-k I have released v2.0.0-beta01 that supports iOS. https://github.com/usuiat/Zoomable/releases/tag/v2.0.0-beta01

usuiat avatar May 30 '24 23:05 usuiat

I recommend a similar image zooming library ZoomImage (https://github.com/panpf/zoomimage).

It perfectly supports Compose Multiplatform and Android View, supports zooming, panning, positioning, rotation, and subsampling of large images. It also integrates image loaders such as sketch, glide, picasso, coil, etc.

The most important thing is that it can zoom large images without memory overflow

panpf avatar Aug 08 '24 10:08 panpf