From 7f8fb77cb0ddbe406b90032d28c5867301fce218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B0=D1=88=D0=B8=D0=BD=20=D0=9C=D0=B0=D0=BA=D1=81?= =?UTF-8?q?=D0=B8=D0=BC?= Date: Thu, 26 Oct 2023 19:26:03 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A6=D0=B2=D0=B5=D1=82=D0=B0=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=B4=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../labwork/button_navigation/Screens.kt | 10 +++++++++- .../labwork/button_navigation/SlideGraph.kt | 3 +++ .../labwork/button_navigation/SlideItem.kt | 1 + .../button_navigation/SlideNavigation.kt | 20 +++++++++++++++---- .../com/example/labwork/ui/theme/Color.kt | 5 ++++- .../res/drawable/baseline_manage_search.xml | 5 +++++ local.properties | 8 +++----- 7 files changed, 41 insertions(+), 11 deletions(-) create mode 100644 app/src/main/res/drawable/baseline_manage_search.xml diff --git a/app/src/main/java/com/example/labwork/button_navigation/Screens.kt b/app/src/main/java/com/example/labwork/button_navigation/Screens.kt index bb4ffa5..1057c37 100644 --- a/app/src/main/java/com/example/labwork/button_navigation/Screens.kt +++ b/app/src/main/java/com/example/labwork/button_navigation/Screens.kt @@ -20,4 +20,12 @@ fun ScreenProfile() { modifier = Modifier.fillMaxSize().wrapContentHeight(), text = "Тут будет профиль экран..." ) -} \ No newline at end of file +} + +@Composable +fun ScreenListProduct() { + Text( + modifier = Modifier.fillMaxSize().wrapContentHeight(), + text = "Тут будет профиль продуктов..." + ) +} diff --git a/app/src/main/java/com/example/labwork/button_navigation/SlideGraph.kt b/app/src/main/java/com/example/labwork/button_navigation/SlideGraph.kt index e1a25a7..5588a19 100644 --- a/app/src/main/java/com/example/labwork/button_navigation/SlideGraph.kt +++ b/app/src/main/java/com/example/labwork/button_navigation/SlideGraph.kt @@ -18,5 +18,8 @@ fun SlideGraph( composable("Info"){ ScreenInfo() } + composable("ListProduct"){ + ScreenListProduct() + } } } \ No newline at end of file diff --git a/app/src/main/java/com/example/labwork/button_navigation/SlideItem.kt b/app/src/main/java/com/example/labwork/button_navigation/SlideItem.kt index b76ad34..e1158da 100644 --- a/app/src/main/java/com/example/labwork/button_navigation/SlideItem.kt +++ b/app/src/main/java/com/example/labwork/button_navigation/SlideItem.kt @@ -5,4 +5,5 @@ import com.example.labwork.R sealed class SlideItem(val title: String, val iconId: Int, val route: String){ object ScreenInfo: SlideItem("Информация", R.drawable.baseline_info,"Info" ) object ScreenProfile: SlideItem("Профиль", R.drawable.baseline_account_circle,"Profile" ) + object ScreenListProduct: SlideItem("Товары", R.drawable.baseline_manage_search,"ListProduct" ) } diff --git a/app/src/main/java/com/example/labwork/button_navigation/SlideNavigation.kt b/app/src/main/java/com/example/labwork/button_navigation/SlideNavigation.kt index 017ad5c..ed97093 100644 --- a/app/src/main/java/com/example/labwork/button_navigation/SlideNavigation.kt +++ b/app/src/main/java/com/example/labwork/button_navigation/SlideNavigation.kt @@ -1,5 +1,7 @@ package com.example.labwork.button_navigation +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.BottomNavigation import androidx.compose.material.BottomNavigationItem import androidx.compose.material.Icon @@ -7,11 +9,19 @@ import androidx.compose.material.SnackbarDefaults.backgroundColor import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.draw.shadow 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 androidx.compose.ui.unit.sp import androidx.navigation.NavController import androidx.navigation.compose.currentBackStackEntryAsState +import com.example.labwork.ui.theme.DarkBluePolitech +import com.example.labwork.ui.theme.LightBluePolitech + @Composable fun SlideNavigation( @@ -19,11 +29,13 @@ fun SlideNavigation( ) { val listItems = listOf( SlideItem.ScreenInfo, - SlideItem.ScreenProfile + SlideItem.ScreenProfile, + SlideItem.ScreenListProduct ) BottomNavigation( - backgroundColor = Color.White + backgroundColor = Color.White, + modifier = Modifier.padding(10.dp).shadow(2.dp) ) { val backStackEntry by navController.currentBackStackEntryAsState() val currentRout = backStackEntry?.destination?.route @@ -45,8 +57,8 @@ fun SlideNavigation( fontSize = 9.sp ) }, - selectedContentColor = Color.Blue, - unselectedContentColor = Color.Gray + selectedContentColor = LightBluePolitech, + unselectedContentColor = DarkBluePolitech ) } } diff --git a/app/src/main/java/com/example/labwork/ui/theme/Color.kt b/app/src/main/java/com/example/labwork/ui/theme/Color.kt index 59892bc..0933ad2 100644 --- a/app/src/main/java/com/example/labwork/ui/theme/Color.kt +++ b/app/src/main/java/com/example/labwork/ui/theme/Color.kt @@ -8,4 +8,7 @@ val Pink80 = Color(0xFFEFB8C8) val Purple40 = Color(0xFF6650a4) val PurpleGrey40 = Color(0xFF625b71) -val Pink40 = Color(0xFF7D5260) \ No newline at end of file +val Pink40 = Color(0xFF7D5260) + +val LightBluePolitech = Color(0xFF004890) +val DarkBluePolitech = Color(0xFF0D2D4F) \ No newline at end of file diff --git a/app/src/main/res/drawable/baseline_manage_search.xml b/app/src/main/res/drawable/baseline_manage_search.xml new file mode 100644 index 0000000..98b332c --- /dev/null +++ b/app/src/main/res/drawable/baseline_manage_search.xml @@ -0,0 +1,5 @@ + + + diff --git a/local.properties b/local.properties index 9dd70d4..0d18bc7 100644 --- a/local.properties +++ b/local.properties @@ -1,10 +1,8 @@ -## This file is automatically generated by Android Studio. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file should *NOT* be checked into Version Control Systems, +## This file must *NOT* be checked into Version Control Systems, # as it contains information specific to your local configuration. # # Location of the SDK. This is only used by Gradle. # For customization when using a Version Control System, please read the # header note. -sdk.dir=C\:\\Users\\Maxim\\AppData\\Local\\Android\\Sdk \ No newline at end of file +#Thu Oct 26 18:54:01 GMT+04:00 2023 +sdk.dir=C\:\\android-sdk