70 lines
2.1 KiB
Kotlin
70 lines
2.1 KiB
Kotlin
// [PACKAGE] com.homebox.lens
|
|
// [FILE] MainActivity.kt
|
|
// [SEMANTICS] ui, activity, entrypoint
|
|
package com.homebox.lens
|
|
|
|
// [IMPORTS]
|
|
import android.os.Bundle
|
|
import androidx.activity.ComponentActivity
|
|
import androidx.activity.compose.setContent
|
|
import androidx.compose.foundation.layout.fillMaxSize
|
|
import androidx.compose.material3.MaterialTheme
|
|
import androidx.compose.material3.Surface
|
|
import androidx.compose.material3.Text
|
|
import androidx.compose.runtime.Composable
|
|
import androidx.compose.ui.Modifier
|
|
import androidx.compose.ui.tooling.preview.Preview
|
|
import com.homebox.lens.navigation.NavGraph
|
|
import com.homebox.lens.ui.theme.HomeboxLensTheme
|
|
import dagger.hilt.android.AndroidEntryPoint
|
|
import timber.log.Timber
|
|
// [END_IMPORTS]
|
|
|
|
// [ENTITY: Activity('MainActivity')]
|
|
/**
|
|
* @summary Главная и единственная Activity в приложении.
|
|
*/
|
|
@AndroidEntryPoint
|
|
class MainActivity : ComponentActivity() {
|
|
// [ENTITY: Function('onCreate')]
|
|
// [RELATION: Function('onCreate')] -> [CALLS] -> [Function('HomeboxLensTheme')]
|
|
// [RELATION: Function('onCreate')] -> [CALLS] -> [Function('NavGraph')]
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
super.onCreate(savedInstanceState)
|
|
Timber.d("[DEBUG][LIFECYCLE][creating_activity] MainActivity created.")
|
|
setContent {
|
|
HomeboxLensTheme {
|
|
Surface(
|
|
modifier = Modifier.fillMaxSize(),
|
|
color = MaterialTheme.colorScheme.background
|
|
) {
|
|
NavGraph()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// [END_ENTITY: Function('onCreate')]
|
|
}
|
|
// [END_ENTITY: Activity('MainActivity')]
|
|
|
|
// [ENTITY: Function('Greeting')]
|
|
@Composable
|
|
fun Greeting(name: String, modifier: Modifier = Modifier) {
|
|
Text(
|
|
text = "Hello $name!",
|
|
modifier = modifier
|
|
)
|
|
}
|
|
// [END_ENTITY: Function('Greeting')]
|
|
|
|
// [ENTITY: Function('GreetingPreview')]
|
|
@Preview(showBackground = true)
|
|
@Composable
|
|
fun GreetingPreview() {
|
|
HomeboxLensTheme {
|
|
Greeting("Android")
|
|
}
|
|
}
|
|
// [END_ENTITY: Function('GreetingPreview')]
|
|
|
|
// [END_FILE_MainActivity.kt] |