Compare commits
2 Commits
774f07c080
...
f78b2c43c3
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f78b2c43c3 | ||
![]() |
e534e95020 |
@ -1,3 +1,87 @@
|
|||||||
|
<<<<<<< HEAD
|
||||||
|
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(Modifier) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
=======
|
||||||
package com.f1rq.lifemap
|
package com.f1rq.lifemap
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
@ -80,3 +164,4 @@ class MainActivity : ComponentActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
>>>>>>> 774f07c0804f103a0523e1f7da3f969046a53aec
|
||||||
|
@ -1,3 +1,117 @@
|
|||||||
|
<<<<<<< HEAD
|
||||||
|
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.draw.drawBehind
|
||||||
|
import androidx.compose.ui.geometry.Offset
|
||||||
|
import androidx.compose.ui.geometry.Size
|
||||||
|
import androidx.compose.ui.graphics.Brush
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.res.painterResource
|
||||||
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
|
import androidx.compose.ui.unit.Dp
|
||||||
|
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
|
||||||
|
import com.google.relay.compose.BoxScopeInstanceImpl.align
|
||||||
|
|
||||||
|
@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()
|
||||||
|
=======
|
||||||
package com.f1rq.lifemap.components
|
package com.f1rq.lifemap.components
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
@ -104,4 +218,5 @@ fun NavBar(
|
|||||||
@Composable
|
@Composable
|
||||||
fun NavBarPreview() {
|
fun NavBarPreview() {
|
||||||
NavBar()
|
NavBar()
|
||||||
|
>>>>>>> 774f07c0804f103a0523e1f7da3f969046a53aec
|
||||||
}
|
}
|
@ -1,3 +1,82 @@
|
|||||||
|
<<<<<<< HEAD
|
||||||
|
package com.f1rq.lifemap.screens
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
|
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.automirrored.outlined.List
|
||||||
|
import androidx.compose.material.icons.filled.MailOutline
|
||||||
|
import androidx.compose.material.icons.filled.Notifications
|
||||||
|
import androidx.compose.material.icons.outlined.Email
|
||||||
|
import androidx.compose.material.icons.outlined.Notifications
|
||||||
|
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 androidx.navigation.NavController
|
||||||
|
import com.f1rq.lifemap.components.SettingsLabel
|
||||||
|
import com.f1rq.lifemap.ui.theme.MainTextColor
|
||||||
|
import com.f1rq.lifemap.R.drawable.contact_icon
|
||||||
|
import com.f1rq.lifemap.R.drawable.feedback_icon
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun SettingsScreen(navController: NavController, modifier: Modifier = Modifier) {
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxSize()
|
||||||
|
) {
|
||||||
|
Column (
|
||||||
|
verticalArrangement = Arrangement.spacedBy(4.dp),
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = "Settings",
|
||||||
|
style = MaterialTheme.typography.titleMedium,
|
||||||
|
fontSize = MaterialTheme.typography.titleLarge.fontSize,
|
||||||
|
fontFamily = MaterialTheme.typography.titleLarge.fontFamily,
|
||||||
|
color = MainTextColor,
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(
|
||||||
|
top = 24.dp,
|
||||||
|
start = 24.dp
|
||||||
|
),
|
||||||
|
)
|
||||||
|
SettingsLabel(
|
||||||
|
text = "Notifications",
|
||||||
|
iconResource = Icons.Outlined.Notifications,
|
||||||
|
desc = "Notifications",
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(
|
||||||
|
horizontal = 16.dp
|
||||||
|
),
|
||||||
|
onClick = { navController.navigate("settings_notifications") }
|
||||||
|
)
|
||||||
|
|
||||||
|
SettingsLabel(
|
||||||
|
text = "Contact",
|
||||||
|
iconResource = Icons.Outlined.Email,
|
||||||
|
desc = "Contact us",
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(
|
||||||
|
horizontal = 16.dp
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
SettingsLabel(
|
||||||
|
text = "Report a bug",
|
||||||
|
iconResource = Icons.Outlined.Email,
|
||||||
|
desc = "Report a bug",
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(
|
||||||
|
horizontal = 16.dp
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
=======
|
||||||
package com.f1rq.lifemap.screens
|
package com.f1rq.lifemap.screens
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
@ -43,4 +122,5 @@ fun SettingsScreen(navController: NavController, modifier: Modifier = Modifier)
|
|||||||
desc = "Report a bug"
|
desc = "Report a bug"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
>>>>>>> 774f07c0804f103a0523e1f7da3f969046a53aec
|
||||||
}
|
}
|
@ -1,3 +1,24 @@
|
|||||||
|
<<<<<<< HEAD
|
||||||
|
package com.f1rq.lifemap.screens.settingsScreens
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
|
import androidx.compose.material3.Text
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun SettingsNotificationsScreen(modifier: Modifier = Modifier) {
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxSize(),
|
||||||
|
contentAlignment = Alignment.Center
|
||||||
|
) {
|
||||||
|
Text("Notifications settings")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
=======
|
||||||
package com.f1rq.lifemap.screens.settingsScreens
|
package com.f1rq.lifemap.screens.settingsScreens
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
@ -48,3 +69,4 @@ fun SettingsNotificationsScreen(navController: NavController, modifier: Modifier
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
>>>>>>> 774f07c0804f103a0523e1f7da3f969046a53aec
|
||||||
|
5
app/src/main/res/drawable/contact_icon.xml
Normal file
5
app/src/main/res/drawable/contact_icon.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
|
||||||
|
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M20,4L4,4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2zM20,18L4,18L4,8l8,5 8,-5v10zM12,11L4,6h16l-8,5z"/>
|
||||||
|
|
||||||
|
</vector>
|
5
app/src/main/res/drawable/feedback_icon.xml
Normal file
5
app/src/main/res/drawable/feedback_icon.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
|
||||||
|
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M20,2L4,2c-1.1,0 -1.99,0.9 -1.99,2L2,22l4,-4h14c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM13,14h-2v-2h2v2zM13,10h-2L11,6h2v4z"/>
|
||||||
|
|
||||||
|
</vector>
|
Loading…
x
Reference in New Issue
Block a user