Сделал экран регистрации и забыли пароль (проверка почты)
This commit is contained in:
@@ -7,7 +7,10 @@ import androidx.activity.enableEdgeToEdge
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.navigation.compose.currentBackStackEntryAsState
|
||||
import androidx.navigation.compose.rememberNavController
|
||||
import com.novayaplaneta.ui.components.BottomNavigationBar
|
||||
import com.novayaplaneta.ui.navigation.NewPlanetNavigation
|
||||
@@ -22,12 +25,19 @@ class MainActivity : ComponentActivity() {
|
||||
setContent {
|
||||
NewPlanetTheme {
|
||||
val navController = rememberNavController()
|
||||
val currentRoute = navController.currentDestination?.route
|
||||
val navBackStackEntry by navController.currentBackStackEntryAsState()
|
||||
val currentRoute = navBackStackEntry?.destination?.route
|
||||
|
||||
// Нижняя панель не показывается на экранах входа, регистрации и восстановления пароля
|
||||
val showBottomBar = currentRoute != null &&
|
||||
currentRoute != "login" &&
|
||||
currentRoute != "registration" &&
|
||||
currentRoute != "forgot_password"
|
||||
|
||||
Scaffold(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
bottomBar = {
|
||||
if (currentRoute != "login") {
|
||||
if (showBottomBar) {
|
||||
BottomNavigationBar(
|
||||
currentRoute = currentRoute,
|
||||
onNavigate = { route ->
|
||||
@@ -47,7 +57,10 @@ class MainActivity : ComponentActivity() {
|
||||
navController = navController,
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(innerPadding)
|
||||
.padding(
|
||||
// Убираем нижний отступ на экране входа
|
||||
bottom = if (showBottomBar) innerPadding.calculateBottomPadding() else 0.dp
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,9 @@ import androidx.navigation.NavHostController
|
||||
import androidx.navigation.compose.NavHost
|
||||
import androidx.navigation.compose.composable
|
||||
import com.novayaplaneta.ui.screens.ai.AIScreen
|
||||
import com.novayaplaneta.ui.screens.auth.ForgotPasswordScreen
|
||||
import com.novayaplaneta.ui.screens.auth.LoginScreen
|
||||
import com.novayaplaneta.ui.screens.auth.RegistrationScreen
|
||||
import com.novayaplaneta.ui.screens.rewards.RewardsScreen
|
||||
import com.novayaplaneta.ui.screens.schedule.ScheduleScreen
|
||||
import com.novayaplaneta.ui.screens.settings.SettingsScreen
|
||||
@@ -27,6 +29,12 @@ fun NewPlanetNavigation(
|
||||
composable("login") {
|
||||
LoginScreen(navController = navController)
|
||||
}
|
||||
composable("registration") {
|
||||
RegistrationScreen(navController = navController)
|
||||
}
|
||||
composable("forgot_password") {
|
||||
ForgotPasswordScreen(navController = navController)
|
||||
}
|
||||
composable("schedule") {
|
||||
ScheduleScreen()
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ fun LoginScreen(
|
||||
color = LoginGreenAccent,
|
||||
fontWeight = FontWeight.Medium,
|
||||
modifier = Modifier.clickable {
|
||||
// TODO: Переход на регистрацию
|
||||
navController.navigate("registration")
|
||||
}
|
||||
)
|
||||
|
||||
@@ -275,7 +275,7 @@ fun LoginScreen(
|
||||
color = LoginGreenAccent,
|
||||
fontWeight = FontWeight.Medium,
|
||||
modifier = Modifier.clickable {
|
||||
// TODO: Переход на восстановление пароля
|
||||
navController.navigate("forgot_password")
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user