From d1ca80dc9c38f440d127816a0db7b7d6d311e784 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: Fri, 27 Oct 2023 00:33:22 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20=D1=87?= =?UTF-8?q?=D1=82=D0=BE=20=D1=82=D0=BE=20=D1=82=D0=B8=D0=BF=D0=BE=20=D1=81?= =?UTF-8?q?=D0=BF=D0=B8=D1=81=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../labwork/button_navigation/Screens.kt | 47 +++++++++++++++--- .../com/example/labwork/pages/ListProduct.kt | 49 +++++++++++++++++++ .../main/res/drawable/baseline_menu_book.xml | 8 +++ 3 files changed, 98 insertions(+), 6 deletions(-) create mode 100644 app/src/main/java/com/example/labwork/pages/ListProduct.kt create mode 100644 app/src/main/res/drawable/baseline_menu_book.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 1057c37..afe2a67 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 @@ -1,15 +1,42 @@ package com.example.labwork.button_navigation +import androidx.compose.foundation.Image +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.fillMaxSize +import androidx.compose.foundation.layout.offset +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.requiredHeight +import androidx.compose.foundation.layout.requiredSize +import androidx.compose.foundation.layout.requiredWidth import androidx.compose.foundation.layout.wrapContentHeight +import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Text import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.ColorFilter +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.TextStyle +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.em +import androidx.compose.ui.unit.sp +import com.example.labwork.R +import com.example.labwork.pages.ListProduct @Composable fun ScreenInfo() { Text( - modifier = Modifier.fillMaxSize().wrapContentHeight(), + modifier = Modifier + .fillMaxSize() + .wrapContentHeight(), text = "Тут будет главный экран..." ) } @@ -17,15 +44,23 @@ fun ScreenInfo() { @Composable fun ScreenProfile() { Text( - modifier = Modifier.fillMaxSize().wrapContentHeight(), + modifier = Modifier + .fillMaxSize() + .wrapContentHeight(), text = "Тут будет профиль экран..." ) } + @Composable fun ScreenListProduct() { - Text( - modifier = Modifier.fillMaxSize().wrapContentHeight(), - text = "Тут будет профиль продуктов..." - ) + Column { + ListProduct("Максим", "Тест") + ListProduct("Максим", "Тест") + ListProduct("Максим", "Тест") + ListProduct("Максим", "Тест") + ListProduct("Максим", "Тест") + ListProduct("Максим", "Тест") + } } + diff --git a/app/src/main/java/com/example/labwork/pages/ListProduct.kt b/app/src/main/java/com/example/labwork/pages/ListProduct.kt new file mode 100644 index 0000000..165df3f --- /dev/null +++ b/app/src/main/java/com/example/labwork/pages/ListProduct.kt @@ -0,0 +1,49 @@ +package com.example.labwork.pages + +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Card +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.draw.shadow +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.unit.dp +import com.example.labwork.R + +@Composable +fun ListProduct(name: String, about: String) { + Card(modifier = Modifier + .fillMaxWidth() + .padding(10.dp), + shape = RoundedCornerShape(15.dp), + elevation = 5.dp + ) { + Box { + Row(verticalAlignment = Alignment.CenterVertically) { + Image(painter = painterResource(id = R.drawable.baseline_menu_book), + contentDescription = "book", + contentScale = ContentScale.Crop, + modifier = Modifier + .padding(10.dp) + .size(86.dp) + .shadow(2.dp) + ) + Column { + Text(text = name) + Text(text = about) + } + } + } + } +} \ No newline at end of file diff --git a/app/src/main/res/drawable/baseline_menu_book.xml b/app/src/main/res/drawable/baseline_menu_book.xml new file mode 100644 index 0000000..21e9852 --- /dev/null +++ b/app/src/main/res/drawable/baseline_menu_book.xml @@ -0,0 +1,8 @@ + + + + + +