ProfileScreen UI done
TODO: viewmodel
This commit is contained in:
parent
3743614b84
commit
7e6f01351d
@ -2,8 +2,11 @@ package com.nto.presentation.screens.profileScreen
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
@ -12,6 +15,8 @@ import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.icons.Icons
|
||||
@ -32,8 +37,10 @@ import androidx.compose.ui.unit.sp
|
||||
import androidx.hilt.navigation.compose.hiltViewModel
|
||||
import androidx.navigation.NavController
|
||||
import androidx.navigation.compose.rememberNavController
|
||||
import com.nto.data.models.cards.VisitCardDTO
|
||||
import com.nto.presentation.R
|
||||
import com.nto.presentation.composable.DecoratedButton
|
||||
import com.nto.presentation.composable.cards.VisitCard
|
||||
import com.nto.presentation.theme.NTOTheme
|
||||
import com.nto.presentation.theme.TextGray
|
||||
|
||||
@ -64,18 +71,65 @@ fun ProfileScreen(
|
||||
fontSize = 36.sp,
|
||||
fontWeight = FontWeight.Bold
|
||||
)
|
||||
IconButton(modifier = Modifier
|
||||
.size(40.dp)
|
||||
.clip(CircleShape)
|
||||
.background(NTOTheme.colors.buttonDisabled), onClick = {
|
||||
|
||||
}) {
|
||||
Icon(
|
||||
imageVector = Icons.AutoMirrored.Filled.ExitToApp,
|
||||
modifier = Modifier.size(30.dp),
|
||||
contentDescription = null
|
||||
)
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.size(35.dp)
|
||||
.clip(CircleShape)
|
||||
.border(2.dp, NTOTheme.colors.buttonAdmin, shape = CircleShape),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
IconButton(modifier = Modifier.size(25.dp), onClick = {
|
||||
//TODO
|
||||
}) {
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.icon_admin),
|
||||
modifier = Modifier.size(20.dp),
|
||||
contentDescription = null,
|
||||
tint = NTOTheme.colors.buttonAdmin
|
||||
)
|
||||
}
|
||||
}
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.size(35.dp)
|
||||
.clip(CircleShape)
|
||||
.border(2.dp, NTOTheme.colors.buttonDisabled, shape = CircleShape),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
IconButton(modifier = Modifier.size(25.dp), onClick = {
|
||||
//TODO
|
||||
}) {
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.icon_options),
|
||||
modifier = Modifier.size(20.dp),
|
||||
contentDescription = null,
|
||||
tint = NTOTheme.colors.buttonDisabled
|
||||
)
|
||||
}
|
||||
}
|
||||
Spacer(modifier = Modifier.width(14.dp))
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.size(35.dp)
|
||||
.clip(CircleShape)
|
||||
.background(NTOTheme.colors.buttonDisabled),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
IconButton(modifier = Modifier.size(25.dp), onClick = {
|
||||
//TODO
|
||||
}) {
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.icon_logout),
|
||||
modifier = Modifier.size(20.dp),
|
||||
contentDescription = null,
|
||||
tint = NTOTheme.colors.primaryBackground
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Spacer(modifier = Modifier.height(50.dp))
|
||||
Row(modifier = Modifier.fillMaxWidth()) {
|
||||
@ -137,6 +191,23 @@ fun ProfileScreen(
|
||||
"24 января 20:01", style = NTOTheme.typography.placeholder, fontSize = 12.sp
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.height(20.dp))
|
||||
Text(
|
||||
"Посещения",
|
||||
style = NTOTheme.typography.displaySmall,
|
||||
fontWeight = FontWeight.Bold
|
||||
)
|
||||
Spacer(modifier = Modifier.height(10.dp))
|
||||
val test = mutableListOf(
|
||||
VisitCardDTO("Кабинет 207", "id: 129008", "24 января 20:01"),
|
||||
VisitCardDTO("Кабинет 207", "id: 129008", "24 января 20:01"),
|
||||
VisitCardDTO("Кабинет 207", "id: 129008", "24 января 20:01")
|
||||
)
|
||||
LazyColumn(verticalArrangement = Arrangement.spacedBy(10.dp)) {
|
||||
items(test) { item ->
|
||||
VisitCard(item)
|
||||
}
|
||||
}
|
||||
}
|
||||
DecoratedButton(
|
||||
"Сканировать код",
|
||||
|
@ -7,8 +7,10 @@ import androidx.compose.runtime.staticCompositionLocalOf
|
||||
|
||||
val TextGray = Color(0xFFC4BBC7)
|
||||
val BoxGray = Color(0xFFF8F0FB)
|
||||
val Background = Color(0xFFFEFBFF)
|
||||
val Green = Color(0xFF738D73)
|
||||
val GreenDisabled = Color(0xFFCAD5CA)
|
||||
val Error = Color(0xFFD28989)
|
||||
|
||||
@Immutable
|
||||
data class AppColors(
|
||||
@ -20,6 +22,7 @@ data class AppColors(
|
||||
val secondaryText: Color,
|
||||
val button: Color,
|
||||
val buttonDisabled: Color,
|
||||
val buttonAdmin: Color,
|
||||
val tint: Color,
|
||||
|
||||
)
|
||||
@ -35,12 +38,13 @@ val LocalAppColors = staticCompositionLocalOf {
|
||||
secondaryText = Color.Unspecified,
|
||||
button = Color.Unspecified,
|
||||
buttonDisabled = Color.Unspecified,
|
||||
buttonAdmin = Color.Unspecified,
|
||||
tint = Color.Unspecified
|
||||
)
|
||||
}
|
||||
|
||||
val extendedColor = AppColors(
|
||||
primaryBackground = Color.White,
|
||||
primaryBackground = Background,
|
||||
secondaryBackground = Color.Black,
|
||||
inputFieldBackground = BoxGray,
|
||||
disabledText = TextGray,
|
||||
@ -48,5 +52,6 @@ val extendedColor = AppColors(
|
||||
secondaryText = Color.White,
|
||||
button = Green,
|
||||
buttonDisabled = GreenDisabled,
|
||||
buttonAdmin = Error,
|
||||
tint = Color.Black
|
||||
)
|
9
presentation/src/main/res/drawable/icon_admin.xml
Normal file
9
presentation/src/main/res/drawable/icon_admin.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="25dp"
|
||||
android:height="25dp"
|
||||
android:viewportWidth="25"
|
||||
android:viewportHeight="25">
|
||||
<path
|
||||
android:pathData="M12.279,13.302C11.273,13.302 10.424,12.957 9.734,12.266C9.043,11.576 8.698,10.727 8.698,9.721C8.698,8.715 9.043,7.866 9.734,7.176C10.424,6.485 11.273,6.14 12.279,6.14C13.285,6.14 14.134,6.485 14.824,7.176C15.515,7.866 15.861,8.715 15.861,9.721C15.861,10.727 15.515,11.576 14.824,12.266C14.134,12.957 13.285,13.302 12.279,13.302ZM12.279,11.256C12.722,11.256 13.089,11.111 13.379,10.821C13.669,10.531 13.814,10.164 13.814,9.721C13.814,9.278 13.669,8.911 13.379,8.621C13.089,8.331 12.722,8.186 12.279,8.186C11.836,8.186 11.469,8.331 11.179,8.621C10.889,8.911 10.744,9.278 10.744,9.721C10.744,10.164 10.889,10.531 11.179,10.821C11.469,11.111 11.836,11.256 12.279,11.256ZM12.279,22.512C9.909,21.915 7.952,20.555 6.408,18.431C4.865,16.308 4.093,13.95 4.093,11.358V5.116L12.279,2.047L20.465,5.116V11.358C20.465,13.95 19.693,16.308 18.15,18.431C16.607,20.555 14.65,21.915 12.279,22.512ZM12.279,4.221L6.14,6.523V11.358C6.14,12.279 6.267,13.174 6.523,14.044C6.779,14.914 7.129,15.733 7.572,16.5C8.288,16.142 9.039,15.861 9.823,15.656C10.608,15.451 11.426,15.349 12.279,15.349C13.132,15.349 13.95,15.451 14.735,15.656C15.519,15.861 16.27,16.142 16.986,16.5C17.43,15.733 17.779,14.914 18.035,14.044C18.291,13.174 18.419,12.279 18.419,11.358V6.523L12.279,4.221ZM12.279,17.395C11.665,17.395 11.068,17.464 10.488,17.6C9.909,17.736 9.354,17.924 8.826,18.163C9.32,18.674 9.857,19.118 10.437,19.493C11.017,19.868 11.631,20.158 12.279,20.363C12.927,20.158 13.541,19.868 14.121,19.493C14.701,19.118 15.238,18.674 15.733,18.163C15.204,17.924 14.65,17.736 14.07,17.6C13.49,17.464 12.893,17.395 12.279,17.395Z"
|
||||
android:fillColor="#D28989"/>
|
||||
</vector>
|
9
presentation/src/main/res/drawable/icon_logout.xml
Normal file
9
presentation/src/main/res/drawable/icon_logout.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M5,21C4.45,21 3.979,20.804 3.588,20.413C3.196,20.021 3,19.55 3,19V5C3,4.45 3.196,3.979 3.588,3.588C3.979,3.196 4.45,3 5,3H12V5H5V19H12V21H5ZM16,17L14.625,15.55L17.175,13H9V11H17.175L14.625,8.45L16,7L21,12L16,17Z"
|
||||
android:fillColor="#FEFBFF"/>
|
||||
</vector>
|
9
presentation/src/main/res/drawable/icon_options.xml
Normal file
9
presentation/src/main/res/drawable/icon_options.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="25dp"
|
||||
android:height="25dp"
|
||||
android:viewportWidth="25"
|
||||
android:viewportHeight="25">
|
||||
<path
|
||||
android:pathData="M9.25,22L8.85,18.8C8.633,18.717 8.429,18.617 8.238,18.5C8.046,18.383 7.858,18.258 7.675,18.125L4.7,19.375L1.95,14.625L4.525,12.675C4.508,12.558 4.5,12.446 4.5,12.337V11.663C4.5,11.554 4.508,11.442 4.525,11.325L1.95,9.375L4.7,4.625L7.675,5.875C7.858,5.742 8.05,5.617 8.25,5.5C8.45,5.383 8.65,5.283 8.85,5.2L9.25,2H14.75L15.15,5.2C15.367,5.283 15.571,5.383 15.762,5.5C15.954,5.617 16.142,5.742 16.325,5.875L19.3,4.625L22.05,9.375L19.475,11.325C19.492,11.442 19.5,11.554 19.5,11.663V12.337C19.5,12.446 19.483,12.558 19.45,12.675L22.025,14.625L19.275,19.375L16.325,18.125C16.142,18.258 15.95,18.383 15.75,18.5C15.55,18.617 15.35,18.717 15.15,18.8L14.75,22H9.25ZM11,20H12.975L13.325,17.35C13.842,17.217 14.321,17.021 14.762,16.763C15.204,16.504 15.608,16.192 15.975,15.825L18.45,16.85L19.425,15.15L17.275,13.525C17.358,13.292 17.417,13.046 17.45,12.788C17.483,12.529 17.5,12.267 17.5,12C17.5,11.733 17.483,11.471 17.45,11.212C17.417,10.954 17.358,10.708 17.275,10.475L19.425,8.85L18.45,7.15L15.975,8.2C15.608,7.817 15.204,7.496 14.762,7.238C14.321,6.979 13.842,6.783 13.325,6.65L13,4H11.025L10.675,6.65C10.158,6.783 9.679,6.979 9.238,7.238C8.796,7.496 8.392,7.808 8.025,8.175L5.55,7.15L4.575,8.85L6.725,10.45C6.642,10.7 6.583,10.95 6.55,11.2C6.517,11.45 6.5,11.717 6.5,12C6.5,12.267 6.517,12.525 6.55,12.775C6.583,13.025 6.642,13.275 6.725,13.525L4.575,15.15L5.55,16.85L8.025,15.8C8.392,16.183 8.796,16.504 9.238,16.763C9.679,17.021 10.158,17.217 10.675,17.35L11,20ZM12.05,15.5C13.017,15.5 13.842,15.158 14.525,14.475C15.208,13.792 15.55,12.967 15.55,12C15.55,11.033 15.208,10.208 14.525,9.525C13.842,8.842 13.017,8.5 12.05,8.5C11.067,8.5 10.238,8.842 9.563,9.525C8.888,10.208 8.55,11.033 8.55,12C8.55,12.967 8.888,13.792 9.563,14.475C10.238,15.158 11.067,15.5 12.05,15.5Z"
|
||||
android:fillColor="#CAD5CA"/>
|
||||
</vector>
|
Loading…
x
Reference in New Issue
Block a user