diff --git a/android/app/src/main/java/com/created/team201/presentation/studyDetail/CustomProfileImage.kt b/android/app/src/main/java/com/created/team201/presentation/studyDetail/CustomProfileImage.kt index 9ec1e40c..7a76718e 100644 --- a/android/app/src/main/java/com/created/team201/presentation/studyDetail/CustomProfileImage.kt +++ b/android/app/src/main/java/com/created/team201/presentation/studyDetail/CustomProfileImage.kt @@ -40,19 +40,19 @@ class CustomProfileImage @JvmOverloads constructor( ).color, ), ) - Glide.with(profileImage.context) - .load(getString(R.styleable.CustomProfileImage_glideCircleImageUrl)) - .circleCrop() - .into(profileImage) + + setGlideCircleImageUrl(getString(R.styleable.CustomProfileImage_glideCircleImageUrl)) }.also { recycle() } } } - fun setGlideCircleImageUrl(image: String) { - Glide.with(profileImage.context) - .load(image) - .circleCrop() - .into(profileImage) + fun setGlideCircleImageUrl(imageUrl: String?) { + imageUrl?.let { + Glide.with(profileImage.context) + .load(imageUrl) + .circleCrop() + .into(profileImage) + } } fun setBorderProgress(successRate: Int) { diff --git a/android/app/src/main/res/drawable/bg_circle_black.xml b/android/app/src/main/res/drawable/bg_circle_black.xml new file mode 100644 index 00000000..5c735c44 --- /dev/null +++ b/android/app/src/main/res/drawable/bg_circle_black.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/android/app/src/main/res/layout/custom_profile_image.xml b/android/app/src/main/res/layout/custom_profile_image.xml index cf7fe0b7..c5fb4de2 100644 --- a/android/app/src/main/res/layout/custom_profile_image.xml +++ b/android/app/src/main/res/layout/custom_profile_image.xml @@ -23,8 +23,9 @@ android:id="@+id/iv_custom_profile_image" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_margin="4dp" android:layout_gravity="center" + android:layout_margin="4dp" + android:background="@drawable/bg_circle_black" android:contentDescription="@string/custom_profile_image_content_description" tools:src="@drawable/ic_launcher_foreground" />