Updates
This commit is contained in:
commit
f78b2c43c3
@ -1,3 +1,4 @@
|
|||||||
|
<<<<<<< HEAD
|
||||||
package com.f1rq.lifemap
|
package com.f1rq.lifemap
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
@ -80,3 +81,87 @@ class MainActivity : ComponentActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
package com.f1rq.lifemap
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import androidx.activity.ComponentActivity
|
||||||
|
import androidx.activity.compose.setContent
|
||||||
|
import androidx.activity.enableEdgeToEdge
|
||||||
|
import androidx.compose.foundation.isSystemInDarkTheme
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.material3.Scaffold
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.core.view.WindowCompat
|
||||||
|
import androidx.navigation.compose.NavHost
|
||||||
|
import androidx.navigation.compose.composable
|
||||||
|
import androidx.navigation.compose.currentBackStackEntryAsState
|
||||||
|
import androidx.navigation.compose.rememberNavController
|
||||||
|
import androidx.compose.runtime.SideEffect
|
||||||
|
import androidx.compose.ui.platform.LocalView
|
||||||
|
import com.f1rq.lifemap.screens.ListView
|
||||||
|
import com.f1rq.lifemap.screens.MapView
|
||||||
|
import com.f1rq.lifemap.screens.SettingsScreen
|
||||||
|
import com.f1rq.lifemap.screens.NotificationsScreen
|
||||||
|
import com.f1rq.lifemap.ui.theme.LifeMapTheme
|
||||||
|
import com.f1rq.lifemap.ui.theme.ActiveNavColor
|
||||||
|
import com.f1rq.lifemap.ui.theme.InactiveNavColor
|
||||||
|
import com.f1rq.lifemap.components.TopBar
|
||||||
|
import com.f1rq.lifemap.components.NavBar
|
||||||
|
import com.f1rq.lifemap.screens.settingsScreens.SettingsNotificationsScreen
|
||||||
|
|
||||||
|
class MainActivity : ComponentActivity() {
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
enableEdgeToEdge()
|
||||||
|
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||||
|
|
||||||
|
setContent {
|
||||||
|
LifeMapTheme {
|
||||||
|
val navController = rememberNavController()
|
||||||
|
|
||||||
|
val view = LocalView.current
|
||||||
|
val darkTheme = !isSystemInDarkTheme()
|
||||||
|
SideEffect {
|
||||||
|
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||||
|
val insetsController = WindowCompat.getInsetsController(window, view)
|
||||||
|
insetsController.isAppearanceLightStatusBars = true
|
||||||
|
insetsController.isAppearanceLightNavigationBars = true
|
||||||
|
}
|
||||||
|
|
||||||
|
Scaffold(
|
||||||
|
topBar = {
|
||||||
|
TopBar(
|
||||||
|
onSettingsButtonClick = { navController.navigate("settings")},
|
||||||
|
onNotificationsButtonClick = { navController.navigate("notifications")}
|
||||||
|
)
|
||||||
|
},
|
||||||
|
bottomBar = {
|
||||||
|
val navBackStackEntry = navController.currentBackStackEntryAsState()
|
||||||
|
val currentRoute = navBackStackEntry.value?.destination?.route
|
||||||
|
|
||||||
|
NavBar(
|
||||||
|
onMapViewClicked = { navController.navigate("mapview") },
|
||||||
|
onListViewClicked = { navController.navigate("listview") },
|
||||||
|
mapViewBackgroundColor = if (currentRoute == "mapview") ActiveNavColor else InactiveNavColor,
|
||||||
|
listViewBackgroundColor = if (currentRoute == "listview") ActiveNavColor else InactiveNavColor
|
||||||
|
)
|
||||||
|
}
|
||||||
|
) { innerPadding ->
|
||||||
|
NavHost(
|
||||||
|
navController = navController,
|
||||||
|
startDestination = "mapview",
|
||||||
|
modifier = Modifier.padding(innerPadding)
|
||||||
|
) {
|
||||||
|
composable("mapview") { MapView(Modifier) }
|
||||||
|
composable("listview") { ListView(Modifier) }
|
||||||
|
composable("settings") { SettingsScreen(navController = navController, Modifier)}
|
||||||
|
composable("notifications") { NotificationsScreen(Modifier)}
|
||||||
|
composable("settings_notifications") { SettingsNotificationsScreen(navController = navController, Modifier) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
>>>>>>> 774f07c0804f103a0523e1f7da3f969046a53aec
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
<<<<<<< HEAD
|
||||||
package com.f1rq.lifemap.components
|
package com.f1rq.lifemap.components
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
@ -110,4 +111,112 @@ fun NavBar(
|
|||||||
@Composable
|
@Composable
|
||||||
fun NavBarPreview() {
|
fun NavBarPreview() {
|
||||||
NavBar()
|
NavBar()
|
||||||
|
=======
|
||||||
|
package com.f1rq.lifemap.components
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.*
|
||||||
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
|
import androidx.compose.material3.Icon
|
||||||
|
import androidx.compose.material3.IconButton
|
||||||
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.material3.Card
|
||||||
|
import androidx.compose.material3.CardDefaults
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.res.painterResource
|
||||||
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
|
import com.f1rq.lifemap.ui.theme.MainBG
|
||||||
|
import com.f1rq.lifemap.ui.theme.InactiveNavColor
|
||||||
|
import com.f1rq.lifemap.ui.theme.ActiveNavColor
|
||||||
|
import com.f1rq.lifemap.ui.theme.PrimaryColor
|
||||||
|
import com.f1rq.lifemap.R.drawable.navbar_listview_button
|
||||||
|
import com.f1rq.lifemap.R.drawable.navbar_mapview_button
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun NavBar(
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
|
onMapViewClicked: () -> Unit = {},
|
||||||
|
onListViewClicked: () -> Unit = {},
|
||||||
|
mapViewBackgroundColor: Color = ActiveNavColor,
|
||||||
|
listViewBackgroundColor: Color = InactiveNavColor,
|
||||||
|
) {
|
||||||
|
Box(
|
||||||
|
modifier = modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
) {
|
||||||
|
|
||||||
|
Card(
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
colors = CardDefaults.cardColors(containerColor = MainBG),
|
||||||
|
elevation = CardDefaults.cardElevation(defaultElevation = 6.dp),
|
||||||
|
) {
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(
|
||||||
|
top = 12.dp,
|
||||||
|
bottom = WindowInsets.navigationBars.asPaddingValues().calculateBottomPadding() + 6.dp,
|
||||||
|
),
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.weight(1f),
|
||||||
|
contentAlignment = Alignment.Center
|
||||||
|
) {
|
||||||
|
IconButton(
|
||||||
|
onClick = onMapViewClicked,
|
||||||
|
modifier = Modifier
|
||||||
|
.size(48.dp)
|
||||||
|
.background(
|
||||||
|
color = mapViewBackgroundColor,
|
||||||
|
shape = RoundedCornerShape(16.dp)
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
painter = painterResource(id = navbar_mapview_button),
|
||||||
|
contentDescription = "Map View",
|
||||||
|
modifier = Modifier.requiredSize(24.dp),
|
||||||
|
tint = PrimaryColor
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.weight(1f),
|
||||||
|
contentAlignment = Alignment.Center
|
||||||
|
) {
|
||||||
|
IconButton(
|
||||||
|
onClick = onListViewClicked,
|
||||||
|
modifier = Modifier
|
||||||
|
.size(48.dp)
|
||||||
|
.background(
|
||||||
|
color = listViewBackgroundColor,
|
||||||
|
shape = RoundedCornerShape(16.dp)
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
painter = painterResource(id = navbar_listview_button),
|
||||||
|
contentDescription = "List View",
|
||||||
|
modifier = Modifier.requiredSize(24.dp),
|
||||||
|
tint = PrimaryColor
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Preview
|
||||||
|
@Composable
|
||||||
|
fun NavBarPreview() {
|
||||||
|
NavBar()
|
||||||
|
>>>>>>> 774f07c0804f103a0523e1f7da3f969046a53aec
|
||||||
}
|
}
|
22
app/src/main/java/com/f1rq/lifemap/components/ScreenTitle.kt
Normal file
22
app/src/main/java/com/f1rq/lifemap/components/ScreenTitle.kt
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package com.f1rq.lifemap.components
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.material3.Text
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import com.f1rq.lifemap.ui.theme.MainTextColor
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun ScreenTitle(
|
||||||
|
title: String,
|
||||||
|
modifier: Modifier = Modifier
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = title,
|
||||||
|
style = MaterialTheme.typography.titleLarge.copy(color = MainTextColor),
|
||||||
|
modifier = modifier
|
||||||
|
.padding(vertical = 8.dp)
|
||||||
|
)
|
||||||
|
}
|
@ -1,3 +1,4 @@
|
|||||||
|
<<<<<<< HEAD
|
||||||
package com.f1rq.lifemap.screens
|
package com.f1rq.lifemap.screens
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
@ -75,4 +76,51 @@ fun SettingsScreen(navController: NavController, modifier: Modifier = Modifier)
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
package com.f1rq.lifemap.screens
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
|
import androidx.compose.foundation.layout.Column
|
||||||
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.outlined.Email
|
||||||
|
import androidx.compose.material.icons.outlined.Notifications
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.navigation.NavController
|
||||||
|
import com.f1rq.lifemap.components.SettingsLabel
|
||||||
|
import com.f1rq.lifemap.components.ScreenTitle
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun SettingsScreen(navController: NavController, modifier: Modifier = Modifier) {
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxSize()
|
||||||
|
.padding(horizontal = 16.dp, vertical = 16.dp),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(16.dp),
|
||||||
|
) {
|
||||||
|
ScreenTitle("Settings")
|
||||||
|
|
||||||
|
SettingsLabel(
|
||||||
|
text = "Notifications",
|
||||||
|
iconResource = Icons.Outlined.Notifications,
|
||||||
|
desc = "Notifications",
|
||||||
|
onClick = { navController.navigate("settings_notifications") }
|
||||||
|
)
|
||||||
|
|
||||||
|
SettingsLabel(
|
||||||
|
text = "Contact",
|
||||||
|
iconResource = Icons.Outlined.Email,
|
||||||
|
desc = "Contact us"
|
||||||
|
)
|
||||||
|
|
||||||
|
SettingsLabel(
|
||||||
|
text = "Report a bug",
|
||||||
|
iconResource = Icons.Outlined.Email,
|
||||||
|
desc = "Report a bug"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
>>>>>>> 774f07c0804f103a0523e1f7da3f969046a53aec
|
||||||
}
|
}
|
@ -1,3 +1,4 @@
|
|||||||
|
<<<<<<< HEAD
|
||||||
package com.f1rq.lifemap.screens.settingsScreens
|
package com.f1rq.lifemap.screens.settingsScreens
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
@ -17,3 +18,55 @@ fun SettingsNotificationsScreen(modifier: Modifier = Modifier) {
|
|||||||
Text("Notifications settings")
|
Text("Notifications settings")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
package com.f1rq.lifemap.screens.settingsScreens
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
|
import androidx.compose.foundation.layout.Column
|
||||||
|
import androidx.compose.foundation.layout.Row
|
||||||
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.layout.size
|
||||||
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.automirrored.outlined.KeyboardArrowLeft
|
||||||
|
import androidx.compose.material3.Icon
|
||||||
|
import androidx.compose.material3.IconButton
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.navigation.NavController
|
||||||
|
import com.f1rq.lifemap.ui.theme.PrimaryColor
|
||||||
|
import com.f1rq.lifemap.components.ScreenTitle
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun SettingsNotificationsScreen(navController: NavController, modifier: Modifier = Modifier) {
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxSize()
|
||||||
|
.padding(horizontal = 16.dp, vertical = 16.dp)
|
||||||
|
) {
|
||||||
|
Row(
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
|
) {
|
||||||
|
IconButton(
|
||||||
|
onClick = { navController.navigate("settings") },
|
||||||
|
modifier = Modifier.size(40.dp)
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.AutoMirrored.Outlined.KeyboardArrowLeft,
|
||||||
|
contentDescription = "Back",
|
||||||
|
tint = PrimaryColor,
|
||||||
|
modifier = Modifier.size(24.dp)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
ScreenTitle(
|
||||||
|
title = "Notifications",
|
||||||
|
modifier = Modifier.padding(start = 0.dp)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
>>>>>>> 774f07c0804f103a0523e1f7da3f969046a53aec
|
||||||
|
Loading…
x
Reference in New Issue
Block a user