Skip to content

Commit

Permalink
Merge pull request #316 from SwEnt-Group13/style/profile-edition-ui
Browse files Browse the repository at this point in the history
Style/profile edition UI
  • Loading branch information
Redd87 authored Dec 18, 2024
2 parents df69226 + 81ba5d5 commit c7a0fd7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,12 @@ fun InterestInputChip(pair: Pair<Interest, MutableState<Boolean>>, testTag: Stri
label = { Text(context.getString(pair.first.title)) },
onClick = {},
selected = pair.second.value,
modifier = Modifier.padding(3.dp).testTag(testTag),
modifier = Modifier.padding(horizontal = 3.dp).testTag(testTag),
avatar = {
Icon(
Icons.Default.Close,
contentDescription = "Add",
contentDescription =
context.getString(R.string.account_details_content_description_add),
modifier = Modifier.clickable { pair.second.value = !pair.second.value })
})
}
Expand All @@ -169,7 +170,7 @@ fun SocialInputChip(userSocial: UserSocial, onRemove: () -> Unit, testTag: Strin
label = { Text(userSocial.social.title) },
onClick = {},
selected = true,
modifier = Modifier.testTag(testTag + userSocial.social.title),
modifier = Modifier.padding(horizontal = 3.dp).testTag(testTag + userSocial.social.title),
avatar = {
Image(
modifier = Modifier.size(24.dp),
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/android/unio/ui/event/EventCard.kt
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ fun EventCardScaffold(
Column(
modifier =
Modifier.fillMaxWidth()
.padding(vertical = 8.dp)
.padding(vertical = 10.dp)
.testTag(EventCardTestTags.EVENT_ITEM)
.clip(RoundedCornerShape(10.dp))
.background(MaterialTheme.colorScheme.primaryContainer)
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/java/com/android/unio/ui/home/Home.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.android.unio.ui.home
import android.util.Log
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
Expand Down Expand Up @@ -203,7 +202,6 @@ fun EventList(
eventViewModel: EventViewModel
) {
LazyColumn(
contentPadding = PaddingValues(vertical = 8.dp),
modifier =
Modifier.fillMaxSize().padding(horizontal = 32.dp).testTag(HomeTestTags.EVENT_LIST)) {
items(events) { event -> EventCard(navigationAction, event, userViewModel, eventViewModel) }
Expand Down
10 changes: 6 additions & 4 deletions app/src/main/java/com/android/unio/ui/user/UserProfileEdition.kt
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,8 @@ private fun EditUserTextFields(
val isLastNameError = isErrors.contains(AccountDetailsError.EMPTY_LAST_NAME)

OutlinedTextField(
modifier = Modifier.padding(4.dp).testTag(UserEditionTestTags.FIRST_NAME_TEXT_FIELD),
modifier =
Modifier.padding(4.dp).fillMaxWidth().testTag(UserEditionTestTags.FIRST_NAME_TEXT_FIELD),
label = {
Row(
horizontalArrangement = Arrangement.SpaceEvenly,
Expand Down Expand Up @@ -408,7 +409,8 @@ private fun EditUserTextFields(
value = firstName)

OutlinedTextField(
modifier = Modifier.padding(4.dp).testTag(UserEditionTestTags.LAST_NAME_TEXT_FIELD),
modifier =
Modifier.padding(4.dp).fillMaxWidth().testTag(UserEditionTestTags.LAST_NAME_TEXT_FIELD),
label = {
Row(
horizontalArrangement = Arrangement.SpaceEvenly,
Expand Down Expand Up @@ -493,7 +495,7 @@ private fun InterestButtonAndFlowRow(
context.getString(R.string.account_details_content_description_add))
Text(context.getString(R.string.user_edition_edit_interests))
}
FlowRow {
FlowRow(modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.Center) {
interests.forEach { pair ->
if (pair.second.value) {
InterestInputChip(pair, testTag = UserEditionTestTags.INTERESTS_CHIP + pair.first.name)
Expand Down Expand Up @@ -529,7 +531,7 @@ private fun SocialButtonAndFlowRow(
Text(context.getString(R.string.user_edition_edit_socials))
}

FlowRow(modifier = Modifier.fillMaxWidth().padding(3.dp)) {
FlowRow(modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.Center) {
socials.forEachIndexed { index, userSocial ->
SocialInputChip(
userSocial,
Expand Down

0 comments on commit c7a0fd7

Please sign in to comment.