Are there good example projects available on githu...
# compose
v
Are there good example projects available on github that I can use to look at for reference? I'm a little hung up on the fact that if there should be multiple ComponentActivity or just one
p
Example of what Jetpack Compose? Thousands on GitHub, from templates to fully functional Apps. You gotta have good searching skill in GitHub I agree, their search engine is really bad at matching good results. But give it a try.
v
@Pablichjenkov Yes, Jetpack compose
p
There are a lot of example projects there. I don't have one in my mind that I could recommend right now but I have seen plenty. Check it out
s
if there should be multiple ComponentActivity or just one
Do you mean Activities in general, or
ComponentActivity
in particular?
p
You can have one Activity per feature module if you don't want to mess up too much with navigation compose
But in theory one Activity is enough, in practicality you end up having a couple of them.
s
https://github.com/android/nowinandroid is always a safe bet for an app which showcases a bunch of the things you can do with compose. And if the question was about activities in general, I would really not recommend going with more than 1 activity, especially if it’s not an already existing app.
👆 1
☝🏻 1
v
Not activities in general, just
ComponentActivity
in particular. Ill check out that repo, @Stylianos Gakis
s
Alright, what do you mean then by “multiple ComponentActivity”?
v
androidx.activity.ComponentActivity
I was wondering if there had to be a separate activity for things like
Login
,
Shop
, etc where you have to call
setContent
in
onCreate
s
Alright, then it has nothing to do with
ComponentActivity
in particular (say, as opposed to
AppCompatActivity
or something like that), your question is generally about using more than one activity in the app or not. In which case my suggestion is this still https://kotlinlang.slack.com/archives/CJLTWPH7S/p1697832767648939?thread_ts=1697831895.067199&cid=CJLTWPH7S
👆 1
https://developer.android.com/guide/navigation Here is your entry-point regarding how to use androidx.navigation. It currently can be a bit confusing regarding if you want to use compose-only, or with fragments, where the docs are still mostly referencing the fragment approach (but not everywhere) so if you do get confused a bit along the way it would not necessarily be all your fault.
👍🏽 1