From 9c61c4599c79a7ef14d625e6dd0ee15d377abb4a Mon Sep 17 00:00:00 2001 From: Danya_Mochalov Date: Tue, 10 Oct 2023 03:43:26 +0400 Subject: [PATCH] =?UTF-8?q?=D0=AD=D0=BA=D1=80=D0=B0=D0=BD=20=D0=9F=D0=BE?= =?UTF-8?q?=D0=BA=D1=83=D0=BF=D0=BE=D0=BA=20=D0=B3=D0=BE=D1=82=D0=BE=D0=B2?= =?UTF-8?q?...=20=D0=AF=20=D0=B1=D1=83=D0=BA=D0=B2=D0=B0=D0=BB=D1=8C=D0=BD?= =?UTF-8?q?=D0=BE=20=D0=A0=D0=B0=D0=B9=D0=B0=D0=BD=20=D0=93=D0=BE=D1=81?= =?UTF-8?q?=D0=BB=D0=B8=D0=BD=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shawarma/screens/cart/CartScreen.kt | 202 +++++++++++++++++- app/src/main/res/drawable/trash.png | Bin 0 -> 514 bytes 2 files changed, 198 insertions(+), 4 deletions(-) create mode 100644 app/src/main/res/drawable/trash.png diff --git a/app/src/main/java/com/example/shawarma/screens/cart/CartScreen.kt b/app/src/main/java/com/example/shawarma/screens/cart/CartScreen.kt index 259ce5b..8dbde3a 100644 --- a/app/src/main/java/com/example/shawarma/screens/cart/CartScreen.kt +++ b/app/src/main/java/com/example/shawarma/screens/cart/CartScreen.kt @@ -1,17 +1,211 @@ package com.example.shawarma.screens.cart +import androidx.compose.foundation.BorderStroke +import androidx.compose.foundation.background +import androidx.compose.foundation.gestures.scrollable +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.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.verticalScroll +import androidx.compose.material.Button +import androidx.compose.material.ButtonDefaults +import androidx.compose.material.Card +import androidx.compose.material.Icon 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.res.painterResource +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import androidx.compose.ui.zIndex +import com.example.shawarma.R +import com.example.shawarma.ui.theme.MarckFamily +import com.example.shawarma.ui.theme.MyLightRed +import com.example.shawarma.ui.theme.MyMainBackground +import com.example.shawarma.ui.theme.MyOrange +import com.example.shawarma.ui.theme.NunitoFamily +import com.example.shawarma.widgets.ShawarmaLogo2 @Composable fun CartScreen() { Box( - contentAlignment = Alignment.Center + contentAlignment = Alignment.TopCenter ) { - Text( - text = "Cart" - ) + CartWidget() + ShawarmaLogo2() + } +} + +@Composable +fun CartWidget(){ + Box( + modifier = Modifier + .clip(shape = RoundedCornerShape(30.dp)) + .padding(top = 100.dp) + .fillMaxSize() + .background(color = MyMainBackground) + .zIndex(2f), + + contentAlignment = Alignment.TopCenter + ) { + Column( + horizontalAlignment = Alignment.CenterHorizontally, + modifier = Modifier.verticalScroll(rememberScrollState()) + ) { + Text( + text = "Корзина", + fontFamily = MarckFamily, + fontSize = 40.sp, + modifier = Modifier.padding(top = 15.dp) + ) + Text( + text = "Оплачено:", + fontFamily = NunitoFamily, + fontSize = 20.sp, + modifier = Modifier.padding(top = 15.dp), + fontWeight = FontWeight.Bold + ) + Card( + border = BorderStroke(width = 2.dp, color = MyOrange), + shape = RoundedCornerShape(size = 20.dp), + backgroundColor = Color.White, + modifier = Modifier.size(340.dp, 100.dp) + ) { + Column { + Row( + horizontalArrangement = Arrangement.SpaceBetween, + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 20.dp) + ){ + Text( + text = "Классика", + fontFamily = NunitoFamily, + fontSize = 20.sp, + modifier = Modifier.padding(top = 15.dp), + fontWeight = FontWeight.Bold + ) + Text( + text = "x2", + fontFamily = NunitoFamily, + fontSize = 20.sp, + modifier = Modifier.padding(top = 15.dp), + fontWeight = FontWeight.Bold + ) + Text( + text = "300 руб.", + fontFamily = NunitoFamily, + fontSize = 20.sp, + modifier = Modifier.padding(top = 15.dp), + fontWeight = FontWeight.Bold + ) + } + + Row( + horizontalArrangement = Arrangement.SpaceBetween, + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 20.dp) + ){ + Text( + text = "Статус: ", + fontFamily = NunitoFamily, + fontSize = 20.sp, + modifier = Modifier.padding(top = 15.dp), + fontWeight = FontWeight.Bold, + color = Color.Gray + ) + Text( + text = "Готовится", + fontFamily = NunitoFamily, + fontSize = 20.sp, + modifier = Modifier.padding(top = 15.dp), + fontWeight = FontWeight.Bold, + color = Color.Gray + ) + } + } + } + Text( + text = "Ожидает оплаты:", + fontFamily = NunitoFamily, + fontSize = 20.sp, + modifier = Modifier.padding(top = 15.dp), + fontWeight = FontWeight.Bold + ) + Card( + border = BorderStroke(width = 2.dp, color = MyOrange), + shape = RoundedCornerShape(size = 20.dp), + backgroundColor = Color.White, + modifier = Modifier.size(340.dp, 100.dp) + ) { + Row( + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.SpaceBetween, + modifier = Modifier.padding(20.dp) + ) { + Column( + + modifier = Modifier.fillMaxWidth(0.5f) + ) { + Row( + horizontalArrangement = Arrangement.SpaceBetween, + modifier = Modifier.fillMaxWidth() + ){ + Text( + text = "Кока-кола", + fontFamily = NunitoFamily, + fontSize = 20.sp, + fontWeight = FontWeight.Bold + ) + Text( + text = "x2", + fontFamily = NunitoFamily, + fontSize = 20.sp, + fontWeight = FontWeight.Bold + ) + } + Text( + text = "300 руб.", + fontFamily = NunitoFamily, + fontSize = 20.sp, + fontWeight = FontWeight.Bold + ) + } + + Button( + colors = ButtonDefaults.buttonColors( + backgroundColor = MyLightRed + ), + shape = RoundedCornerShape(size = 10.dp), + modifier = Modifier + .size(100.dp, 60.dp) + .fillMaxSize(0.5f), + onClick = { /*TODO*/ } + ) { + Icon( + painter = painterResource(id = R.drawable.trash), + contentDescription = "Delete", + modifier = Modifier.size(42.dp) + ) + } + + } + } + + + } + } } \ No newline at end of file diff --git a/app/src/main/res/drawable/trash.png b/app/src/main/res/drawable/trash.png new file mode 100644 index 0000000000000000000000000000000000000000..995324440ca73a12798decc388d3bfc8d693c340 GIT binary patch literal 514 zcmV+d0{#7oP)sxN~rKbCozL@h>P>l(TYjQk*$(a3l&Risa&iP-?NBY35C~ z_vh@qW8Q5(_1S56X5W4GZNBsN&I{;MqKEW@))K7Jef1qJTAqA{u&#y-(DXwqmG2v|Fh;6c6pkHywtfsDeS{x`VM!Nrob2c)=wxw#o4BYhzmkt=BN*9nx+oAK-XjX z7wK|L|0yh&X+^kIMiE)r@KtXSAJjBHsA+sq)A*pK@j*>f*t^g)+(2%-L~)P! z?ZrEK2}AgsJ6)oJe!(%Kf>{3i