Skip to content

Commit

Permalink
fix: Update minor UI changes on Profile
Browse files Browse the repository at this point in the history
- Update the profile avatar
- update warning icon on delete account dialog

LEARNER-10081
  • Loading branch information
omerhabib26 committed Aug 16, 2024
1 parent dd757fe commit cebe95a
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 111 deletions.
9 changes: 9 additions & 0 deletions core/src/main/res/drawable/core_ic_profile_avatar.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="64"
android:viewportHeight="64">
<path
android:fillColor="#00262B"
android:pathData="M32,32C37.893,32 42.667,27.227 42.667,21.334C42.667,15.44 37.893,10.667 32,10.667C26.107,10.667 21.333,15.44 21.333,21.334C21.333,27.227 26.107,32 32,32ZM32,37.334C24.88,37.334 10.667,40.907 10.667,48V53.333H53.333V48C53.333,40.907 39.12,37.334 32,37.334Z" />
</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ fun DeleteProfileScreen(
modifier = Modifier
.size(145.dp)
.align(Alignment.CenterHorizontally),
painter = painterResource(id = profileR.drawable.profile_delete_box),
painter = painterResource(id = profileR.drawable.profile_ic_warning),
contentDescription = null,
)
Spacer(Modifier.height(32.dp))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,11 @@ private fun EditProfileScreen(
}

else -> {
coreR.drawable.core_ic_default_profile_picture
coreR.drawable.core_ic_profile_avatar
}
}
} else {
coreR.drawable.core_ic_default_profile_picture
coreR.drawable.core_ic_profile_avatar
}

val modalListState = rememberLazyListState()
Expand Down Expand Up @@ -617,8 +617,8 @@ private fun EditProfileScreen(
AsyncImage(
model = ImageRequest.Builder(LocalContext.current)
.data(imageRes)
.error(coreR.drawable.core_ic_default_profile_picture)
.placeholder(coreR.drawable.core_ic_default_profile_picture)
.error(coreR.drawable.core_ic_profile_avatar)
.placeholder(coreR.drawable.core_ic_profile_avatar)
.build(),
contentScale = ContentScale.Crop,
contentDescription = stringResource(
Expand All @@ -632,6 +632,7 @@ private fun EditProfileScreen(
MaterialTheme.appColors.onSurface,
CircleShape
)
.background(Color.White, CircleShape)
.padding(2.dp)
.size(100.dp)
.clip(CircleShape)
Expand Down Expand Up @@ -1396,7 +1397,7 @@ private fun EditProfileScreenTabletPreview() {
private val mockAccount = Account(
username = "thom84",
bio = "designer",
requiresParentalConsent = true,
requiresParentalConsent = false,
name = "Thomas",
country = "Ukraine",
isActive = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ internal fun ManageAccountView(
borderColor = MaterialTheme.appColors.primaryButtonBorderedText,
textColor = MaterialTheme.appColors.primaryButtonBorderedText
)
Spacer(modifier = Modifier.height(12.dp))
IconText(
text = stringResource(id = ProfileR.string.profile_delete_profile),
painter = painterResource(id = ProfileR.drawable.profile_ic_trash),
Expand All @@ -186,7 +185,6 @@ internal fun ManageAccountView(
onClick = {
onAction(ManageAccountViewAction.DeleteAccount)
})
Spacer(modifier = Modifier.height(12.dp))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ fun ProfileTopic(image: String, title: String, subtitle: String) {
AsyncImage(
model = ImageRequest.Builder(LocalContext.current)
.data(image)
.error(R.drawable.core_ic_default_profile_picture)
.placeholder(R.drawable.core_ic_default_profile_picture)
.error(R.drawable.core_ic_profile_avatar)
.placeholder(R.drawable.core_ic_profile_avatar)
.build(),
contentDescription = stringResource(
id = R.string.core_accessibility_user_profile_image,
title
),
modifier = Modifier
.testTag("img_profile")
.size(80.dp)
.size(60.dp)
.clip(CircleShape)
)
Spacer(modifier = Modifier.width(12.dp))
Expand Down
50 changes: 0 additions & 50 deletions profile/src/main/res/drawable-night/profile_delete_box.xml

This file was deleted.

50 changes: 0 additions & 50 deletions profile/src/main/res/drawable/profile_delete_box.xml

This file was deleted.

12 changes: 12 additions & 0 deletions profile/src/main/res/drawable/profile_ic_warning.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="144dp"
android:height="144dp"
android:viewportWidth="144"
android:viewportHeight="144">
<path
android:fillColor="#1F453D"
android:pathData="M72,72m-71.11,0a71.11,71.11 0,1 1,142.22 0a71.11,71.11 0,1 1,-142.22 0" />
<path
android:fillColor="#ffffff"
android:pathData="M34.46,100.15C33.72,100.15 33.05,99.97 32.46,99.6C31.87,99.24 31.41,98.76 31.09,98.17C30.74,97.58 30.56,96.94 30.52,96.26C30.49,95.57 30.67,94.89 31.08,94.22L68.55,29.53C68.96,28.86 69.47,28.36 70.08,28.04C70.68,27.72 71.33,27.56 72,27.56C72.67,27.56 73.31,27.72 73.92,28.04C74.53,28.36 75.04,28.86 75.44,29.53L112.92,94.22C113.33,94.89 113.51,95.57 113.48,96.26C113.44,96.94 113.25,97.58 112.91,98.17C112.59,98.76 112.13,99.24 111.54,99.6C110.94,99.97 110.28,100.15 109.54,100.15H34.46ZM38.95,93.59H105.05L72,36.72L38.95,93.59ZM72,88.37C73,88.37 73.84,88.03 74.52,87.36C75.2,86.68 75.54,85.84 75.54,84.84C75.54,83.84 75.2,83 74.52,82.32C73.84,81.64 73,81.31 72,81.31C71,81.31 70.16,81.64 69.48,82.32C68.8,83 68.46,83.84 68.46,84.84C68.46,85.84 68.8,86.68 69.48,87.36C70.16,88.03 71,88.37 72,88.37ZM72,76.93C72.93,76.93 73.71,76.62 74.34,75.99C74.97,75.36 75.28,74.58 75.28,73.65V58.34C75.28,57.41 74.97,56.63 74.34,56C73.71,55.38 72.93,55.06 72,55.06C71.07,55.06 70.29,55.38 69.66,56C69.03,56.63 68.72,57.41 68.72,58.34V73.65C68.72,74.58 69.03,75.36 69.66,75.99C70.29,76.62 71.07,76.93 72,76.93Z" />
</vector>

0 comments on commit cebe95a

Please sign in to comment.