38 lines
1.4 KiB
Kotlin
38 lines
1.4 KiB
Kotlin
package com.m57.hermescontrol
|
|
|
|
import android.os.Bundle
|
|
import androidx.activity.ComponentActivity
|
|
import androidx.activity.compose.setContent
|
|
import androidx.activity.enableEdgeToEdge
|
|
import androidx.compose.foundation.layout.fillMaxSize
|
|
import androidx.compose.material3.MaterialTheme
|
|
import androidx.compose.material3.Surface
|
|
import androidx.compose.runtime.collectAsState
|
|
import androidx.compose.runtime.getValue
|
|
import androidx.compose.ui.Modifier
|
|
import com.m57.hermescontrol.data.local.AuthManager
|
|
import com.m57.hermescontrol.notification.NotificationReplyReceiver
|
|
import com.m57.hermescontrol.theme.HermesControlTheme
|
|
|
|
class MainActivity : ComponentActivity() {
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
super.onCreate(savedInstanceState)
|
|
|
|
// Read notification tap sessionId (if any) from the intent that launched us
|
|
val notificationSessionId = intent?.getStringExtra(NotificationReplyReceiver.EXTRA_SESSION_ID)
|
|
|
|
enableEdgeToEdge()
|
|
setContent {
|
|
val themePreference by AuthManager.themePreferenceFlow.collectAsState()
|
|
HermesControlTheme(themePreference = themePreference) {
|
|
Surface(
|
|
modifier = Modifier.fillMaxSize(),
|
|
color = MaterialTheme.colorScheme.background,
|
|
) {
|
|
MainNavigation(sessionId = notificationSessionId)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|