From 9565e46d37090cfbf6b18bcdc090a289cf2032ce 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: Wed, 22 Nov 2023 22:59:19 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6?= =?UTF-8?q?=D0=B0=D0=B5=D1=82=20=D0=B7=D0=B0=D0=BD=D1=8F=D1=82=D0=BE=20?= =?UTF-8?q?=D0=B8=D0=BB=D0=B8=20=D0=BD=D0=B5=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/labwork/database/AppDatabase.kt | 4 ++-- .../labwork/pages/product/ListProduct.kt | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/example/labwork/database/AppDatabase.kt b/app/src/main/java/com/example/labwork/database/AppDatabase.kt index 9c4b5d2..2b9191c 100644 --- a/app/src/main/java/com/example/labwork/database/AppDatabase.kt +++ b/app/src/main/java/com/example/labwork/database/AppDatabase.kt @@ -59,9 +59,9 @@ abstract class AppDatabase : RoomDatabase() { userDao.insertUser(user2) // Создание велосипедов - val bicycle1 = Bicycle(brand = "Trek", model = "Велосипед 1", color = "Black", userId = null, id = null) + val bicycle1 = Bicycle(brand = "Trek", model = "Велосипед 1", color = "Black", userId = 1, id = null) val bicycle2 = Bicycle(brand = "Trek", model = "Велосипед 2", color = "Black", userId = null, id = null) - val bicycle3 = Bicycle(brand = "Trek", model = "Велосипед 3", color = "Black", userId = null, id = null) + val bicycle3 = Bicycle(brand = "Trek", model = "Велосипед 3", color = "Black", userId = 1, id = null) val bicycle4 = Bicycle(brand = "Trek", model = "Велосипед 4", color = "Black", userId = null, id = null) val bicycle5 = Bicycle(brand = "Trek", model = "Велосипед 5", color = "Black", userId = null, id = null) val bicycle6 = Bicycle(brand = "Trek", model = "Велосипед 6", color = "Black", userId = null, id = null) diff --git a/app/src/main/java/com/example/labwork/pages/product/ListProduct.kt b/app/src/main/java/com/example/labwork/pages/product/ListProduct.kt index a8e39d1..f7f1f5d 100644 --- a/app/src/main/java/com/example/labwork/pages/product/ListProduct.kt +++ b/app/src/main/java/com/example/labwork/pages/product/ListProduct.kt @@ -148,6 +148,24 @@ fun ListProduct(item: Bicycle, bicycleDao: BicycleDao, navHostController: NavHos modifier = Modifier .fillMaxWidth() ) + Text( + color = Color.Black, + text = item.brand, + maxLines = 10, + fontSize = 14.sp, + textAlign = TextAlign.Center, + modifier = Modifier + .fillMaxWidth() + ) + Text( + color = Color.Black, + text = if (item.userId != null) "Занято" else "Свободно", + maxLines = 10, + fontSize = 14.sp, + textAlign = TextAlign.Center, + modifier = Modifier + .fillMaxWidth() + ) } } }