Add placeholders for stats and settings screens

Upcoming features sneak peek!!1!1!!
This commit is contained in:
Nishant Mishra
2025-07-03 15:51:14 +05:30
parent dcaabbfaf7
commit 9e3978f261
6 changed files with 125 additions and 3 deletions

View File

@@ -28,6 +28,12 @@ class MainActivity : ComponentActivity() {
R.drawable.hourglass_filled,
"Timer"
),
NavItem(
Screen.Stats,
R.drawable.monitoring,
R.drawable.monitoring_filled,
"Stats"
),
NavItem(
Screen.Settings,
R.drawable.settings,

View File

@@ -31,6 +31,8 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.withContext
import org.nsh07.pomodoro.MainActivity.Companion.screens
import org.nsh07.pomodoro.ui.settingsScreen.SettingsScreen
import org.nsh07.pomodoro.ui.statsScreen.StatsScreen
import org.nsh07.pomodoro.ui.timerScreen.TimerScreen
import org.nsh07.pomodoro.ui.viewModel.UiViewModel
@@ -64,7 +66,7 @@ fun AppScreen(
val selected = backStack.last() == it.route
ShortNavigationBarItem(
selected = selected,
onClick = if (it.route != Screen.Timer) {
onClick = if (it.route != Screen.Timer) { // Ensure the backstack does not accumulate screens
{
if (backStack.size < 2) backStack.add(it.route)
else backStack[1] = it.route
@@ -105,11 +107,11 @@ fun AppScreen(
}
entry<Screen.Settings> {
Text("Settings")
SettingsScreen()
}
entry<Screen.Stats> {
Text("Stats")
StatsScreen()
}
}
)

View File

@@ -0,0 +1,44 @@
package org.nsh07.pomodoro.ui.settingsScreen
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.LoadingIndicator
import androidx.compose.material3.LocalTextStyle
import androidx.compose.material3.MaterialTheme.typography
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.sp
import org.nsh07.pomodoro.ui.theme.AppFonts.robotoFlexTitle
@OptIn(ExperimentalMaterial3Api::class, ExperimentalMaterial3ExpressiveApi::class)
@Composable
fun SettingsScreen(modifier: Modifier = Modifier) {
Column(modifier) {
TopAppBar(
title = {
Text(
"Settings",
style = LocalTextStyle.current.copy(
fontFamily = robotoFlexTitle,
fontSize = 32.sp,
lineHeight = 32.sp
)
)
},
subtitle = {},
titleHorizontalAlignment = Alignment.CenterHorizontally
)
Box(contentAlignment = Alignment.Center, modifier = Modifier.fillMaxSize()) {
Column(horizontalAlignment = Alignment.CenterHorizontally) {
LoadingIndicator()
Text("Coming Soon", style = typography.headlineSmall, fontFamily = robotoFlexTitle)
}
}
}
}

View File

@@ -0,0 +1,44 @@
package org.nsh07.pomodoro.ui.statsScreen
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.material3.LoadingIndicator
import androidx.compose.material3.LocalTextStyle
import androidx.compose.material3.MaterialTheme.typography
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.sp
import org.nsh07.pomodoro.ui.theme.AppFonts.robotoFlexTitle
@OptIn(ExperimentalMaterial3Api::class, ExperimentalMaterial3ExpressiveApi::class)
@Composable
fun StatsScreen(modifier: Modifier = Modifier) {
Column(modifier) {
TopAppBar(
title = {
Text(
"Stats",
style = LocalTextStyle.current.copy(
fontFamily = robotoFlexTitle,
fontSize = 32.sp,
lineHeight = 32.sp
)
)
},
subtitle = {},
titleHorizontalAlignment = Alignment.CenterHorizontally
)
Box(contentAlignment = Alignment.Center, modifier = Modifier.fillMaxSize()) {
Column(horizontalAlignment = Alignment.CenterHorizontally) {
LoadingIndicator()
Text("Coming Soon", style = typography.headlineSmall, fontFamily = robotoFlexTitle)
}
}
}
}