70 lines
No EOL
2 KiB
Kotlin
70 lines
No EOL
2 KiB
Kotlin
package eu.toldi.balazs.anotherfeedreader
|
|
|
|
import android.os.Bundle
|
|
import androidx.activity.ComponentActivity
|
|
import androidx.activity.compose.setContent
|
|
import androidx.compose.foundation.layout.Row
|
|
import androidx.compose.material.*
|
|
import androidx.compose.material.icons.Icons
|
|
import androidx.compose.material.icons.filled.Menu
|
|
import androidx.compose.material.icons.filled.Search
|
|
import androidx.compose.material.icons.filled.Settings
|
|
import androidx.compose.runtime.Composable
|
|
import androidx.compose.ui.tooling.preview.Preview
|
|
import eu.toldi.balazs.anotherfeedreader.ui.theme.AnotherFeedReaderTheme
|
|
import androidx.compose.material.Icon as Icon
|
|
|
|
class MainActivity : ComponentActivity() {
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
super.onCreate(savedInstanceState)
|
|
setContent {
|
|
AnotherFeedReaderTheme {
|
|
// A surface container using the 'background' color from the theme
|
|
Surface(color = MaterialTheme.colors.background) {
|
|
MenuBar()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Composable
|
|
fun MenuBar() {
|
|
TopAppBar(
|
|
title = {
|
|
Text("Feed reader")
|
|
},
|
|
navigationIcon = {
|
|
IconButton(onClick = { }) {
|
|
Icon(
|
|
Icons.Filled.Menu,
|
|
contentDescription = "Menu Hamburger"
|
|
)
|
|
}
|
|
},
|
|
actions = {
|
|
Row {
|
|
IconButton(onClick = {}) {
|
|
Icon(
|
|
Icons.Filled.Search,
|
|
contentDescription = "Search Article"
|
|
)
|
|
}
|
|
IconButton(onClick = {}) {
|
|
Icon(
|
|
Icons.Filled.Settings,
|
|
contentDescription = "Settings"
|
|
)
|
|
}
|
|
}
|
|
}
|
|
)
|
|
}
|
|
|
|
@Preview(showBackground = true)
|
|
@Composable
|
|
fun DefaultPreview() {
|
|
AnotherFeedReaderTheme {
|
|
MenuBar()
|
|
}
|
|
} |