дезигн поправлен

потом можно исправить админ панель
This commit is contained in:
VictoriaPresnyakova 2023-10-17 21:59:23 +04:00
parent 35d89b440e
commit 83d91169cc
15 changed files with 189 additions and 79 deletions

View File

@ -5,5 +5,7 @@ data class Hotel(
val name: String, val name: String,
val img: Int, val img: Int,
val stars: Int, val stars: Int,
val location: String val location: String,
val info: String,
val price: Int,
) )

View File

@ -25,7 +25,7 @@ fun NavController(navController: NavHostController) {
startDestination = NavItem.Home.route startDestination = NavItem.Home.route
) { ) {
composable(NavItem.HotelInfo.route) { composable(NavItem.HotelInfo.route) {
HotelInfo(Hotel("hotel", R.drawable.img_1, 4, "location"), navController) HotelInfo(Hotel("hotel", R.drawable.img_1, 4, "location", "info", 4000), navController)
} }
composable(NavItem.Home.route) { composable(NavItem.Home.route) {
HomeScreen(navController) HomeScreen(navController)

View File

@ -51,7 +51,6 @@ fun AddPanel(){
.fillMaxWidth() .fillMaxWidth()
.padding(16.dp) .padding(16.dp)
.clip(RoundedCornerShape(16.dp)) .clip(RoundedCornerShape(16.dp))
.background((Color(red = 0x2A, green = 0x7D, blue = 0xB9, alpha = 0xFF)))
.verticalScroll(rememberScrollState()) .verticalScroll(rememberScrollState())
) { ) {
Column( Column(
@ -70,7 +69,7 @@ fun AddPanel(){
) )
Button( Button(
colors = ButtonDefaults.buttonColors( colors = ButtonDefaults.buttonColors(
backgroundColor = Color(red = 0x2A, green = 0x7D, blue = 0xB9, alpha = 0xFF), backgroundColor = colorResource(id = R.color.figma_blue),
contentColor = Color.White contentColor = Color.White
), ),
onClick = { onClick = {
@ -79,6 +78,7 @@ fun AddPanel(){
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.padding(16.dp, 0.dp, 16.dp, 16.dp) .padding(16.dp, 0.dp, 16.dp, 16.dp)
.height(50.dp)
) { ) {
Text("Add image") Text("Add image")
} }
@ -103,7 +103,34 @@ fun AddPanel(){
), ),
placeholder = { placeholder = {
Text( Text(
text = "Brand", text = "Stars",
style = TextStyle(fontSize = 12.sp)
)
}
)
Spacer(modifier = Modifier.height(16.dp))
TextField(
value = "",
onValueChange = { },
modifier = Modifier
.fillMaxWidth()
.height(50.dp)
.padding(16.dp, 0.dp)
.border(1.dp, Color.Gray, RoundedCornerShape(4.dp)),
singleLine = true,
keyboardOptions = KeyboardOptions(
keyboardType = KeyboardType.Text,
imeAction = ImeAction.Next
),
keyboardActions = KeyboardActions(
onNext = {
}
),
placeholder = {
Text(
text = "Location",
style = TextStyle(fontSize = 12.sp) style = TextStyle(fontSize = 12.sp)
) )
} }
@ -131,39 +158,11 @@ fun AddPanel(){
), ),
placeholder = { placeholder = {
Text( Text(
text = "Model", text = "Info",
style = TextStyle(fontSize = 12.sp) style = TextStyle(fontSize = 12.sp)
) )
} }
) )
Spacer(modifier = Modifier.height(16.dp))
TextField(
value = " ",
onValueChange = { },
modifier = Modifier
.fillMaxWidth()
.height(150.dp)
.padding(16.dp, 0.dp)
.border(1.dp, Color.Gray, RoundedCornerShape(4.dp)),
keyboardOptions = KeyboardOptions(
keyboardType = KeyboardType.Text,
imeAction = ImeAction.Next
),
keyboardActions = KeyboardActions(
onNext = {
}
),
placeholder = {
Text(
text = "Description",
style = TextStyle(fontSize = 12.sp)
)
}
)
Spacer(modifier = Modifier.height(16.dp)) Spacer(modifier = Modifier.height(16.dp))
TextField( TextField(
@ -191,10 +190,37 @@ fun AddPanel(){
) )
} }
) )
Spacer(modifier = Modifier.height(16.dp))
TextField(
value = "",
onValueChange = { },
modifier = Modifier
.fillMaxWidth()
.height(50.dp)
.padding(16.dp, 0.dp)
.border(1.dp, Color.Gray, RoundedCornerShape(4.dp)),
singleLine = true,
keyboardOptions = KeyboardOptions(
keyboardType = KeyboardType.Text,
imeAction = ImeAction.Next
),
keyboardActions = KeyboardActions(
onNext = {
}
),
placeholder = {
Text(
text = "Info",
style = TextStyle(fontSize = 12.sp)
)
}
)
Button( Button(
colors = ButtonDefaults.buttonColors( colors = ButtonDefaults.buttonColors(
backgroundColor =(Color(red = 0x2A, green = 0x7D, blue = 0xB9, alpha = 0xFF)), backgroundColor =colorResource(id = R.color.figma_blue),
contentColor = Color.White contentColor = Color.White
), ),
onClick = { onClick = {
@ -203,8 +229,9 @@ fun AddPanel(){
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.padding(16.dp) .padding(16.dp)
.height(50.dp)
) { ) {
Text("Add sneaker") Text("Add hotel")
} }
} }
} }

