Introduce EdgeToEdgeActivity

This commit is contained in:
Reinout Meliesie 2024-11-22 22:29:30 +01:00
parent 46aebc779e
commit 4ca76ac593
Signed by: zedfrigg
GPG key ID: 3AFCC06481308BC6
2 changed files with 12 additions and 3 deletions

View file

@ -1,7 +1,6 @@
package com.kernelmaft.zanbur
import android.os.*
import androidx.activity.*
import androidx.activity.compose.*
import androidx.compose.foundation.layout.*
import androidx.compose.runtime.*
@ -15,7 +14,7 @@ import kotlinx.coroutines.flow.*
class MainActivity : ComponentActivity () {
class MainActivity : EdgeToEdgeActivity () {
override fun onCreate ( savedInstanceState : Bundle ? ) {
super . onCreate (savedInstanceState)
@ -37,7 +36,6 @@ class MainActivity : ComponentActivity () {
}
}
enableEdgeToEdge ()
setContent {
AppFrame {
Column ( Modifier . width ( 300 . dp ) ) {

View file

@ -1,5 +1,7 @@
package com.kernelmaft.zanbur
import android.os.*
import androidx.activity.*
import androidx.compose.foundation.*
import androidx.compose.material3.*
import androidx.compose.material3.MaterialTheme.shapes
@ -22,3 +24,12 @@ val compactSpacing = 16 . dp
MaterialTheme ( colorScheme, shapes , typography , content )
}
open class EdgeToEdgeActivity : ComponentActivity () {
override fun onCreate ( savedInstanceState : Bundle ? ) {
super . onCreate (savedInstanceState)
enableEdgeToEdge ()
actionBar ?. hide ()
}
}