Experimented with Compose for Desktop the last wee...
# compose-desktop
t
Experimented with Compose for Desktop the last weeks and implemented a Image Browser to show the potential for Compose: https://gitlab.com/compose1/imagebrowser Code is just prototype
🎉 14
🔥 9
👏 5
😮 1
o
looks quite good, great job! any specific API/functionality you find missing in CfD atm?
s
@Timo Drick It’s difficult to tell, but is the application lagging when you scroll?
t
@olonho I am a professional Android developer and handling images is completly different here. But i like it. Skia library is fast. Currently i am missing functionality to get image metadata. But maybe it is there. But there is not much documentation for Skia. Also a big problem still is that i get crashes. https://github.com/JetBrains/compose-jb/issues/124. Maybe some one else can check with this application if you can reproduce it. I think it also happens in windows.
@spierce7 I think this is because of the recording. Just try it yourself.
s
@Timo Drick Could you share some details about the navigation? @olonho Are there any plans to add documentation for compose navigation in desktop apps? By the way the current doc looks pretty good.
t
@suresh I implementated it before the official jetpack compose solution was published. So i am not sure but when there is interest maybe i will try to make a lib out of this and add some documentation. But it is just a very simple navigation and transition animation framework. So you can only do very simple transitions. Also it will store states. When you use savedinstancestate inside of your screens the states (e.g. scroll position in LazyColumn) will be saved and restored when you navigate back.
o
@suresh it’s an interesting question, if navigation belongs to Compose, or is something more bound to application level. Currently, we don’t have recommended approach for navigation, however please check how Decompose is used in https://github.com/JetBrains/compose-jb/tree/master/examples/todoapp
👍 1
t
Maybe also interesting is this official documentation: https://developer.android.com/reference/kotlin/androidx/compose/runtime/savedinstancestate/RestorableStateHolder There is a sample implementation of a simple navigation without transition and without back navigation.
s
if navigation belongs to Compose, or is something more bound to application level
@olonho Thanks! IMHO, something simpler (like the current compose navigation) as part of compose toolkit would be useful for smaller applications. Are there any technical limitations on porting/using the jetpack compose navigation on desktop? Also i am not using multi platform.
@Timo Drick thanks.. This. does work in Desktop also..rt?
t
Yes i currently working on my navigation solution to use this RestorableStateHolder as base.
👍 1
s
Currently i am missing functionality to get image metadata.
Image metadata is usually out of scope for graphic libraries. Those are limited to read flags like width, height & orientation that are needed to display the image.