View File

@ -12,13 +12,16 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.navigation.NavHostController import androidx.navigation.NavHostController
import androidx.navigation.compose.rememberNavController
import com.example.androidlabs.profileScreen.signIn.LoginScreen
@Composable @Composable
fun AdminPanel(navHostController: NavHostController) { fun AdminPanel(navHostController: NavHostController) {
var isAddPanelVisible by remember { mutableStateOf(false) } var isAddPanelVisible by remember { mutableStateOf(false) }
var isChangePanelVisible by remember { mutableStateOf(false) } var isChangePanelVisible by remember { mutableStateOf(true) }
Column( Column(
modifier = Modifier modifier = Modifier
@ -46,3 +49,10 @@ fun AdminPanel(navHostController: NavHostController) {
} }
} }
} }
@Composable
@Preview(showBackground = true)
fun SignInScreenPreview(){
val navController = rememberNavController()
AdminPanel(navController)
}

View File

@ -56,7 +56,7 @@ fun CardHotelForChange(item: Hotel, navController: NavHostController) {
.padding(start = 16.dp) .padding(start = 16.dp)
) { ) {
item.name?.let { Text(text = it, fontSize = 20.sp) } item.name?.let { Text(text = it, fontSize = 20.sp) }
Text(text = "${item.location} USD", color = Color.Red, fontSize = 16.sp) Text(text = "${item.location}", color = Color.Red, fontSize = 16.sp)
} }
Image( Image(
@ -66,8 +66,8 @@ fun CardHotelForChange(item: Hotel, navController: NavHostController) {
.size(40.dp) .size(40.dp)
.padding(10.dp) .padding(10.dp)
.clickable { .clickable {
val sneakerItemString = Gson().toJson(item) val hotelItemString = Gson().toJson(item)
navController.navigate("changeSneaker/${sneakerItemString}") navController.navigate("changeHotel/${hotelItemString}")
} }
) )
@ -89,7 +89,7 @@ fun CardHotelForChange(item: Hotel, navController: NavHostController) {
@Composable @Composable
@Preview @Preview
fun CardSneakerLikePreview(){ fun CardHotelLikePreview(){
val navController = rememberNavController() val navController = rememberNavController()
CardHotelForChange(Hotel("Hotel", R.drawable.img, 5, "location"), navController) CardHotelForChange(Hotel("Hotel", R.drawable.img, 5, "location", "info", 4000), navController)
} }

View File

@ -34,9 +34,9 @@ fun ChangePanel(navHostController: NavHostController){
) { ) {
itemsIndexed( itemsIndexed(
listOf( listOf(
Hotel("Hotel", R.drawable.img, 5, "location"), Hotel("Hotel", R.drawable.img, 5, "location", "info", 4000),
Hotel("Hotel", R.drawable.img, 5, "location"), Hotel("Hotel", R.drawable.img, 5, "location", "info", 4000),
Hotel("Hotel", R.drawable.img, 5, "location") Hotel("Hotel", R.drawable.img, 5, "location", "info", 4000)
) )
){_, item-> ){_, item->
CardHotelForChange(item = item, navHostController) CardHotelForChange(item = item, navHostController)

View File

@ -16,6 +16,7 @@ import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.Button import androidx.compose.material.Button
import androidx.compose.material.ButtonDefaults import androidx.compose.material.ButtonDefaults
import androidx.compose.material.Text import androidx.compose.material.Text
import androidx.compose.material.TextField
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.mutableStateOf
@ -24,40 +25,49 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.PasswordVisualTransformation import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import androidx.navigation.compose.rememberNavController
import com.example.androidlabs.R
import com.example.androidlabs.profileScreen.signIn.LoginScreen
@Composable @Composable
fun BookingScreen() { fun BookingScreen() {
var room by remember { mutableStateOf("") }
var date by remember { mutableStateOf("") }
Column( Column(
modifier = Modifier modifier = Modifier
.fillMaxSize() .fillMaxSize()
.background(Color.White) .background(Color.White)
.padding(15.dp, 0.dp) .padding(16.dp)
, ,
verticalArrangement = Arrangement.Center, verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally horizontalAlignment = Alignment.CenterHorizontally
) { ) {
Text(text = "Booking", fontSize = 24.sp, fontWeight = FontWeight.Bold) var room by remember { mutableStateOf("") }
var date by remember { mutableStateOf("") }
Spacer(modifier = Modifier.height(16.dp)) Text(
text = "Booking",
fontSize = 24.sp,
fontWeight = FontWeight.Bold,
modifier = Modifier
.padding(16.dp)
)
BasicTextField( TextField(
value = room, value = room,
onValueChange = { room = it }, onValueChange = { room = it },
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.height(50.dp) .height(50.dp)
.padding(8.dp) .padding(16.dp, 0.dp)
.border(1.dp, Color.Gray, RoundedCornerShape(4.dp)) .border(1.dp, Color.Gray, RoundedCornerShape(4.dp)),
.padding(8.dp),
singleLine = true, singleLine = true,
keyboardOptions = KeyboardOptions( keyboardOptions = KeyboardOptions(
keyboardType = KeyboardType.Text, keyboardType = KeyboardType.Text,
@ -68,17 +78,24 @@ fun BookingScreen() {
} }
), ),
placeholder = {
Text(
text = "Room",
style = TextStyle(fontSize = 12.sp)
)
}
) )
BasicTextField( Spacer(modifier = Modifier.height(16.dp))
TextField(
value = date, value = date,
onValueChange = { date = it }, onValueChange = { date = it },
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.height(50.dp) .height(50.dp)
.padding(8.dp) .padding(16.dp, 0.dp)
.border(1.dp, Color.Gray, RoundedCornerShape(4.dp)) .border(1.dp, Color.Gray, RoundedCornerShape(4.dp)),
.padding(8.dp),
singleLine = true, singleLine = true,
visualTransformation = PasswordVisualTransformation(), visualTransformation = PasswordVisualTransformation(),
keyboardOptions = KeyboardOptions( keyboardOptions = KeyboardOptions(
@ -91,21 +108,35 @@ fun BookingScreen() {
} }
), ),
){ placeholder = {
Text(
text = "Date",
style = TextStyle(fontSize = 12.sp)
)
} }
)
Button( Button(
colors = ButtonDefaults.buttonColors( colors = ButtonDefaults.buttonColors(
backgroundColor = (Color(red = 0x2A, green = 0x7D, blue = 0xB9, alpha = 0xFF)), backgroundColor = (colorResource(id = R.color.figma_blue)),
contentColor = Color.White contentColor = Color.White
), ),
onClick = { onClick = {
//TODO
}, },
modifier = Modifier.fillMaxWidth() modifier = Modifier
.fillMaxWidth()
.padding(16.dp, 16.dp, 16.dp, 0.dp)
.height(50.dp)
) { ) {
Text("Payment") Text("Payment")
} }
} }
} }
@Composable
@Preview(showBackground = true)
fun BookingScreenPreview(){
val navController = rememberNavController()
BookingScreen()
}

View File

@ -13,11 +13,13 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import androidx.navigation.NavHostController import androidx.navigation.NavHostController
import androidx.navigation.compose.rememberNavController
import com.example.androidlabs.R import com.example.androidlabs.R
import com.example.androidlabs.homeScreen.CardItem.HotelCard import com.example.androidlabs.homeScreen.CardItem.HotelCard
import com.example.androidlabs.Hotel import com.example.androidlabs.Hotel
@ -31,7 +33,7 @@ fun HomeScreen(navController: NavHostController) {
.background(Color.White) .background(Color.White)
) { ) {
Box(modifier = Modifier Box(modifier = Modifier
.background(Color(red = 0x2A, green = 0x7D, blue = 0xB9, alpha = 0xFF)) .background(colorResource(id = R.color.figma_blue))
.fillMaxHeight(0.18f) .fillMaxHeight(0.18f)
){ ){
Column( Column(
@ -57,7 +59,7 @@ fun HomeScreen(navController: NavHostController) {
//.verticalScroll(rememberScrollState()) //.verticalScroll(rememberScrollState())
){ ){
items(count = 100 ){ items(count = 100 ){
HotelCard(Hotel("hotel", R.drawable.img, it % 6, "location"), navController) HotelCard(Hotel("hotel", R.drawable.img, it % 6, "location", "info", 4000), navController)
} }
} }
@ -66,5 +68,6 @@ fun HomeScreen(navController: NavHostController) {
@Preview(showBackground = true) @Preview(showBackground = true)
@Composable @Composable
fun HotelPreview() { fun HotelPreview() {
//HomeScreen() var nc = rememberNavController()
HomeScreen(nc)
} }

View File

@ -35,7 +35,7 @@ fun SearchField(
modifier = modifier modifier = modifier
.clip(RoundedCornerShape(30.dp)) .clip(RoundedCornerShape(30.dp))
.fillMaxWidth() .fillMaxWidth()
.background(Color.LightGray) .background(Color.White)
, ,
) { ) {
Row( Row(

View File

@ -2,6 +2,7 @@ package com.example.androidlabs.hotelScreen
import androidx.compose.animation.shrinkVertically import androidx.compose.animation.shrinkVertically
import androidx.compose.foundation.Image import androidx.compose.foundation.Image
import androidx.compose.foundation.ScrollState
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Box
@ -9,6 +10,7 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.size
import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.rememberScrollState
@ -26,10 +28,12 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.navigation.NavHostController import androidx.navigation.NavHostController
import androidx.navigation.compose.rememberNavController
import com.example.androidlabs.Hotel import com.example.androidlabs.Hotel
import com.example.androidlabs.R import com.example.androidlabs.R
import com.example.androidlabs.homeScreen.CardItem.HotelCard import com.example.androidlabs.homeScreen.CardItem.HotelCard
@ -59,6 +63,7 @@ fun HotelInfo(hotel: Hotel, navController: NavHostController) {
Row ( Row (
modifier = Modifier modifier = Modifier
.fillMaxWidth(), .fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceEvenly horizontalArrangement = Arrangement.SpaceEvenly
){ ){
Text(text = hotel.name) Text(text = hotel.name)
@ -127,17 +132,14 @@ fun HotelInfo(hotel: Hotel, navController: NavHostController) {
Text(text = "inf") Text(text = "inf")
} }
} }
//Divider(color = Color.Black, thickness = 1.dp)
Row( Row(
modifier = Modifier modifier = Modifier
//.fillMaxHeight()
.padding(horizontal = 60.dp)
.padding(bottom = 60.dp), .padding(bottom = 60.dp),
verticalAlignment = Alignment.Bottom verticalAlignment = Alignment.Bottom
){ ){
Button( Button(
colors = ButtonDefaults.buttonColors( colors = ButtonDefaults.buttonColors(
backgroundColor = (Color(red = 0x2A, green = 0x7D, blue = 0xB9, alpha = 0xFF)), backgroundColor = (colorResource(id = R.color.figma_blue)),
contentColor = Color.White contentColor = Color.White
), ),
onClick = { onClick = {
@ -145,6 +147,8 @@ fun HotelInfo(hotel: Hotel, navController: NavHostController) {
}, },
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.padding(16.dp, 16.dp, 16.dp, 5.dp)
.height(50.dp)
) { ) {
Text("Select Room") Text("Select Room")
} }
@ -156,7 +160,7 @@ fun HotelInfo(hotel: Hotel, navController: NavHostController) {
@Preview(showBackground = true) @Preview(showBackground = true)
@Composable @Composable
fun HotelInfoPreview() { fun HotelInfoPreview() {
val navController = rememberNavController()
//HotelInfo(Hotel("hotel", R.drawable.img_1, 4, "location")) HotelInfo(Hotel("hotel", R.drawable.img_1, 4, "location", "info", 4000), navController)
} }

View File

@ -18,71 +18,76 @@ import androidx.compose.ui.unit.dp
import androidx.navigation.NavHostController import androidx.navigation.NavHostController
import androidx.navigation.compose.rememberNavController import androidx.navigation.compose.rememberNavController
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.colorResource
import com.example.androidlabs.R
@Composable @Composable
fun ProfileScreen(navController: NavHostController) { fun ProfileScreen(navController: NavHostController) {
Column( Column(
modifier = Modifier modifier = Modifier
.fillMaxSize() .fillMaxWidth()
.background(Color.White), .fillMaxHeight()
.padding(16.dp),
verticalArrangement = Arrangement.Center, verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
){ ){
Row( Row(
modifier = Modifier
.clip(RoundedCornerShape(20.dp))
){ ){
Button( Button(
colors = ButtonDefaults.buttonColors( colors = ButtonDefaults.buttonColors(
backgroundColor = (Color(red = 0x2A, green = 0x7D, blue = 0xB9, alpha = 0xFF)), backgroundColor = (colorResource(id = R.color.figma_blue)),
contentColor = Color.White contentColor = Color.White
), ),
onClick = { onClick = {
navController.navigate("person") navController.navigate("person")
}, },
modifier = Modifier modifier = Modifier
.requiredSize(300.dp, 40.dp) .fillMaxWidth()
.padding(16.dp, 0.dp, 16.dp, 0.dp)
.height(50.dp)
) { ) {
Text(text = "Profile") Text(text = "Profile")
} }
} }
Spacer(modifier = Modifier.height(16.dp)) Spacer(modifier = Modifier.height(16.dp))
Row( Row(
modifier = Modifier
.clip(RoundedCornerShape(20.dp))
){ ){
Button( Button(
colors = ButtonDefaults.buttonColors( colors = ButtonDefaults.buttonColors(
backgroundColor = (Color(red = 0x2A, green = 0x7D, blue = 0xB9, alpha = 0xFF)), backgroundColor = (colorResource(id = R.color.figma_blue)),
contentColor = Color.White contentColor = Color.White
), ),
onClick = { onClick = {
navController.navigate("login") navController.navigate("login")
}, },
modifier = Modifier modifier = Modifier
.requiredSize(300.dp, 40.dp) .fillMaxWidth()
.padding(16.dp, 0.dp, 16.dp, 0.dp)
.height(50.dp)
) { ) {
Text(text = "Sign In") Text(text = "Sign In")
} }
} }
Spacer(modifier = Modifier.height(16.dp)) Spacer(modifier = Modifier.height(16.dp))
Row( Row(
modifier = Modifier
.clip(RoundedCornerShape(20.dp))
){ ){
Button( Button(
colors = ButtonDefaults.buttonColors( colors = ButtonDefaults.buttonColors(
backgroundColor = (Color(red = 0x2A, green = 0x7D, blue = 0xB9, alpha = 0xFF)), backgroundColor = (colorResource(id = R.color.figma_blue)),
contentColor = Color.White contentColor = Color.White
), ),
onClick = { onClick = {
navController.navigate("signup") navController.navigate("signup")
}, },
modifier = Modifier modifier = Modifier
.requiredSize(300.dp, 40.dp) .fillMaxWidth()
.padding(16.dp, 0.dp, 16.dp, 0.dp)
.height(50.dp)
) { ) {
Text(text = "Sign Up") Text(text = "Sign Up")
} }
@ -91,7 +96,7 @@ fun ProfileScreen(navController: NavHostController) {
} }
@Composable @Composable
@Preview @Preview(showBackground = true)
fun ProfileScreenPreview(){ fun ProfileScreenPreview(){
val navController = rememberNavController() val navController = rememberNavController()
ProfileScreen(navController = navController) ProfileScreen(navController = navController)

View File

@ -38,6 +38,8 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import androidx.navigation.NavHostController import androidx.navigation.NavHostController
import androidx.navigation.compose.rememberNavController
import com.example.androidlabs.R
@Composable @Composable
fun SignInCard(navController: NavHostController) { fun SignInCard(navController: NavHostController) {
@ -46,7 +48,7 @@ fun SignInCard(navController: NavHostController) {
.fillMaxWidth() .fillMaxWidth()
.padding(16.dp) .padding(16.dp)
.clip(RoundedCornerShape(16.dp)) .clip(RoundedCornerShape(16.dp))
.background((Color(red = 0x2A, green = 0x7D, blue = 0xB9, alpha = 0xFF)))
){ ){
Column( Column(
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
@ -122,8 +124,8 @@ fun SignInCard(navController: NavHostController) {
Button( Button(
colors = ButtonDefaults.buttonColors( colors = ButtonDefaults.buttonColors(
backgroundColor = Color.White, backgroundColor = (colorResource(id = R.color.figma_blue)),
contentColor = Color.Black contentColor = Color.White
), ),
onClick = { onClick = {
@ -131,6 +133,7 @@ fun SignInCard(navController: NavHostController) {
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.padding(16.dp, 16.dp, 16.dp, 0.dp) .padding(16.dp, 16.dp, 16.dp, 0.dp)
.height(50.dp)
) { ) {
Text("Sign In") Text("Sign In")
} }
@ -145,3 +148,10 @@ fun SignInCard(navController: NavHostController) {
} }
} }
} }
@Composable
@Preview(showBackground = true)
fun SignInScreenPreview(){
val navController = rememberNavController()
LoginScreen(navController = navController)
}

View File

@ -23,6 +23,7 @@ import androidx.compose.ui.unit.sp
import androidx.navigation.NavController import androidx.navigation.NavController
import androidx.navigation.NavHostController import androidx.navigation.NavHostController
import androidx.navigation.compose.rememberNavController import androidx.navigation.compose.rememberNavController
import com.example.androidlabs.profileScreen.profile.ProfileScreen
import androidx.compose.material.Text as Text1 import androidx.compose.material.Text as Text1
@Composable @Composable
@ -35,3 +36,10 @@ fun LoginScreen(navController: NavHostController) {
SignInCard(navController) SignInCard(navController)
} }
} }
@Composable
@Preview
fun LoginScreenPreview(){
val navController = rememberNavController()
LoginScreen(navController = navController)
}

View File

@ -34,6 +34,9 @@ import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import androidx.navigation.compose.rememberNavController
import com.example.androidlabs.R
import com.example.androidlabs.profileScreen.signIn.LoginScreen
@Composable @Composable
@Preview @Preview
@ -48,7 +51,6 @@ fun SignUpCard() {
.fillMaxWidth() .fillMaxWidth()
.padding(16.dp) .padding(16.dp)
.clip(RoundedCornerShape(16.dp)) .clip(RoundedCornerShape(16.dp))
.background((Color(red = 0x2A, green = 0x7D, blue = 0xB9, alpha = 0xFF)))
){ ){
Column( Column(
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
@ -207,18 +209,25 @@ fun SignUpCard() {
Button( Button(
colors = ButtonDefaults.buttonColors( colors = ButtonDefaults.buttonColors(
backgroundColor = Color.White, backgroundColor = (colorResource(id = R.color.figma_blue)),
contentColor = Color.Black contentColor = Color.White
), ),
onClick = { onClick = {
}, },
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.padding(16.dp) .padding(16.dp, 16.dp, 16.dp, 0.dp)
.height(50.dp)
) { ) {
Text("Sign Up") Text("Sign Up")
} }
} }
} }
} }
@Composable
@Preview(showBackground = true)
fun SignUpScreenPreview(){
SignUpScreen()
}

View File

@ -8,5 +8,6 @@
<color name="black">#FF000000</color> <color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color> <color name="white">#FFFFFFFF</color>
<color name="figma">#F4F4F4</color> <color name="figma">#F4F4F4</color>
<color name="figma_blue">#3660F6</color> <color name="figma_blue">#802A7DB9</color>
</resources> </resources>