|
@@ -0,0 +1,130 @@
|
|
|
|
+package com.example.exvesta.Screans
|
|
|
|
+
|
|
|
|
+import androidx.compose.foundation.Image
|
|
|
|
+import androidx.compose.foundation.background
|
|
|
|
+import androidx.compose.foundation.layout.Column
|
|
|
|
+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.width
|
|
|
|
+import androidx.compose.foundation.shape.RoundedCornerShape
|
|
|
|
+import androidx.compose.material3.Button
|
|
|
|
+import androidx.compose.material3.ButtonDefaults
|
|
|
|
+import androidx.compose.material3.Icon
|
|
|
|
+import androidx.compose.material3.IconButton
|
|
|
|
+import androidx.compose.material3.Text
|
|
|
|
+import androidx.compose.material3.TextField
|
|
|
|
+import androidx.compose.material3.TextFieldDefaults
|
|
|
|
+import androidx.compose.runtime.Composable
|
|
|
|
+import androidx.compose.runtime.getValue
|
|
|
|
+import androidx.compose.runtime.mutableStateOf
|
|
|
|
+import androidx.compose.runtime.remember
|
|
|
|
+import androidx.compose.runtime.setValue
|
|
|
|
+import androidx.compose.ui.Alignment
|
|
|
|
+import androidx.compose.ui.Modifier
|
|
|
|
+import androidx.compose.ui.draw.clip
|
|
|
|
+import androidx.compose.ui.geometry.Offset
|
|
|
|
+import androidx.compose.ui.graphics.Brush
|
|
|
|
+import androidx.compose.ui.graphics.Color
|
|
|
|
+import androidx.compose.ui.res.painterResource
|
|
|
|
+import androidx.compose.ui.text.TextStyle
|
|
|
|
+import androidx.compose.ui.text.font.FontWeight
|
|
|
|
+import androidx.compose.ui.text.input.PasswordVisualTransformation
|
|
|
|
+import androidx.compose.ui.text.input.VisualTransformation
|
|
|
|
+import androidx.compose.ui.unit.dp
|
|
|
|
+import androidx.compose.ui.unit.sp
|
|
|
|
+import androidx.navigation.NavHostController
|
|
|
|
+
|
|
|
|
+import com.example.exvesta.R
|
|
|
|
+import com.example.exvesta.model.MainViewModel
|
|
|
|
+
|
|
|
|
+@Composable
|
|
|
|
+fun Login(navHost: NavHostController) {
|
|
|
|
+ val viewModel = MainViewModel()
|
|
|
|
+ val email = remember { mutableStateOf("") }
|
|
|
|
+ val password = remember { mutableStateOf("")}
|
|
|
|
+ val gradientButton = Brush.linearGradient(
|
|
|
|
+ colors = listOf(
|
|
|
|
+ Color(0xFF6F4A48),
|
|
|
|
+ Color(0xFFC09F9C)
|
|
|
|
+ ),
|
|
|
|
+
|
|
|
|
+ start = Offset(30.0f, 50.0f),
|
|
|
|
+ end = Offset(200.0f, 50.0f)
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ Column(
|
|
|
|
+ modifier = Modifier
|
|
|
|
+ .fillMaxSize()
|
|
|
|
+ .background(Color.White),
|
|
|
|
+// verticalArrangement = Arrangement.Center,
|
|
|
|
+ horizontalAlignment = Alignment.CenterHorizontally
|
|
|
|
+ ) {
|
|
|
|
+
|
|
|
|
+ Spacer(modifier = Modifier.height(100.dp))
|
|
|
|
+ Image(
|
|
|
|
+ painter = painterResource(id = R.drawable.back),
|
|
|
|
+ contentDescription = "Background Image",
|
|
|
|
+ modifier = Modifier
|
|
|
|
+ .fillMaxWidth()
|
|
|
|
+ .height(350.dp)
|
|
|
|
+ .clip(RoundedCornerShape(16.dp))
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+ TextField(
|
|
|
|
+ value = email.value,
|
|
|
|
+ onValueChange = { email.value = it },
|
|
|
|
+ label = { Text("Логин") },
|
|
|
|
+ modifier = Modifier.fillMaxWidth()
|
|
|
|
+ )
|
|
|
|
+ Spacer(modifier = Modifier.height(16.dp))
|
|
|
|
+ TextField(
|
|
|
|
+ value = password.value,
|
|
|
|
+ onValueChange = { password.value = it },
|
|
|
|
+ label = { Text("Пароль") },
|
|
|
|
+ modifier = Modifier
|
|
|
|
+
|
|
|
|
+ .width(350.dp)
|
|
|
|
+ .height(50.dp)
|
|
|
|
+
|
|
|
|
+ ,
|
|
|
|
+// colors = TextFieldDefaults.Colors(
|
|
|
|
+// backgroundColor = Color.White),
|
|
|
|
+// visualTransformation = PasswordVisualTransformation(),
|
|
|
|
+// shape = TextFieldDefaults.shape
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+ Spacer(modifier = Modifier.height(30.dp))
|
|
|
|
+ Button(
|
|
|
|
+ onClick = { navHost.navigate("Login") },
|
|
|
|
+ modifier = Modifier
|
|
|
|
+ .width(350.dp)
|
|
|
|
+ .height(50.dp)
|
|
|
|
+ .padding(horizontal = 20.dp)
|
|
|
|
+ .background(
|
|
|
|
+ brush = Brush.horizontalGradient(
|
|
|
|
+ colors = listOf(
|
|
|
|
+ Color(0xFF6F4A48),
|
|
|
|
+ Color(0xFFE7D2A9),
|
|
|
|
+ )
|
|
|
|
+ ), shape = ButtonDefaults.shape
|
|
|
|
+ )
|
|
|
|
+ .height(ButtonDefaults.MinHeight),
|
|
|
|
+
|
|
|
|
+ colors = ButtonDefaults.buttonColors(containerColor = Color.Transparent)
|
|
|
|
+ ) {
|
|
|
|
+ Text(
|
|
|
|
+ text = "войти",
|
|
|
|
+ fontSize = 16.sp,
|
|
|
|
+ fontWeight = FontWeight.Medium
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ Spacer(modifier = Modifier.height(16.dp))
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+}
|