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 @@ + + + + + +