Browse Source

feat: Добавлена странциа каталога с растениями

http://gogs.ngknn.local:3000/K1rakato/MobileStore.git 1 week ago
parent
commit
887f0a25b5

+ 139 - 2
ProjectApp/TomatoAndPotatoAPP/app/src/main/java/com/example/tomatoandpotatoapp/Screens/PLantsCatalogScreen.kt

@@ -1,14 +1,151 @@
 package com.example.tomatoandpotatoapp.Screens
 
+import androidx.compose.foundation.background
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.fillMaxHeight
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.height
+import androidx.compose.foundation.layout.size
+import androidx.compose.foundation.layout.width
+import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.material3.Button
+import androidx.compose.material3.ButtonDefaults
+import androidx.compose.material3.Icon
+import androidx.compose.material3.IconButton
+import androidx.compose.material3.Text
+import androidx.compose.material3.TextField
+import androidx.compose.material3.contentColorFor
 import androidx.compose.runtime.Composable
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Brush
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.ImageBitmap
+import androidx.compose.ui.res.imageResource
+import androidx.compose.ui.text.font.FontWeight
+import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
 import androidx.navigation.NavController
 import com.example.tomatoandpotatoapp.ViewModelsPack.SupabaseAuthViewModel
 import androidx.lifecycle.viewmodel.compose.viewModel
+import com.example.tomatoandpotatoapp.R
+import com.example.tomatoandpotatoapp.utils.EditProfileString
+import io.github.jan.supabase.realtime.Column
+import io.ktor.http.ContentType
+import org.w3c.dom.Text
+
+@Preview
 
 @Composable
 fun ShowPlants(
-    viewModel: SupabaseAuthViewModel = viewModel(),
-    navController: NavController,
+    //viewModel: SupabaseAuthViewModel = viewModel(),
+    // navController: NavController,
 ) {
+    Box(modifier = Modifier.fillMaxSize()) {
+        Box(
+            modifier = Modifier
+                .fillMaxSize()
+                .background(
+                    brush = Brush.verticalGradient(
+                        colors = listOf(
+                            Color(0xFF666666).copy(alpha = 0.85f),
+                            Color(0xFF666666).copy(alpha = 0.1f)
+                        ),
+                        startY = 0.0f,
+                        endY = 1500.0f
+                    )
+                )
+        )
+        Column(modifier = Modifier.fillMaxSize()) {
+            Row(
+                modifier = Modifier
+                    .fillMaxWidth()
+                    .height(75.dp)
+                    .background(color = Color(0xffD9D9D9)),
+                horizontalArrangement = Arrangement.Center,
+                verticalAlignment = Alignment.CenterVertically
+            ) {
+                Column(modifier = Modifier
+                    .fillMaxHeight()){
+                    Text(
+                        text = "Каталог",
+                        fontWeight = FontWeight.W800,
+                        color = Color.Black,
+                        fontSize = 25.sp
+                    )
+
+                    TextField(
+                        modifier = Modifier.width(320.dp),
+                        shape = RoundedCornerShape(20.dp),
+                        maxLines = 1,
+                        singleLine = true,
+                        placeholder = {
+                            Text(
+                                text = "Поиск", fontWeight = FontWeight.W800,
+                                color = Color.Black,
+                                fontSize = 25.sp
+                            )
+                        },
+                        value = Unit,
+                        onValueChange = {  }
+                    )
+                }
+            }
+
+            Spacer(modifier = Modifier.height(60.dp))
+
+
+            Spacer(modifier = Modifier.weight(0.2f))
+
+            Row(
+                modifier = Modifier
+                    .fillMaxWidth()
+                    .height(80.dp)
+                    .align(Alignment.End)
+                    .background(color = Color(0xff718588)),
+                horizontalArrangement = Arrangement.SpaceEvenly
+            ) {
+                IconButton(
+                    onClick = { /*TODO*/ },
+                    modifier = Modifier.size(120.dp)
+                ) {
+                    Icon(
+                        bitmap = ImageBitmap.imageResource(R.drawable.message),
+                        contentDescription = "",
+                        modifier = Modifier.size(55.dp)
+                    )
+                }
+                IconButton(
+                    onClick = { /*TODO*/ },
+                    modifier = Modifier.size(120.dp)
+                ) {
+                    Icon(
+                        bitmap = ImageBitmap.imageResource(R.drawable.catalogblack),
+                        contentDescription = "",
+                        modifier = Modifier.size(55.dp)
+                    )
+                }
+                IconButton(
+                    onClick = { /*TODO*/ },
+                    modifier = Modifier.size(120.dp)
+                ) {
+                    Icon(
+                        bitmap = ImageBitmap.imageResource(R.drawable.profile),
+                        contentDescription = "",
+                        modifier = Modifier.size(55.dp)
+                    )
+                }
+
+            }
+        }
+
+
+    }
 
 }

+ 64 - 6
ProjectApp/TomatoAndPotatoAPP/app/src/main/java/com/example/tomatoandpotatoapp/Screens/ProfileScreen.kt

@@ -1,5 +1,6 @@
 package com.example.tomatoandpotatoapp.Screens
 
+import android.widget.ImageButton
 import androidx.compose.foundation.background
 import androidx.compose.foundation.layout.Arrangement
 import androidx.compose.foundation.layout.Box
