Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.realestatemobileapplicationmae.screen
- import androidx.compose.foundation.clickable
- import androidx.compose.foundation.layout.*
- import androidx.compose.foundation.shape.RoundedCornerShape
- import androidx.compose.foundation.text.ClickableText
- import androidx.compose.foundation.text.KeyboardOptions
- import androidx.compose.material.Button
- import androidx.compose.material.RadioButton
- import androidx.compose.material.Text
- import androidx.compose.material.TextField
- import androidx.compose.runtime.*
- import androidx.compose.ui.Alignment
- import androidx.compose.ui.Modifier
- import androidx.compose.ui.text.AnnotatedString
- import androidx.compose.ui.text.TextStyle
- import androidx.compose.ui.text.font.FontFamily
- import androidx.compose.ui.text.input.KeyboardType
- import androidx.compose.ui.text.input.PasswordVisualTransformation
- import androidx.compose.ui.text.input.TextFieldValue
- import androidx.compose.ui.text.style.TextDecoration
- import androidx.compose.ui.tooling.preview.Preview
- import androidx.compose.ui.unit.dp
- import androidx.compose.ui.unit.sp
- import androidx.navigation.NavHostController
- import com.example.realestatemobileapplicationmae.ui.theme.Purple700
- import com.google.firebase.auth.ktx.auth
- import com.google.firebase.ktx.Firebase
- private val auth by lazy{
- Firebase.auth
- }
- @Composable
- fun SignUp(navController: NavHostController){
- Box(modifier = Modifier.fillMaxSize()){
- ClickableText(
- text = AnnotatedString("Sign up here"),
- modifier = Modifier.align(Alignment.BottomCenter)
- .padding(20.dp),
- onClick = {},
- style = TextStyle(
- fontSize = 14.sp,
- fontFamily = FontFamily.Default,
- textDecoration = TextDecoration.Underline,
- color = Purple700
- )
- )
- }
- Column(
- modifier = Modifier.padding(20.dp),
- verticalArrangement = Arrangement.Center,
- horizontalAlignment = Alignment.CenterHorizontally
- ){
- val username = remember { mutableStateOf(TextFieldValue()) }
- val password = remember { mutableStateOf(TextFieldValue()) }
- val name = remember { mutableStateOf(TextFieldValue()) }
- val age = remember { mutableStateOf(TextFieldValue())}
- val email = remember { mutableStateOf(TextFieldValue()) }
- Text(text = "SignOut", style = TextStyle(fontSize = 40.sp, fontFamily = FontFamily.Cursive))
- Spacer(modifier = Modifier.height(20.dp))
- TextField(
- label = { Text(text = "Username") },
- value = username.value,
- onValueChange = { username.value = it })
- Spacer(modifier = Modifier.height(20.dp))
- TextField(
- label = { Text(text = "Password") },
- value = password.value,
- visualTransformation = PasswordVisualTransformation(),
- keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password),
- onValueChange = { password.value = it })
- Spacer(modifier = Modifier.height(20.dp))
- TextField(
- label = { Text(text = "Name") },
- value = name.value,
- keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text),
- onValueChange = { password.value = it })
- Spacer(modifier = Modifier.height(20.dp))
- TextField(
- label = { Text(text ="Age")},
- value = age.value,
- keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Phone),
- onValueChange = { age.value=it})
- Spacer(modifier = Modifier.height(20.dp))
- TextField(
- label = { Text(text = "Email") },
- value = email.value,
- keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Email),
- onValueChange = { email.value = it })
- Spacer(modifier = Modifier.height(20.dp))
- var selected by remember { mutableStateOf("Male") }
- Row {
- Text(text = "Gender", style = TextStyle(fontSize = 24.sp))
- RadioButton(selected = selected == "Male", onClick = { selected = "Male" })
- Text(
- text = "Male",
- modifier = Modifier.clickable(onClick = { selected = "Male" }).padding(start = 4.dp)
- )
- Spacer(modifier = Modifier.size(4.dp))
- RadioButton(selected = selected == "Female", onClick = { selected = "Female" })
- Text(
- text = "Female",
- modifier = Modifier.clickable(onClick = { selected = "Female" }).padding(start = 4.dp)
- )
- }
- Spacer(modifier = Modifier.height(20.dp))
- Box(modifier = Modifier.padding(40.dp, 0.dp, 40.dp, 0.dp)) {
- Button(
- onClick = { navController.navigate("AddProperty")},
- shape = RoundedCornerShape(50.dp),
- modifier = Modifier
- .fillMaxWidth()
- .height(50.dp)
- ) {
- Text(text = "Registration")
- }
- }
- Spacer(modifier = Modifier.height(20.dp))
- ClickableText(
- text = AnnotatedString("Forgot password?"),
- onClick = { navController.navigate("SignUp")},
- style = TextStyle(
- fontSize = 14.sp,
- fontFamily = FontFamily.Default
- )
- )
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement