From 4cb7b2d6d133132725c6b5e16ced8135b9527bf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B8=D1=80=D0=B8=D0=BB=D0=BB?= Date: Fri, 19 Dec 2025 11:39:53 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20=D1=8D?= =?UTF-8?q?=D0=BA=D1=80=D0=B0=D0=BD=20=D1=80=D0=B5=D0=B3=D0=B8=D1=81=D1=82?= =?UTF-8?q?=D1=80=D0=B0=D1=86=D0=B8=D0=B8=20=D0=B8=20=D0=B7=D0=B0=D0=B1?= =?UTF-8?q?=D1=8B=D0=BB=D0=B8=20=D0=BF=D0=B0=D1=80=D0=BE=D0=BB=D1=8C=20(?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B0=20=D0=BF=D0=BE?= =?UTF-8?q?=D1=87=D1=82=D1=8B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/deploymentTargetDropDown.xml | 15 ++++++++++++++- .idea/gradle.xml | 2 +- .../java/com/novayaplaneta/MainActivity.kt | 19 ++++++++++++++++--- .../ui/navigation/NewPlanetNavigation.kt | 8 ++++++++ .../ui/screens/auth/LoginScreen.kt | 4 ++-- 5 files changed, 41 insertions(+), 7 deletions(-) diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml index 0c0c338..bb21b7a 100644 --- a/.idea/deploymentTargetDropDown.xml +++ b/.idea/deploymentTargetDropDown.xml @@ -3,7 +3,20 @@ - + + + + + + + + + + + + + + diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 639c779..0897082 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -4,7 +4,6 @@ diff --git a/app/src/main/java/com/novayaplaneta/MainActivity.kt b/app/src/main/java/com/novayaplaneta/MainActivity.kt index 9581495..ea29ae5 100644 --- a/app/src/main/java/com/novayaplaneta/MainActivity.kt +++ b/app/src/main/java/com/novayaplaneta/MainActivity.kt @@ -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 + ) ) } } diff --git a/app/src/main/java/com/novayaplaneta/ui/navigation/NewPlanetNavigation.kt b/app/src/main/java/com/novayaplaneta/ui/navigation/NewPlanetNavigation.kt index b381408..b950128 100644 --- a/app/src/main/java/com/novayaplaneta/ui/navigation/NewPlanetNavigation.kt +++ b/app/src/main/java/com/novayaplaneta/ui/navigation/NewPlanetNavigation.kt @@ -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() } diff --git a/app/src/main/java/com/novayaplaneta/ui/screens/auth/LoginScreen.kt b/app/src/main/java/com/novayaplaneta/ui/screens/auth/LoginScreen.kt index 46e09e5..e1234a6 100644 --- a/app/src/main/java/com/novayaplaneta/ui/screens/auth/LoginScreen.kt +++ b/app/src/main/java/com/novayaplaneta/ui/screens/auth/LoginScreen.kt @@ -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") } ) }