commit
91fbbf26eb
@ -0,0 +1,116 @@
|
||||
package sae.android.sae_2a.view
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
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.layout.wrapContentWidth
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.OutlinedTextField
|
||||
import androidx.compose.material3.Text
|
||||
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.BlendMode.Companion.Color
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.input.PasswordVisualTransformation
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import sae.android.sae_2a.R
|
||||
import sae.android.sae_2a.VM.LoginViewModel
|
||||
import sae.android.sae_2a.data.LoginRepository
|
||||
import sae.android.sae_2a.data.LoginResponseParser
|
||||
|
||||
@Composable
|
||||
@Preview
|
||||
fun accountInfo() {
|
||||
|
||||
var username by remember { mutableStateOf("") }
|
||||
var role by remember { mutableStateOf("") }
|
||||
var login = LoginViewModel(LoginRepository(LoginResponseParser())).login("")
|
||||
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.fillMaxWidth()
|
||||
.fillMaxHeight()
|
||||
.background(Color(157, 134, 146)),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.Center
|
||||
) {
|
||||
|
||||
Text(
|
||||
text = stringResource(id = R.string.accountDetails), fontSize = 40.sp,
|
||||
fontFamily = FontFamily.Serif,
|
||||
modifier = Modifier
|
||||
.padding(bottom = 20.dp)
|
||||
)
|
||||
OutlinedTextField(
|
||||
value = username,
|
||||
onValueChange = { username = it },
|
||||
label = { Text(stringResource(id =R.string.name)) },
|
||||
modifier = Modifier
|
||||
.padding(bottom = 10.dp)
|
||||
)
|
||||
|
||||
OutlinedTextField(
|
||||
value = role,
|
||||
onValueChange = { role = it },
|
||||
label = { Text(stringResource(id =R.string.surname)) },
|
||||
modifier = Modifier
|
||||
.padding(bottom = 10.dp)
|
||||
)
|
||||
|
||||
|
||||
OutlinedTextField(
|
||||
value = role,
|
||||
onValueChange = { role = it },
|
||||
label = { Text(stringResource(id =R.string.username)) },
|
||||
modifier = Modifier
|
||||
.padding(bottom = 10.dp)
|
||||
)
|
||||
|
||||
OutlinedTextField(
|
||||
value = role,
|
||||
onValueChange = { role = it },
|
||||
label = { Text(stringResource(id =R.string.email)) },
|
||||
modifier = Modifier
|
||||
.padding(bottom = 10.dp)
|
||||
)
|
||||
|
||||
|
||||
OutlinedTextField(
|
||||
value = role,
|
||||
onValueChange = { role = it },
|
||||
label = { Text(stringResource(id =R.string.role)) },
|
||||
modifier = Modifier
|
||||
.padding(bottom = 26.dp)
|
||||
)
|
||||
|
||||
Button(
|
||||
onClick = {/* TODO */ },
|
||||
modifier = Modifier
|
||||
.width(300.dp)
|
||||
.height(50.dp)
|
||||
) {
|
||||
Text(stringResource(id = R.string.valider), fontSize = 20.sp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
IL fAUDRA LINK API POUR METTRE LEUR VRAI NOM A LA PLACE DE "NOM"
|
||||
+ VERIF SI LE USERNAME EXISTE DEJA ECT
|
||||
*/
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 10 KiB |
Loading…
Reference in new issue