Отображает занято или нет

This commit is contained in:
Кашин Максим 2023-11-22 22:59:19 +04:00
parent bce45a28f0
commit 9565e46d37
2 changed files with 20 additions and 2 deletions

View File

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

View File

@ -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()
)
}
}
}