android
Antoine JOURDAIN 1 year ago
commit 91fbbf26eb

@ -41,7 +41,7 @@ fun GameScreen(NavigateToApp: () -> Unit ){
.wrapContentHeight(align = Alignment.CenterVertically)
.fillMaxSize(),) {
Column( modifier = Modifier
.background(color = Color.LightGray)
.background(Color(157, 134, 146))
.wrapContentWidth(align = Alignment.CenterHorizontally)) {
Text(text = "Games", fontSize = 32.sp ,modifier = Modifier

@ -58,7 +58,7 @@ fun MyApp() {
items.forEach { screen ->
BottomNavigationItem(
modifier = Modifier
.background(Color.Gray),
.background(Color(157, 134, 146)),
label = { Text(stringResource(screen.resourceId)) },
selected = currentDestination?.hierarchy?.any { it.route == screen.route } == true,
onClick = {

@ -41,7 +41,7 @@ fun RegisterScreen(NavigateToApp: () -> Unit ) {
.wrapContentHeight(align = Alignment.CenterVertically)
.fillMaxSize(),) {
Column(modifier = Modifier
.background(color = Color.White)
.background(Color(157, 134, 146))
.wrapContentWidth(align = Alignment.CenterHorizontally)) {
Image(

@ -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
*/

@ -5,6 +5,7 @@ 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.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
@ -14,27 +15,37 @@ import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
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.Color
import androidx.compose.ui.modifier.modifierLocalConsumer
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.text.style.TextAlign
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
@Preview
@Composable
fun profileScreen() {
Column( modifier = Modifier
.background(color = Color.Gray)
.background(Color(157, 134, 146))
.wrapContentWidth(align = Alignment.Start)) {
Image(
painter = painterResource(id = R.drawable.noprofilepicture),
@ -46,7 +57,7 @@ fun profileScreen() {
.size(width = 200.dp, height = 200.dp)
)
Text(text = stringResource(id = R.string.profilePicture), color = Color.White, fontSize = 30.sp, fontWeight = FontWeight(1000) , modifier = Modifier
Text(text = stringResource(id = R.string.profilePicture), color = Color.Black, fontSize = 30.sp, fontWeight = FontWeight(1000) , modifier = Modifier
.padding(bottom = 15.dp)
.wrapContentHeight(align = Alignment.Top)
.wrapContentWidth(align = Alignment.CenterHorizontally)
@ -58,44 +69,109 @@ fun profileScreen() {
.width(500.dp)
.height(80.dp)) {
Row(
modifier = Modifier.padding(5.dp),
horizontalArrangement = Arrangement.spacedBy(18.dp)
){
Image(painter = painterResource(id = R.drawable.infoaccount), contentDescription = "home",
modifier = Modifier
.padding(15.dp)
.fillMaxWidth(),
horizontalArrangement = Arrangement.Start,
verticalAlignment = Alignment.CenterVertically
) {
Image(
painter = painterResource(id = R.drawable.home),
contentDescription = "home",
modifier = Modifier.size(60.dp)
)
Text(
text = stringResource(id = R.string.home),
fontSize = 20.sp,
textAlign = TextAlign.Center,
modifier = Modifier
.fillMaxWidth()
.padding(end = 55.dp)
)
Text(text = stringResource(id = R.string.home), fontSize = 20.sp)
}
}
Button( onClick = { }, modifier = Modifier
.padding(3.dp)
.width(500.dp)
.height(80.dp)
.align(alignment = Alignment.CenterHorizontally)) {
Text(text = stringResource(id = R.string.accountDetails), fontSize = 20.sp)
.height(80.dp)) {
Row(
modifier = Modifier
.padding(15.dp)
.fillMaxWidth(),
horizontalArrangement = Arrangement.Start,
verticalAlignment = Alignment.CenterVertically
) {
Image(
painter = painterResource(id = R.drawable.infoaccount),
contentDescription = "home",
modifier = Modifier.size(60.dp)
)
Text(
text = stringResource(id = R.string.accountDetails),
fontSize = 20.sp,
textAlign = TextAlign.Center,
modifier = Modifier
.fillMaxWidth()
.padding(end = 55.dp)
)
}
}
Button( onClick = { }, modifier = Modifier
.padding(3.dp)
.width(500.dp)
.height(80.dp)
.align(alignment = Alignment.CenterHorizontally)) {
Text(text = stringResource(id = R.string.changepswd), fontSize = 20.sp)
.height(80.dp)) {
Row(
modifier = Modifier
.padding(15.dp)
.fillMaxWidth(),
horizontalArrangement = Arrangement.Start,
verticalAlignment = Alignment.CenterVertically
) {
Image(
painter = painterResource(id = R.drawable.password),
contentDescription = "home",
modifier = Modifier.size(60.dp)
)
Text(
text = stringResource(id = R.string.changepswd),
fontSize = 20.sp,
textAlign = TextAlign.Center,
modifier = Modifier
.fillMaxWidth()
.padding(end = 55.dp)
)
}
}
Button( onClick = { }, modifier = Modifier
.padding(3.dp)
.width(500.dp)
.height(80.dp)
.align(alignment = Alignment.CenterHorizontally)) {
Text(text = stringResource(id = R.string.logOut), fontSize = 20.sp)
.height(80.dp)) {
Row(
modifier = Modifier
.padding(15.dp)
.fillMaxWidth(),
horizontalArrangement = Arrangement.Start,
verticalAlignment = Alignment.CenterVertically
) {
Image(
painter = painterResource(id = R.drawable.logout),
contentDescription = "home",
modifier = Modifier.size(60.dp)
)
Text(
text = stringResource(id = R.string.logOut),
fontSize = 20.sp,
textAlign = TextAlign.Center,
modifier = Modifier
.fillMaxWidth()
.padding(end = 55.dp)
)
}
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 10 KiB

@ -17,4 +17,8 @@
<string name="changepswd">Change Password</string>
<string name="voc_list_title">Vocabulary lists</string>
<string name="add_voc">New list</string>
<string name="valider">Valider</string>
<string name="role">Rôle</string>
<string name="username">Username</string>
<string name="email">E-mail</string>
</resources>
Loading…
Cancel
Save