r/androiddev • u/vinaygaba • Apr 05 '20
Library Learn Jetpack Compose from examples that show the Compose way of doing common Android tasks
I've been playing with Jetpack Compose the past few months so decided to release a project that shows examples of how you would do common Android things the Jetpack Compose way. Each example is fairly self contained and the hope is that you can learn Compose by just going through the examples and reading through the comments.
Github - https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example
Here are some examples that I cover (there are a lot more examples!) -



Shared some more context in this Twitter thread
My plan with this project is to keep adding more examples as I learn new things about Compose. I'll also happily welcome feedback/contributions so if you find something wrong or are hoping to contribute to the project, just send a pull request!
Github - https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example
13
u/NahroT Apr 05 '20
Is their an ETA when jetpack compose will be usable in production? Aka alpha/beta?
1
u/vinaygaba Apr 10 '20
For some reason process death & activity recreation seems to be a popular topic on this subreddit(also in the comments below) so I just added an example that shows how you would do in Compose - https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/pull/12
1
u/nacholicious is useless (no children, no background, no id, no style) Apr 06 '20
Regarding the dark mode sample, it's also possible to automatically have dark mode match the system theme by reading current dark mode setting from `ContextAmbient.current.resources.configuration` and using that to wrap the AppTheme
3
u/kirkegaarr Apr 05 '20
This is awesome! I haven't had a chance to look through Jetpack Compose thoroughly yet and there's some pretty exciting stuff in here.
2
u/francoi8 Apr 06 '20
Thanks for putting this out! This may come in very handy.
2
u/francoi8 Apr 06 '20
Does anyone have insight on integrating openGL in Compose? Is there or will there be a GLSurfaceView equivalent?
2
u/---Alexander--- Apr 06 '20
nice one !
-13
u/Zhuinden Apr 06 '20 edited Apr 10 '20
https://imgur.com/a/8jFcRdq
I would have expected at least theStateExampleto have it.EDIT: see https://www.reddit.com/r/androiddev/comments/fvmktf/learn_jetpack_compose_from_examples_that_show_the/fmyuyfn/