diff --git a/app/src/main/java/com/example/labwork/button_navigation/Screens.kt b/app/src/main/java/com/example/labwork/button_navigation/Screens.kt
index 2d20773..60f322b 100644
--- a/app/src/main/java/com/example/labwork/button_navigation/Screens.kt
+++ b/app/src/main/java/com/example/labwork/button_navigation/Screens.kt
@@ -1,18 +1,16 @@
package com.example.labwork.button_navigation
import androidx.compose.foundation.layout.fillMaxHeight
-import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
-import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.itemsIndexed
-import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
+import com.example.labwork.models.getItemProducts
import com.example.labwork.pages.ListInfo
import com.example.labwork.pages.ListProduct
-import com.example.labwork.models.getItemProducts
+import com.example.labwork.pages.RegisteryOrLogin
@Composable
fun ScreenInfo() {
@@ -21,12 +19,7 @@ fun ScreenInfo() {
@Composable
fun ScreenProfile() {
- Text(
- modifier = Modifier
- .fillMaxSize()
- .wrapContentHeight(),
- text = "Тут будет профиль экран..."
- )
+ RegisteryOrLogin()
}
diff --git a/app/src/main/java/com/example/labwork/button_navigation/SlideGraph.kt b/app/src/main/java/com/example/labwork/button_navigation/SlideGraph.kt
index 5588a19..24363d5 100644
--- a/app/src/main/java/com/example/labwork/button_navigation/SlideGraph.kt
+++ b/app/src/main/java/com/example/labwork/button_navigation/SlideGraph.kt
@@ -12,6 +12,7 @@ fun SlideGraph(
navHostController: NavHostController
) {
NavHost(navController = navHostController, startDestination = "Profile"){
+
composable("Profile"){
ScreenProfile()
}
diff --git a/app/src/main/java/com/example/labwork/pages/ListAuthorization.kt b/app/src/main/java/com/example/labwork/pages/ListAuthorization.kt
index c91347f..3c79668 100644
--- a/app/src/main/java/com/example/labwork/pages/ListAuthorization.kt
+++ b/app/src/main/java/com/example/labwork/pages/ListAuthorization.kt
@@ -1,4 +1,244 @@
package com.example.labwork.pages
-class ListAuthorization {
+import androidx.compose.foundation.Image
+import androidx.compose.foundation.layout.Arrangement
+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.size
+import androidx.compose.material.Button
+import androidx.compose.material.ButtonDefaults
+import androidx.compose.material.IconButton
+import androidx.compose.material.Text
+import androidx.compose.material.TextField
+import androidx.compose.material.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.graphics.Color
+import androidx.compose.ui.res.painterResource
+import androidx.compose.ui.text.TextStyle
+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.NavController
+import androidx.navigation.compose.NavHost
+import androidx.navigation.compose.composable
+import androidx.navigation.compose.rememberNavController
+import com.example.labwork.R
+import com.example.labwork.ui.theme.LightBluePolitech
+
+@Composable
+fun RegisteryOrLogin() {
+ val navController = rememberNavController()
+
+ NavHost(navController, startDestination = "login") {
+ composable("login") {
+ LoginPage(navController)
+ }
+ composable("register") {
+ RegisteryPage(navController)
+ }
+ }
+}
+@Composable
+fun LoginPage(navController: NavController) {
+ var username by remember { mutableStateOf("") }
+ var password by remember { mutableStateOf("") }
+ var showPassword by remember { mutableStateOf(false) }
+
+ Column(
+ modifier = Modifier
+ .fillMaxSize()
+ .padding(16.dp),
+ verticalArrangement = Arrangement.Center,
+ horizontalAlignment = Alignment.CenterHorizontally
+ ) {
+ Image(
+ painter = painterResource(R.drawable.logo_ulstu),
+ contentDescription = "Logo",
+ modifier = Modifier.size(200.dp)
+ )
+ Spacer(modifier = Modifier.height(16.dp))
+
+ TextField(
+ value = username,
+ onValueChange = { username = it },
+ label = { Text("Логин") },
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(horizontal = 16.dp),
+ textStyle = TextStyle(fontSize = 16.sp),
+ colors = TextFieldDefaults.textFieldColors(
+ cursorColor = LightBluePolitech,
+ backgroundColor = Color.White,
+ textColor = LightBluePolitech,
+ unfocusedLabelColor = LightBluePolitech,
+ focusedIndicatorColor = LightBluePolitech,
+ unfocusedIndicatorColor = LightBluePolitech,
+ focusedLabelColor = LightBluePolitech
+ ),
+ singleLine = true
+ )
+ Spacer(modifier = Modifier.height(8.dp))
+
+ TextField(
+ value = password,
+ onValueChange = { password = it },
+ label = { Text("Пароль") },
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(horizontal = 16.dp),
+ textStyle = TextStyle(fontSize = 16.sp),
+ colors = TextFieldDefaults.textFieldColors(
+ cursorColor = LightBluePolitech,
+ backgroundColor = Color.White,
+ textColor = LightBluePolitech,
+ unfocusedLabelColor = LightBluePolitech,
+ focusedIndicatorColor = LightBluePolitech,
+ unfocusedIndicatorColor = LightBluePolitech,
+ focusedLabelColor = LightBluePolitech
+ ),
+ singleLine = true,
+ visualTransformation = if (showPassword) VisualTransformation.None else PasswordVisualTransformation(),
+ trailingIcon = {
+ IconButton(
+ onClick = { showPassword = !showPassword }
+ ) {
+ Image(
+ painter = if(showPassword) painterResource(R.drawable.baseline_visibility) else painterResource(R.drawable.baseline_visibility_off),
+ contentDescription = "LogoVissable",
+ modifier = Modifier.size(24.dp)
+ )
+ }
+ }
+ )
+ Spacer(modifier = Modifier.height(8.dp))
+
+ Button(
+ onClick = { /* Login logic */ },
+ colors = ButtonDefaults.buttonColors(backgroundColor = LightBluePolitech, ),
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(horizontal = 16.dp)
+ ) {
+ Text(text = "Авторизоваться", color = Color.White)
+ }
+ Spacer(modifier = Modifier.height(8.dp))
+
+ Button(
+ onClick = { navController.navigate("register") },
+ colors = ButtonDefaults.buttonColors(backgroundColor = LightBluePolitech),
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(horizontal = 16.dp)
+ ) {
+ Text(text = "Регистрация", color = Color.White)
+ }
+ }
+}
+
+@Composable
+fun RegisteryPage(navController: NavController) {
+ var username by remember { mutableStateOf("") }
+ var password by remember { mutableStateOf("") }
+ var confirmPassword by remember { mutableStateOf("") }
+
+ Column(
+ modifier = Modifier
+ .fillMaxSize()
+ .padding(16.dp),
+ verticalArrangement = Arrangement.Center,
+ horizontalAlignment = Alignment.CenterHorizontally
+ ) {
+ Image(
+ painter = painterResource(R.drawable.logo_ulstu),
+ contentDescription = "Logo",
+ modifier = Modifier.size(200.dp)
+ )
+ Spacer(modifier = Modifier.height(16.dp))
+
+ TextField(
+ value = username,
+ onValueChange = { username = it },
+ label = { Text("Логин") },
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(horizontal = 16.dp),
+ textStyle = TextStyle(fontSize = 16.sp),
+ colors = TextFieldDefaults.textFieldColors(
+ cursorColor = LightBluePolitech,
+ backgroundColor = Color.White,
+ textColor = LightBluePolitech,
+ unfocusedLabelColor = LightBluePolitech,
+ focusedIndicatorColor = LightBluePolitech,
+ unfocusedIndicatorColor = LightBluePolitech,
+ focusedLabelColor = LightBluePolitech
+ ),
+ singleLine = true
+ )
+ Spacer(modifier = Modifier.height(8.dp))
+
+ TextField(
+ value = password,
+ onValueChange = { password = it },
+ label = { Text("Пароль") },
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(horizontal = 16.dp),
+ textStyle = TextStyle(fontSize = 16.sp),
+ colors = TextFieldDefaults.textFieldColors(
+ backgroundColor = Color.White,
+ textColor = LightBluePolitech,
+ unfocusedLabelColor = LightBluePolitech,
+ focusedIndicatorColor = LightBluePolitech,
+ unfocusedIndicatorColor = LightBluePolitech,
+ focusedLabelColor = LightBluePolitech
+ ),
+ singleLine = true,
+ visualTransformation = PasswordVisualTransformation()
+ )
+ Spacer(modifier = Modifier.height(8.dp))
+
+ TextField(
+ value = confirmPassword,
+ onValueChange = { confirmPassword = it },
+ label = { Text("Подтвердите пароль") },
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(horizontal = 16.dp),
+ textStyle = TextStyle(fontSize = 16.sp),
+ colors = TextFieldDefaults.textFieldColors(
+ backgroundColor = Color.White,
+ textColor = LightBluePolitech,
+ unfocusedLabelColor = LightBluePolitech,
+ focusedIndicatorColor = LightBluePolitech,
+ unfocusedIndicatorColor = LightBluePolitech,
+ focusedLabelColor = LightBluePolitech
+ ),
+ singleLine = true,
+ visualTransformation = PasswordVisualTransformation()
+ )
+ Spacer(modifier = Modifier.height(8.dp))
+
+ Button(
+ onClick = { /* Register logic */ },
+ colors = ButtonDefaults.buttonColors(backgroundColor = LightBluePolitech),
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(horizontal = 16.dp)
+ ) {
+ Text(text = "Зарегистрироваться", color = Color.White)
+ }
+ Spacer(modifier = Modifier.height(8.dp))
+
+ }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/labwork/ui/theme/Theme.kt b/app/src/main/java/com/example/labwork/ui/theme/Theme.kt
index e76b34b..4d25afd 100644
--- a/app/src/main/java/com/example/labwork/ui/theme/Theme.kt
+++ b/app/src/main/java/com/example/labwork/ui/theme/Theme.kt
@@ -22,9 +22,9 @@ private val DarkColorScheme = darkColorScheme(
)
private val LightColorScheme = lightColorScheme(
- primary = Purple40,
+ primary = DarkBluePolitech,
secondary = PurpleGrey40,
- tertiary = Pink40
+ tertiary = LightBluePolitech
/* Other default colors to override
background = Color(0xFFFFFBFE),
diff --git a/app/src/main/res/drawable/baseline_visibility.xml b/app/src/main/res/drawable/baseline_visibility.xml
new file mode 100644
index 0000000..b923c39
--- /dev/null
+++ b/app/src/main/res/drawable/baseline_visibility.xml
@@ -0,0 +1,5 @@
+
+
+
diff --git a/app/src/main/res/drawable/baseline_visibility_off.xml b/app/src/main/res/drawable/baseline_visibility_off.xml
new file mode 100644
index 0000000..00c8a20
--- /dev/null
+++ b/app/src/main/res/drawable/baseline_visibility_off.xml
@@ -0,0 +1,5 @@
+
+
+