Hey all.
Recently I've migrated my open-source app called Gamedge to be a pure Jetpack Compose app. It utilizes all the latest libraries & tools in the Android development world.
A couple of thoughts: 🧵
https://github.com/mars885/gamedge
😶 3
Paul
08/04/2022, 9:15 PM
I find it extremely easy to use & build new UI once you grasp how it works. This is is definitely the future of the Android development, in my opinion.
Paul
08/04/2022, 9:16 PM
The biggest one is that Compose as of 1.2.0 does not have 1 to 1 parity with the View system.
For example, MotionLayout support for Compose lacks some features like OnSwipe gestures. Another one is the ability to control the zIndex of composable transitions. Also, tooling support like rendering previews does not work far too often.
A couple of stats before & after migration to Compose.
Before:
- Total lines: 40,847
- APK Release Size with R8: 4.7 MB
After:
- Total lines: 37,822
- APK Release Size with R8: 4.7 MB
Less lines of code due to removal of verbose XML & APK size stayed around the same.
Paul
08/04/2022, 9:17 PM
Overall, it's been a fun journey migrating the app from the View system to a pure Jetpack Compose one.
m
marlonlom
08/06/2022, 1:34 AM
How did you handle data surviving across screen rotating ?
p
Paul
08/08/2022, 9:11 AM
@marlonlom I'm using the ViewModel class, which takes care of it.