Compare commits
2 Commits
9c61c4599c
...
6c7a04d5d4
Author | SHA1 | Date | |
---|---|---|---|
6c7a04d5d4 | |||
b5c8270c1c |
@ -2,15 +2,21 @@ package com.example.shawarma.screens.cart
|
||||
|
||||
import androidx.compose.foundation.BorderStroke
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.gestures.Orientation
|
||||
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.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
@ -25,6 +31,8 @@ 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.Font
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
@ -58,10 +66,6 @@ fun CartWidget(){
|
||||
.zIndex(2f),
|
||||
|
||||
contentAlignment = Alignment.TopCenter
|
||||
) {
|
||||
Column(
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
modifier = Modifier.verticalScroll(rememberScrollState())
|
||||
) {
|
||||
Text(
|
||||
text = "Корзина",
|
||||
@ -69,6 +73,14 @@ fun CartWidget(){
|
||||
fontSize = 40.sp,
|
||||
modifier = Modifier.padding(top = 15.dp)
|
||||
)
|
||||
Column(
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(top=55.dp)
|
||||
.verticalScroll(rememberScrollState())
|
||||
) {
|
||||
|
||||
Text(
|
||||
text = "Оплачено:",
|
||||
fontFamily = NunitoFamily,
|
||||
@ -76,6 +88,60 @@ fun CartWidget(){
|
||||
modifier = Modifier.padding(top = 15.dp),
|
||||
fontWeight = FontWeight.Bold
|
||||
)
|
||||
LazyColumn(
|
||||
modifier = Modifier
|
||||
.width(340.dp)
|
||||
.height(200.dp)
|
||||
) {
|
||||
items(2) {
|
||||
PaidItem()
|
||||
}
|
||||
}
|
||||
Text(
|
||||
text = "Ожидает оплаты:",
|
||||
fontFamily = NunitoFamily,
|
||||
fontSize = 20.sp,
|
||||
modifier = Modifier.padding(top = 15.dp),
|
||||
fontWeight = FontWeight.Bold
|
||||
)
|
||||
LazyColumn(
|
||||
modifier = Modifier
|
||||
.width(340.dp)
|
||||
.height(200.dp)
|
||||
) {
|
||||
items(2) {
|
||||
CartItem()
|
||||
}
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(20.dp))
|
||||
|
||||
Button(
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
backgroundColor = Color(0xFF91FF87)
|
||||
),
|
||||
shape = RoundedCornerShape(20.dp),
|
||||
border = BorderStroke(2.dp, Color(0x66000000)),
|
||||
modifier = Modifier.size(240.dp, 60.dp),
|
||||
onClick = { /*TODO*/ }
|
||||
) {
|
||||
Text(
|
||||
"Оплатить",
|
||||
fontSize = 20.sp,
|
||||
fontFamily = NunitoFamily,
|
||||
fontWeight = FontWeight(700),
|
||||
)
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(70.dp))
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun PaidItem() {
|
||||
Card(
|
||||
border = BorderStroke(width = 2.dp, color = MyOrange),
|
||||
shape = RoundedCornerShape(size = 20.dp),
|
||||
@ -137,13 +203,11 @@ fun CartWidget(){
|
||||
}
|
||||
}
|
||||
}
|
||||
Text(
|
||||
text = "Ожидает оплаты:",
|
||||
fontFamily = NunitoFamily,
|
||||
fontSize = 20.sp,
|
||||
modifier = Modifier.padding(top = 15.dp),
|
||||
fontWeight = FontWeight.Bold
|
||||
)
|
||||
Spacer(modifier = Modifier.height(20.dp))
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun CartItem() {
|
||||
Card(
|
||||
border = BorderStroke(width = 2.dp, color = MyOrange),
|
||||
shape = RoundedCornerShape(size = 20.dp),
|
||||
@ -203,9 +267,5 @@ fun CartWidget(){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Spacer(modifier = Modifier.height(20.dp))
|
||||
}
|
@ -1,17 +1,332 @@
|
||||
package com.example.shawarma.screens.orders
|
||||
|
||||
import androidx.compose.foundation.BorderStroke
|
||||
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.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
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.Alignment.Companion.TopCenter
|
||||
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.MyLightYellow
|
||||
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 OrdersScreen() {
|
||||
Box(
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Text(
|
||||
text = "Orders"
|
||||
)
|
||||
ShawarmaLogo2()
|
||||
OrdersList()
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun OrdersList(){
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.clip(shape = RoundedCornerShape(30.dp))
|
||||
.padding(top = 100.dp)
|
||||
.fillMaxSize()
|
||||
.background(color = MyMainBackground)
|
||||
.zIndex(2f),
|
||||
|
||||
contentAlignment = Alignment.TopCenter
|
||||
) {
|
||||
Text(
|
||||
text = "Заказы",
|
||||
fontFamily = MarckFamily,
|
||||
fontSize = 40.sp,
|
||||
modifier = Modifier.padding(top = 15.dp)
|
||||
)
|
||||
|
||||
Column(
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(top = 55.dp)
|
||||
.verticalScroll(rememberScrollState())
|
||||
){
|
||||
Text(
|
||||
text = "Готовится:",
|
||||
fontFamily = NunitoFamily,
|
||||
fontSize = 20.sp,
|
||||
modifier = Modifier.padding(top = 15.dp),
|
||||
fontWeight = FontWeight.Bold
|
||||
)
|
||||
LazyColumn(
|
||||
modifier = Modifier
|
||||
.width(340.dp)
|
||||
.height(250.dp)
|
||||
) {
|
||||
items(2) {
|
||||
PreparingItem()
|
||||
}
|
||||
}
|
||||
Text(
|
||||
text = "Готово:",
|
||||
fontFamily = NunitoFamily,
|
||||
fontSize = 20.sp,
|
||||
modifier = Modifier.padding(top = 15.dp),
|
||||
fontWeight = FontWeight.Bold
|
||||
)
|
||||
LazyColumn(
|
||||
modifier = Modifier
|
||||
.width(340.dp)
|
||||
.height(250.dp)
|
||||
) {
|
||||
items(2) {
|
||||
PreparedItem()
|
||||
}
|
||||
}
|
||||
Text(
|
||||
text = "Выдано:",
|
||||
fontFamily = NunitoFamily,
|
||||
fontSize = 20.sp,
|
||||
modifier = Modifier.padding(top = 15.dp),
|
||||
fontWeight = FontWeight.Bold
|
||||
)
|
||||
LazyColumn(
|
||||
modifier = Modifier
|
||||
.width(340.dp)
|
||||
.height(250.dp)
|
||||
) {
|
||||
items(2) {
|
||||
ProcessedItem()
|
||||
}
|
||||
}
|
||||
Spacer(modifier = Modifier.height(70.dp))
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun PreparingItem(){
|
||||
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)
|
||||
){
|
||||
Text(
|
||||
text = "16:24",
|
||||
fontFamily = NunitoFamily,
|
||||
fontSize = 20.sp,
|
||||
fontWeight = FontWeight.Bold
|
||||
)
|
||||
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
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Button(
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
backgroundColor = MyLightYellow
|
||||
),
|
||||
shape = RoundedCornerShape(size = 10.dp),
|
||||
modifier = Modifier
|
||||
.size(100.dp, 60.dp)
|
||||
.fillMaxSize(0.5f),
|
||||
onClick = { /*TODO*/ }
|
||||
) {
|
||||
Text(
|
||||
text = "Готово!",
|
||||
fontFamily = NunitoFamily,
|
||||
fontSize = 14.sp,
|
||||
fontWeight = FontWeight.Bold
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(20.dp))
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun PreparedItem(){
|
||||
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)
|
||||
){
|
||||
Text(
|
||||
text = "16:24",
|
||||
fontFamily = NunitoFamily,
|
||||
fontSize = 20.sp,
|
||||
fontWeight = FontWeight.Bold
|
||||
)
|
||||
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
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Button(
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
backgroundColor = MyLightYellow
|
||||
),
|
||||
shape = RoundedCornerShape(size = 10.dp),
|
||||
modifier = Modifier
|
||||
.size(100.dp, 60.dp)
|
||||
.fillMaxSize(0.5f),
|
||||
onClick = { /*TODO*/ }
|
||||
) {
|
||||
Text(
|
||||
text = "Выдано!",
|
||||
fontFamily = NunitoFamily,
|
||||
fontSize = 14.sp,
|
||||
fontWeight = FontWeight.Bold
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(20.dp))
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun ProcessedItem(){
|
||||
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)
|
||||
){
|
||||
Text(
|
||||
text = "16:24",
|
||||
fontFamily = NunitoFamily,
|
||||
fontSize = 20.sp,
|
||||
fontWeight = FontWeight.Bold
|
||||
)
|
||||
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
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Column(
|
||||
|
||||
modifier = Modifier.fillMaxWidth(0.5f)
|
||||
){
|
||||
Text(
|
||||
text = "300 руб.",
|
||||
fontFamily = NunitoFamily,
|
||||
fontSize = 14.sp,
|
||||
fontWeight = FontWeight.Bold
|
||||
)
|
||||
Text(
|
||||
text = "20.03.2012",
|
||||
fontFamily = NunitoFamily,
|
||||
fontSize = 14.sp,
|
||||
fontWeight = FontWeight.Bold
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(20.dp))
|
||||
}
|
Loading…
Reference in New Issue
Block a user