Introduce EdgeToEdgeActivity
This commit is contained in:
parent
46aebc779e
commit
4ca76ac593
2 changed files with 12 additions and 3 deletions
|
@ -1,7 +1,6 @@
|
||||||
package com.kernelmaft.zanbur
|
package com.kernelmaft.zanbur
|
||||||
|
|
||||||
import android.os.*
|
import android.os.*
|
||||||
import androidx.activity.*
|
|
||||||
import androidx.activity.compose.*
|
import androidx.activity.compose.*
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.runtime.*
|
import androidx.compose.runtime.*
|
||||||
|
@ -15,7 +14,7 @@ import kotlinx.coroutines.flow.*
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MainActivity : ComponentActivity () {
|
class MainActivity : EdgeToEdgeActivity () {
|
||||||
override fun onCreate ( savedInstanceState : Bundle ? ) {
|
override fun onCreate ( savedInstanceState : Bundle ? ) {
|
||||||
super . onCreate (savedInstanceState)
|
super . onCreate (savedInstanceState)
|
||||||
|
|
||||||
|
@ -37,7 +36,6 @@ class MainActivity : ComponentActivity () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enableEdgeToEdge ()
|
|
||||||
setContent {
|
setContent {
|
||||||
AppFrame {
|
AppFrame {
|
||||||
Column ( Modifier . width ( 300 . dp ) ) {
|
Column ( Modifier . width ( 300 . dp ) ) {
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package com.kernelmaft.zanbur
|
package com.kernelmaft.zanbur
|
||||||
|
|
||||||
|
import android.os.*
|
||||||
|
import androidx.activity.*
|
||||||
import androidx.compose.foundation.*
|
import androidx.compose.foundation.*
|
||||||
import androidx.compose.material3.*
|
import androidx.compose.material3.*
|
||||||
import androidx.compose.material3.MaterialTheme.shapes
|
import androidx.compose.material3.MaterialTheme.shapes
|
||||||
|
@ -22,3 +24,12 @@ val compactSpacing = 16 . dp
|
||||||
|
|
||||||
MaterialTheme ( colorScheme, shapes , typography , content )
|
MaterialTheme ( colorScheme, shapes , typography , content )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open class EdgeToEdgeActivity : ComponentActivity () {
|
||||||
|
override fun onCreate ( savedInstanceState : Bundle ? ) {
|
||||||
|
super . onCreate (savedInstanceState)
|
||||||
|
|
||||||
|
enableEdgeToEdge ()
|
||||||
|
actionBar ?. hide ()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue