From cdf64fb3be7f10b91cfddd3309d24656d81e4fb5 Mon Sep 17 00:00:00 2001 From: Magda Wojtowicz Date: Wed, 31 Jul 2024 16:36:06 +0200 Subject: [PATCH] sight changes in cart screen placeholder --- .../io/opentelemetry/android/demo/ui/shop/Navigation.kt | 5 +++-- .../io/opentelemetry/android/demo/ui/shop/cart/Cart.kt | 7 +++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/demo-app/src/main/java/io/opentelemetry/android/demo/ui/shop/Navigation.kt b/demo-app/src/main/java/io/opentelemetry/android/demo/ui/shop/Navigation.kt index 77cbff18c..76942e2e8 100644 --- a/demo-app/src/main/java/io/opentelemetry/android/demo/ui/shop/Navigation.kt +++ b/demo-app/src/main/java/io/opentelemetry/android/demo/ui/shop/Navigation.kt @@ -52,6 +52,8 @@ class AstronomyShopNavController( navController.navigate("${MainDestinations.PRODUCT_DETAIL_ROUTE}/$productId") } +} + @Composable fun BottomNavigationBar( items: List, @@ -75,5 +77,4 @@ fun BottomNavigationBar( ) } } -} - +} \ No newline at end of file diff --git a/demo-app/src/main/java/io/opentelemetry/android/demo/ui/shop/cart/Cart.kt b/demo-app/src/main/java/io/opentelemetry/android/demo/ui/shop/cart/Cart.kt index 4015577ba..a0781e841 100644 --- a/demo-app/src/main/java/io/opentelemetry/android/demo/ui/shop/cart/Cart.kt +++ b/demo-app/src/main/java/io/opentelemetry/android/demo/ui/shop/cart/Cart.kt @@ -15,7 +15,7 @@ import io.opentelemetry.android.demo.model.Product @Composable fun CartScreen() { -// val products + val products : List = listOf() Scaffold( content = { innerPadding -> Column( @@ -27,10 +27,9 @@ fun CartScreen() { LazyColumn( modifier = Modifier.weight(1f) ) { -// this.items(products) { product -> CartItem(product) } + items(products.size) { index -> CartItem(products[index]) } } -// CheckoutButton(totalPrice = products.sumOf { it.price }) - CheckoutButton(totalPrice = 100.0) + CheckoutButton(totalPrice = products.sumOf { it.priceValue() }) } } )