Skip to content

Instantly share code, notes, and snippets.

@gokmenbayram
Created July 27, 2021 07:51
Show Gist options
  • Save gokmenbayram/1c4db3ed45c739a5769df58b9a2a50ba to your computer and use it in GitHub Desktop.
Save gokmenbayram/1c4db3ed45c739a5769df58b9a2a50ba to your computer and use it in GitHub Desktop.
@Preview
@Composable
fun prepareUI() {
var username by remember { mutableStateOf("") }
var password by remember { mutableStateOf("") }
Column (
modifier = Modifier.fillMaxSize(),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
) {
Card(
shape = RoundedCornerShape(8.dp),
backgroundColor = MaterialTheme.colors.surface,
elevation = 7.dp) {
Column(
modifier = Modifier
.width(250.dp)
.height(75.dp)
.padding(5.dp),
){
Image(
painterResource(id = R.drawable.log_in),
contentDescription = "",
contentScale = ContentScale.Crop,
modifier = Modifier.fillMaxSize()
)
}
}
OutlinedTextField(
value = username,
onValueChange = { username = it },
label = {
Text("Kullanıcı Adı")
},
singleLine = true
)
OutlinedTextField(
value = password,
onValueChange = { password = it },
label = { Text("Şifre") },
singleLine = true,
visualTransformation = PasswordVisualTransformation(),
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password)
)
Button(onClick = {
Toast.makeText(Application.appContext, "Hoş geldin $username", Toast.LENGTH_LONG).show()
}, modifier = Modifier.padding(5.dp)) {
Text("Giris Yap")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment