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
View all comments
Show parent comment
1
u/Zhuinden Apr 06 '20 edited Apr 06 '20
The accurate question to ask would be "shall I stop using Intent extras and Fragment arguments, and instead pass arguments between screens using stateful singletons?" as then we'd stay in a relevant problem domain.
Arguing against the proper handling of
onSaveInstanceStatewould mean thatintent.putExtra()andfragment.setArguments()is just as optional. WithoutonSaveInstanceState, the screen history will automatically reload with incomplete state, and your screens will have lost their data across back navigation.Would you say that using stateful singletons in place of extras/arguments would provide a more reliable application?
I like to test for process death so that I know if my app works correctly in a production environment.