Closed ydhnwb closed 1 year ago
Simple-Stack out of the box has no dependency on AndroidX nor AppCompat at all, but Fragments and Material Components that you use, might. In that case, the theme you define should inherit from a parent theme that is requested by your views (both AppCompat alone, and Material-Components has its own themes that they expect to be used as a parent).
Yes. Since I use extends MainActivity with AppCompatActivity to get the "supportFragmentManager", I need to use AppCompat theme.
The default when creating Material3 Compose is extending MainActivity with ComponentActivity, but using it make me unable to get supportFragmentManager
Update: I found the solution
To use fragments, you might need either FragmentActivity or AppCompatActivity
FragmentActivity should also be a subclass of ComponentActivity
I'm learning to implement SimpleStack into Compose (material3) project. Navigation seems to be works perfectly and easy to understand, but the only problem is, when I use default theme that comes when creates Compose (material3) project, it force-close and shows me error like this:
Here is my manifest.xml
So, I tried to create a new theme on themes.xml like below just to make it work
then on manifest, I replaced the @styles/Theme.LearnJetpackNavTheme into @styles/AppTheme
It works, but is it okay? Is it affecting app theme like dynamic color (for android12+) or not? I just worried about that. I also wrap my app view like this:
Here is my repo (just in case) *all my code is based on this extension-compose-example