ProfileScreen mid-done

This commit is contained in:
Nymos 2025-02-18 20:18:03 +03:00
parent 2fdc05b7f6
commit 430eddf70f
9 changed files with 222 additions and 4 deletions

View File

@ -0,0 +1,8 @@
package com.nto.data.models.cards
data class VisitCardDTO(
val name: String = "",
val id: String,
val dateString: String,
val isCode: Boolean
)

View File

@ -1,6 +1,8 @@
package com.nto.presentation package com.nto.presentation
import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.view.WindowInsets
import androidx.activity.ComponentActivity import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge import androidx.activity.enableEdgeToEdge
@ -19,6 +21,10 @@ class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
enableEdgeToEdge() enableEdgeToEdge()
actionBar?.hide()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
window.insetsController?.hide(WindowInsets.Type.statusBars())
}
setContent { setContent {
NTOTheme { NTOTheme {
//XML SUCKS! We use Jetpack Compose btw :> //XML SUCKS! We use Jetpack Compose btw :>

View File

@ -56,7 +56,7 @@ import kotlinx.coroutines.flow.asStateFlow
class InputFieldOptions( class InputFieldOptions(
val containerColor: Color = BoxGray, val containerColor: Color = BoxGray,
val textFieldColors: TextFieldColors? = null, val textFieldColors: TextFieldColors? = null,
val paddingValues: PaddingValues = PaddingValues(start = 20.dp), val paddingValues: PaddingValues = PaddingValues(start = 10.dp),
val isConfidential: Boolean = false val isConfidential: Boolean = false
) { ) {
override fun equals(other: Any?): Boolean { override fun equals(other: Any?): Boolean {
@ -148,7 +148,7 @@ fun InputField(
} }
} else null, } else null,
visualTransformation = if (!options.isConfidential) VisualTransformation.None visualTransformation = if (!options.isConfidential) VisualTransformation.None
else if (state!!.value) PasswordVisualTransformation() else if (state!!.value) PasswordVisualTransformation('*')
else VisualTransformation.None) else VisualTransformation.None)
} }

View File

@ -0,0 +1,51 @@
package com.nto.presentation.composable.cards
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
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.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.nto.presentation.theme.NTOTheme
@Composable
fun VisitCard(modifier: Modifier = Modifier) {
Row(
modifier = modifier
.width(365.dp)
.height(70.dp)
.clip(RoundedCornerShape(10.dp))
.background(NTOTheme.colors.inputFieldBackground)
) {
Row(
modifier = Modifier
.fillMaxWidth()
.padding(start = 15.dp, end = 15.dp),
horizontalArrangement = Arrangement.SpaceBetween
) {
Column {
Text("")
Spacer(modifier = Modifier.height(15.dp))
}
Column { }
}
}
}
@Preview
@Composable
private fun VisitCardPreview() {
NTOTheme {
VisitCard()
}
}

View File

@ -83,7 +83,7 @@ fun LoginScreen(
RoundedCornerShape(topStart = 21.dp, topEnd = 21.dp) RoundedCornerShape(topStart = 21.dp, topEnd = 21.dp)
) )
.background(NTOTheme.colors.primaryBackground) .background(NTOTheme.colors.primaryBackground)
.padding(40.dp) .padding(start = 24.dp, end = 24.dp, top = 40.dp)
) { ) {
Column(modifier = Modifier.fillMaxWidth()) { Column(modifier = Modifier.fillMaxWidth()) {
Text( Text(

View File

@ -1,9 +1,161 @@
package com.nto.presentation.screens.profileScreen package com.nto.presentation.screens.profileScreen
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
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.foundation.layout.width
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ExitToApp
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.navigation.NavController
import androidx.navigation.compose.rememberNavController
import com.nto.presentation.R
import com.nto.presentation.composable.DecoratedButton
import com.nto.presentation.theme.NTOTheme
import com.nto.presentation.theme.TextGray
@Composable @Composable
fun ProfileScreen(modifier: Modifier = Modifier) { fun ProfileScreen(
navController: NavController,
modifier: Modifier = Modifier,
viewModel: ProfileViewModel = hiltViewModel<ProfileViewModel>(),
) {
Column(
modifier = modifier.background(NTOTheme.colors.primaryBackground)
) {
Column(
modifier = Modifier
.fillMaxSize()
.padding(start = 20.dp, end = 20.dp)
) {
Spacer(modifier = Modifier.height(10.dp))
Column(modifier = Modifier.weight(1f)) {
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically
) {
Text(
stringResource(R.string.title_profile),
style = NTOTheme.typography.titleLarge,
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
)
}
}
Spacer(modifier = Modifier.height(50.dp))
Row(modifier = Modifier.fillMaxWidth()) {
Image(
painter = painterResource(R.drawable.logo_placeholder_user),
modifier = Modifier
.size(100.dp)
.clip(
CircleShape
),
contentDescription = null
)
Spacer(modifier = Modifier.width(15.dp))
Column(
modifier = Modifier
.fillMaxWidth()
.clip(RoundedCornerShape(10.dp))
.background(NTOTheme.colors.inputFieldBackground)
.padding(10.dp)
) {
Text(
"Левченко",
style = NTOTheme.typography.displaySmall,
fontWeight = FontWeight.Bold
)
Text(
"Егор",
style = NTOTheme.typography.displaySmall,
fontWeight = FontWeight.Bold
)
Text(
"Ростиславович",
style = NTOTheme.typography.displaySmall,
fontWeight = FontWeight.Bold
)
Spacer(modifier = Modifier.height(10.dp))
Text(
"Senior UI/UX Designer",
style = NTOTheme.typography.placeholder,
color = TextGray
)
}
}
Spacer(modifier = Modifier.height(20.dp))
Row(
modifier = Modifier
.fillMaxWidth()
.height(35.dp)
.clip(RoundedCornerShape(10.dp))
.background(NTOTheme.colors.inputFieldBackground)
.padding(start = 15.dp, end = 15.dp),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween
) {
Text(
"Последний вход:", style = NTOTheme.typography.placeholder, fontSize = 12.sp
)
Text(
"24 января 20:01", style = NTOTheme.typography.placeholder, fontSize = 12.sp
)
}
}
DecoratedButton(
"Сканировать код",
false,
modifier = Modifier
.padding(10.dp)
.fillMaxWidth()
.height(50.dp)
) {
} }
}
}
}
@Preview
@Composable
private fun ProfileScreenPreview() {
NTOTheme {
ProfileScreen(rememberNavController(), Modifier.fillMaxSize())
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -7,4 +7,5 @@
<string name="greeting_login">Вход</string> <string name="greeting_login">Вход</string>
<string name="placholder_email" translatable="false">example@mail.com</string> <string name="placholder_email" translatable="false">example@mail.com</string>
<string name="placeholder_password" translatable="false">**********</string> <string name="placeholder_password" translatable="false">**********</string>
<string name="title_profile">Профиль</string>
</resources> </resources>