@@ -9,10 +10,14 @@ import androidx.compose.foundation.layout.Spacer
 import androidx.compose.foundation.layout.fillMaxSize
 import androidx.compose.foundation.layout.fillMaxWidth
 import androidx.compose.foundation.layout.height
+import androidx.compose.foundation.layout.size
 import androidx.compose.foundation.layout.width
 import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.material.icons.Icons
 import androidx.compose.material3.Button
 import androidx.compose.material3.ButtonDefaults
+import androidx.compose.material3.Icon
+import androidx.compose.material3.IconButton
 import androidx.compose.material3.Text
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.getValue
@@ -22,7 +27,9 @@ import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.graphics.Brush
 import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.ImageBitmap
 import androidx.compose.ui.platform.LocalContext
+import androidx.compose.ui.res.imageResource
 import androidx.compose.ui.text.font.FontWeight
 import androidx.compose.ui.tooling.preview.Preview
 import androidx.compose.ui.unit.dp
@@ -30,6 +37,7 @@ import androidx.compose.ui.unit.sp
 import com.example.tomatoandpotatoapp.ViewModelsPack.SupabaseAuthViewModel
 import androidx.lifecycle.viewmodel.compose.viewModel
 import androidx.navigation.NavController
+import com.example.tomatoandpotatoapp.R
 import com.example.tomatoandpotatoapp.utils.EditProfileString
 
 @Preview
@@ -79,29 +87,40 @@ fun MyProfile(
             Row(
                 modifier = Modifier
                     .fillMaxWidth()
-                    .height(75.dp),
+                    .height(75.dp)
+                    .background(color = Color(0xffD9D9D9)),
                 horizontalArrangement = Arrangement.Center,
                 verticalAlignment = Alignment.CenterVertically
             ) {
                 Text(
                     text = "Профиль",
-                    fontWeight = FontWeight.W700,
-                    color = Color.White,
+                    fontWeight = FontWeight.W800,
+                    color = Color.Black,
                     fontSize = 25.sp
                 )
             }
 
             Spacer(modifier = Modifier.height(60.dp))
+            Row(modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.Center) {
 
-            EditProfileString(search = "", onValueChange = {}, enabled = true)
+                EditProfileString(search = "", onValueChange = {}, enabled = true)
+            }
 
             Spacer(modifier = Modifier.height(30.dp))
 
-            EditProfileString(search = "", onValueChange = {}, enabled = true)
+            Row(modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.Center) {
+
+                EditProfileString(search = "", onValueChange = {}, enabled = true)
+            }
+
 
             Spacer(modifier = Modifier.height(30.dp))
 
-            EditProfileString(search = "", onValueChange = {}, enabled = true)
+            Row(modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.Center) {
+
+                EditProfileString(search = "", onValueChange = {}, enabled = true)
+            }
+
 
             Spacer(modifier = Modifier.height(110.dp))
 
@@ -152,6 +171,45 @@ fun MyProfile(
                     )
                 }
             }
+
+            Spacer(modifier = Modifier.weight(0.2f))
+
+            Row(modifier = Modifier
+                .fillMaxWidth()
+                .height(80.dp)
+                .align(Alignment.End)
+                .background(color = Color(0xff718588)),
+                horizontalArrangement = Arrangement.SpaceEvenly
+            ) {
+                IconButton(
+                    onClick = { /*TODO*/ },
+                    modifier = Modifier.size(120.dp)
+                ) {
+                    Icon(
+                        bitmap = ImageBitmap.imageResource(R.drawable.message),
+                        contentDescription ="",
+                        modifier = Modifier.size(55.dp))
+                }
+                IconButton(
+                    onClick = { /*TODO*/ },
+                    modifier = Modifier.size(120.dp)
+                ) {
+                    Icon(
+                        bitmap = ImageBitmap.imageResource(R.drawable.catalog),
+                        contentDescription ="",
+                        modifier = Modifier.size(55.dp))
+                }
+                IconButton(
+                    onClick = { /*TODO*/ },
+                    modifier = Modifier.size(120.dp)
+                ) {
+                    Icon(
+                        bitmap = ImageBitmap.imageResource(R.drawable.profileblack),
+                        contentDescription ="",
+                        modifier = Modifier.size(55.dp))
+                }
+
+            }
         }
     }
 }

+ 0 - 1
ProjectApp/TomatoAndPotatoAPP/app/src/main/java/com/example/tomatoandpotatoapp/utils/ProfileString.kt

@@ -44,7 +44,6 @@ fun EditProfileString(
                 focusedSupportingTextColor = Color.Black
             ),
             modifier = Modifier
-                .fillMaxWidth(1f)
                 .background(Color(0XFFF5F5F9))
                 .height(height = 50.dp)
                 .width(width = 316.dp),

BIN
ProjectApp/TomatoAndPotatoAPP/app/src/main/res/drawable/catalog.png


BIN
ProjectApp/TomatoAndPotatoAPP/app/src/main/res/drawable/catalogblack.png


BIN
ProjectApp/TomatoAndPotatoAPP/app/src/main/res/drawable/message.png


BIN
ProjectApp/TomatoAndPotatoAPP/app/src/main/res/drawable/messageblack.png


BIN
ProjectApp/TomatoAndPotatoAPP/app/src/main/res/drawable/profile.png


BIN
ProjectApp/TomatoAndPotatoAPP/app/src/main/res/drawable/profileblack.png