Should we be using something other than `AppCompat...
# compose
g
Should we be using something other than
AppCompatActivity
? It's what's in the default when creating a new compose
j
you should be able to use
ComponentActivity
now....also, since beta2 I don't believe compose has appcompat dependency any more as well
g
Thanks John 👍
s
wait so it’s no longer:
Copy code
class MainActivity: AppCompatActivity() {
where is there an example of the new approach?
i
AppCompatActivity
extends
FragmentActivity
which extends
ComponentActivity
. If you don't need AppCompat (i.e. for styling Android Views) and you don't need Fragments (because you're in Compose), then you can use
ComponentActivity
, which has all of the hooks you need for a Compose only app
s
Thanks Ian, I swapped ComponentActivity in our pure Compose app and it seems to be working without a hitch!
i
Remove those dependencies (fragment and appcompat) and you might save half a megabyte in APK size 🙂
s
just removed appcompat 😻 although i didn’t see any reference to fragment
i
You were probably just getting it as a transitive dependency of AppCompat then, totally understandable
2
i
you should change the themes too if you dropped appcompat?