From 6f4cfe2089e9471d6fd32f44b08a0b32dd0c6fc2 Mon Sep 17 00:00:00 2001 From: "lge6716@gmail.com" Date: Tue, 9 Jan 2024 03:27:25 +0900 Subject: [PATCH 01/12] =?UTF-8?q?feat:=20=ED=94=84=EB=A1=9C=ED=95=84=20?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=20=EC=97=94=ED=84=B0=ED=8B=B0=EC=97=90=20?= =?UTF-8?q?=ED=91=B8=EC=8B=9C=20=EC=95=8C=EB=A6=BC=20=EB=8F=99=EC=9D=98=20?= =?UTF-8?q?=EC=97=AC=EB=B6=80=20=EB=B3=80=EC=88=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GetUserProfileResponse 파일에 pushAgreement 추가 --- .../meongcare/home/model/entities/GetUserProfileResponse.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/com/project/meongcare/home/model/entities/GetUserProfileResponse.kt b/app/src/main/java/com/project/meongcare/home/model/entities/GetUserProfileResponse.kt index 9177d85ac..75ad7a0a2 100644 --- a/app/src/main/java/com/project/meongcare/home/model/entities/GetUserProfileResponse.kt +++ b/app/src/main/java/com/project/meongcare/home/model/entities/GetUserProfileResponse.kt @@ -3,4 +3,5 @@ package com.project.meongcare.home.model.entities data class GetUserProfileResponse( val email: String, val imageUrl: String, + val pushAgreement: Boolean, ) From de6420170fd053c4266c776bbc8060bdfa832f8b Mon Sep 17 00:00:00 2001 From: "lge6716@gmail.com" Date: Tue, 9 Jan 2024 03:30:02 +0900 Subject: [PATCH 02/12] =?UTF-8?q?feat:=20=ED=94=84=EB=A1=9C=ED=95=84=20?= =?UTF-8?q?=ED=99=94=EB=A9=B4=EC=97=90=EC=84=9C=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=ED=99=94=EB=A9=B4=EC=9C=BC=EB=A1=9C=20=EC=9D=B4=EB=8F=99?= =?UTF-8?q?=ED=95=A0=20=EB=95=8C=20bundle=20=EA=B0=9D=EC=B2=B4=20=EC=A0=84?= =?UTF-8?q?=EB=8B=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bundle 객체에 사용자 푸시 알림 동의 여부 담아서 전달 --- .../java/com/project/meongcare/info/view/ProfileFragment.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/project/meongcare/info/view/ProfileFragment.kt b/app/src/main/java/com/project/meongcare/info/view/ProfileFragment.kt index 8a818f0eb..1933ccee3 100644 --- a/app/src/main/java/com/project/meongcare/info/view/ProfileFragment.kt +++ b/app/src/main/java/com/project/meongcare/info/view/ProfileFragment.kt @@ -108,7 +108,9 @@ class ProfileFragment : Fragment(), PhotoMenuListener { } buttonProfileSetting.setOnClickListener { - findNavController().navigate(R.id.action_profileFragment_to_settingFragment) + val bundle = Bundle() + bundle.putBoolean("pushAgreement", profileViewModel.userProfile.value?.pushAgreement!!) + findNavController().navigate(R.id.action_profileFragment_to_settingFragment, bundle) } buttonProfileLogout.setOnClickListener { From eb3bd2dec248f582ace344adccd18d7fcb575eb2 Mon Sep 17 00:00:00 2001 From: "lge6716@gmail.com" Date: Tue, 9 Jan 2024 03:47:43 +0900 Subject: [PATCH 03/12] =?UTF-8?q?feat:=20=EC=82=AC=EC=9A=A9=EC=9E=90?= =?UTF-8?q?=EC=9D=98=20=ED=91=B8=EC=8B=9C=20=EC=95=8C=EB=A6=BC=20=EC=88=98?= =?UTF-8?q?=EC=8B=A0=20=EC=97=AC=EB=B6=80=20switch=EC=97=90=20=EC=B4=88?= =?UTF-8?q?=EA=B8=B0=20=EC=85=8B=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/project/meongcare/info/view/SettingFragment.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/com/project/meongcare/info/view/SettingFragment.kt b/app/src/main/java/com/project/meongcare/info/view/SettingFragment.kt index d6e2b5492..ba161aba9 100644 --- a/app/src/main/java/com/project/meongcare/info/view/SettingFragment.kt +++ b/app/src/main/java/com/project/meongcare/info/view/SettingFragment.kt @@ -52,7 +52,12 @@ class SettingFragment : Fragment() { } val accessToken = "" + val pushAgreement = arguments?.getBoolean("pushAgreement")!! binding.run { + switchSettingNotification.run { + isChecked = pushAgreement + } + imagebuttonSettingBack.setOnClickListener { findNavController().popBackStack() } From 4c545c3f63e2f751805a3aed505ac5203a89a7ca Mon Sep 17 00:00:00 2001 From: "lge6716@gmail.com" Date: Tue, 9 Jan 2024 04:54:57 +0900 Subject: [PATCH 04/12] =?UTF-8?q?design:=20=EC=82=AC=EC=A7=84=20=EC=84=A0?= =?UTF-8?q?=ED=83=9D=20=EB=B0=94=ED=85=80=EC=8B=9C=ED=8A=B8=EC=97=90=20?= =?UTF-8?q?=EA=B8=B0=EB=B3=B8=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EB=A9=94?= =?UTF-8?q?=EB=89=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - visibility GONE으로 설정 --- .../fragment_photo_select_bottom_sheet.xml | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/layout/fragment_photo_select_bottom_sheet.xml b/app/src/main/res/layout/fragment_photo_select_bottom_sheet.xml index 8360a8f34..8362bb6da 100644 --- a/app/src/main/res/layout/fragment_photo_select_bottom_sheet.xml +++ b/app/src/main/res/layout/fragment_photo_select_bottom_sheet.xml @@ -4,7 +4,8 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - tools:context=".onboarding.view.PhotoSelectBottomSheetFragment" > + android:paddingBottom="30dp" + tools:context=".onboarding.view.PhotoSelectBottomSheetFragment"> + + + + \ No newline at end of file From 29a8bbe8e46149bc53ed885db411b682844a220a Mon Sep 17 00:00:00 2001 From: "lge6716@gmail.com" Date: Tue, 9 Jan 2024 11:15:45 +0900 Subject: [PATCH 05/12] =?UTF-8?q?feat:=20=EC=82=AC=EC=A7=84=20=EC=84=A0?= =?UTF-8?q?=ED=83=9D=20bottom=20sheet=EC=97=90=EC=84=9C=20=EA=B8=B0?= =?UTF-8?q?=EB=B3=B8=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?=EB=A9=94=EB=89=B4=20=EA=B8=B0=EB=8A=A5=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 이미지 있을 때만 기본 이미지 메뉴 표시하는 부분 추후 반영 - 기본 이미지 리소스 decode 시 나타나는 unimplemented 메시지 추후 해결 --- .../UserProfileSelectBottomSheetFragment.kt | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/app/src/main/java/com/project/meongcare/info/view/UserProfileSelectBottomSheetFragment.kt b/app/src/main/java/com/project/meongcare/info/view/UserProfileSelectBottomSheetFragment.kt index a7de546d0..83450c078 100644 --- a/app/src/main/java/com/project/meongcare/info/view/UserProfileSelectBottomSheetFragment.kt +++ b/app/src/main/java/com/project/meongcare/info/view/UserProfileSelectBottomSheetFragment.kt @@ -1,6 +1,7 @@ package com.project.meongcare.info.view import android.app.Activity +import android.content.ContentResolver import android.content.Context import android.content.Intent import android.net.Uri @@ -14,6 +15,7 @@ import androidx.activity.result.contract.ActivityResultContracts import androidx.core.content.FileProvider import com.google.android.material.bottomsheet.BottomSheetDialogFragment import com.project.meongcare.MainActivity +import com.project.meongcare.R import com.project.meongcare.databinding.FragmentPhotoSelectBottomSheetBinding import com.project.meongcare.onboarding.model.data.local.PhotoMenuListener import java.io.File @@ -36,12 +38,17 @@ class UserProfileSelectBottomSheetFragment : BottomSheetDialogFragment() { mainActivity = activity as MainActivity binding.run { + divider2.visibility = View.VISIBLE + textviewSelectDefault.visibility = View.VISIBLE textviewSelectCamera.setOnClickListener { executeCamera(mainActivity) } textviewSelectAlbum.setOnClickListener { executeAlbum() } + textviewSelectDefault.setOnClickListener { + setDefaultImage() + } } return binding.root @@ -106,6 +113,19 @@ class UserProfileSelectBottomSheetFragment : BottomSheetDialogFragment() { albumLauncher.launch(intent) } + private fun setDefaultImage() { + val defaultImageUri = requireContext().resources.let { resources -> + Uri.Builder() + .scheme(ContentResolver.SCHEME_ANDROID_RESOURCE) + .authority(resources.getResourcePackageName(R.drawable.profile_default_image)) + .appendPath(resources.getResourceTypeName(R.drawable.profile_default_image)) + .appendPath(resources.getResourceEntryName(R.drawable.profile_default_image)) + .build() + } + sendUri(defaultImageUri) + dismiss() + } + private fun sendUri(uri: Uri) { photoMenuListener?.onUriPassed(uri) } From 7a0f712881d9da59b2cfba0333bcf0da77508031 Mon Sep 17 00:00:00 2001 From: "lge6716@gmail.com" Date: Tue, 9 Jan 2024 11:43:11 +0900 Subject: [PATCH 06/12] =?UTF-8?q?refactor:=20SettingFragment=EC=9D=98=20ma?= =?UTF-8?q?keSnackBar=20=ED=95=A8=EC=88=98=20public=20=EB=A9=94=EC=84=9C?= =?UTF-8?q?=EB=93=9C=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../meongcare/info/view/SettingFragment.kt | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/app/src/main/java/com/project/meongcare/info/view/SettingFragment.kt b/app/src/main/java/com/project/meongcare/info/view/SettingFragment.kt index ba161aba9..d200c7da4 100644 --- a/app/src/main/java/com/project/meongcare/info/view/SettingFragment.kt +++ b/app/src/main/java/com/project/meongcare/info/view/SettingFragment.kt @@ -1,5 +1,6 @@ package com.project.meongcare.info.view +import android.content.Context import android.os.Bundle import android.view.Gravity import android.view.LayoutInflater @@ -45,8 +46,8 @@ class SettingFragment : Fragment() { settingViewModel.patchPushResponse.observe(viewLifecycleOwner) { response -> if (response == 200) { when (binding.switchSettingNotification.isChecked) { - true -> makeSnackBar("알림 수신 처리되었습니다.") - false -> makeSnackBar("알림 거부 처리되었습니다.") + true -> makeSnackBar(binding.root, requireContext(), "알림 수신 처리되었습니다.") + false -> makeSnackBar(binding.root, requireContext(), "알림 거부 처리되었습니다.") } } } @@ -92,29 +93,29 @@ class SettingFragment : Fragment() { return binding.root } +} - fun makeSnackBar(message: String) { - val snackBar = Snackbar.make(binding.root, message, Snackbar.LENGTH_SHORT) - val snackBarLayout = snackBar.view as Snackbar.SnackbarLayout +fun makeSnackBar(view: View, context: Context, message: String) { + val snackBar = Snackbar.make(view, message, Snackbar.LENGTH_SHORT) + val snackBarLayout = snackBar.view as Snackbar.SnackbarLayout - val imageView = ImageView(context) - imageView.setImageResource(R.drawable.all_snack_bar_complete) - val imageViewStartPadding = resources.getDimensionPixelSize(R.dimen.snackbar_image_start_padding) - imageView.setPadding(imageViewStartPadding, 0, 0, 0) + val imageView = ImageView(context) + imageView.setImageResource(R.drawable.all_snack_bar_complete) + val imageViewStartPadding = context.resources.getDimensionPixelSize(R.dimen.snackbar_image_start_padding) + imageView.setPadding(imageViewStartPadding, 0, 0, 0) - val params = - LinearLayout.LayoutParams( - LinearLayout.LayoutParams.WRAP_CONTENT, - LinearLayout.LayoutParams.MATCH_PARENT, - ) - params.gravity = Gravity.CENTER_VERTICAL or Gravity.START - snackBarLayout.addView(imageView, 0, params) + val params = + LinearLayout.LayoutParams( + LinearLayout.LayoutParams.WRAP_CONTENT, + LinearLayout.LayoutParams.MATCH_PARENT, + ) + params.gravity = Gravity.CENTER_VERTICAL or Gravity.START + snackBarLayout.addView(imageView, 0, params) - val textView = snackBarLayout.findViewById(com.google.android.material.R.id.snackbar_text) + val textView = snackBarLayout.findViewById(com.google.android.material.R.id.snackbar_text) - val textViewStartPadding = resources.getDimensionPixelSize(R.dimen.snackbar_text_start_padding) - textView.setPadding(textViewStartPadding, 0, 0, 0) + val textViewStartPadding = context.resources.getDimensionPixelSize(R.dimen.snackbar_text_start_padding) + textView.setPadding(textViewStartPadding, 0, 0, 0) - snackBar.show() - } + snackBar.show() } From f635320bcc0090942e554842a2d8bab1313bb2c6 Mon Sep 17 00:00:00 2001 From: "lge6716@gmail.com" Date: Tue, 9 Jan 2024 11:43:57 +0900 Subject: [PATCH 07/12] =?UTF-8?q?feat:=20=ED=94=84=EB=A1=9C=ED=95=84=20?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EB=B3=80=EA=B2=BD=EC=9D=84=20?= =?UTF-8?q?=EC=9C=84=ED=95=9C=20PATCH=20api=20=ED=86=B5=EC=8B=A0=20?= =?UTF-8?q?=EB=AA=A8=EB=93=88=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../info/model/data/remote/ProfileApi.kt | 7 +++++++ .../model/data/repository/ProfileRepository.kt | 5 +++++ .../data/repository/ProfileRepositoryImpl.kt | 16 ++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/app/src/main/java/com/project/meongcare/info/model/data/remote/ProfileApi.kt b/app/src/main/java/com/project/meongcare/info/model/data/remote/ProfileApi.kt index dace3415d..e1eb89802 100644 --- a/app/src/main/java/com/project/meongcare/info/model/data/remote/ProfileApi.kt +++ b/app/src/main/java/com/project/meongcare/info/model/data/remote/ProfileApi.kt @@ -63,4 +63,11 @@ interface ProfileApi { @Query("pushAgreement") pushAgreement: Boolean, @Header("AccessToken") accessToken: String, ): Response + + @Multipart + @PATCH("member/profile") + suspend fun patchProfileImage( + @Header("AccessToken") accessToken: String, + @Part file: MultipartBody.Part, + ): Response } diff --git a/app/src/main/java/com/project/meongcare/info/model/data/repository/ProfileRepository.kt b/app/src/main/java/com/project/meongcare/info/model/data/repository/ProfileRepository.kt index 316779a18..a6b879333 100644 --- a/app/src/main/java/com/project/meongcare/info/model/data/repository/ProfileRepository.kt +++ b/app/src/main/java/com/project/meongcare/info/model/data/repository/ProfileRepository.kt @@ -36,4 +36,9 @@ interface ProfileRepository { pushAgreement: Boolean, accessToken: String, ): Int? + + suspend fun patchProfileImage( + accessToken: String, + file: MultipartBody.Part, + ): Int? } diff --git a/app/src/main/java/com/project/meongcare/info/model/data/repository/ProfileRepositoryImpl.kt b/app/src/main/java/com/project/meongcare/info/model/data/repository/ProfileRepositoryImpl.kt index 32e8c310c..9323b2b94 100644 --- a/app/src/main/java/com/project/meongcare/info/model/data/repository/ProfileRepositoryImpl.kt +++ b/app/src/main/java/com/project/meongcare/info/model/data/repository/ProfileRepositoryImpl.kt @@ -153,4 +153,20 @@ class ProfileRepositoryImpl null } } + + override suspend fun patchProfileImage(accessToken: String, file: MultipartBody.Part): Int? { + return try { + val response = profileRetrofitClient.profileApi.patchProfileImage(accessToken, file) + if (response.code() == 200) { + Log.d("ProfileRepo-PatchProfile", "통신 성공") + response.code() + } else { + Log.d("ProfileRepo-PatchProfile", "통실 실패 : ${response.code()}") + response.code() + } + } catch (e: Exception) { + e.printStackTrace() + null + } + } } From f57af1fc640f4b650dba4de1e5e92dc252ee4f3c Mon Sep 17 00:00:00 2001 From: "lge6716@gmail.com" Date: Tue, 9 Jan 2024 11:44:51 +0900 Subject: [PATCH 08/12] =?UTF-8?q?feat:=20=ED=94=84=EB=A1=9C=ED=95=84=20?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20PATCH=20api=20=ED=98=B8=EC=B6=9C?= =?UTF-8?q?=20=ED=9B=84=20response=EB=A5=BC=20=EB=B7=B0=EB=AA=A8=EB=8D=B8?= =?UTF-8?q?=EC=97=90=20=EC=A0=80=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ProfileViewModel의 patchProfileResponse --- .../meongcare/info/viewmodel/ProfileViewModel.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/src/main/java/com/project/meongcare/info/viewmodel/ProfileViewModel.kt b/app/src/main/java/com/project/meongcare/info/viewmodel/ProfileViewModel.kt index 4900d869e..9416e9c92 100644 --- a/app/src/main/java/com/project/meongcare/info/viewmodel/ProfileViewModel.kt +++ b/app/src/main/java/com/project/meongcare/info/viewmodel/ProfileViewModel.kt @@ -50,6 +50,10 @@ class ProfileViewModel val patchPushResponse get() = _patchPushResponse + private val _patchProfileResponse = MutableLiveData() + val patchProfileResponse + get() = _patchProfileResponse + private val _dogProfile = MutableLiveData() val dogProfile get() = _dogProfile @@ -127,4 +131,13 @@ class ProfileViewModel _patchPushResponse.value = profileRepository.patchPushAgreement(pushAgreement, accessToken) } } + + fun patchProfileImage( + accessToken: String, + file: MultipartBody.Part, + ) { + viewModelScope.launch { + _patchProfileResponse.value = profileRepository.patchProfileImage(accessToken, file) + } + } } From be18bc2201597f1bbc46b69d58ec2b8d11e15241 Mon Sep 17 00:00:00 2001 From: "lge6716@gmail.com" Date: Tue, 9 Jan 2024 11:47:00 +0900 Subject: [PATCH 09/12] =?UTF-8?q?feat:=20ProfileFragment=EC=97=90=EC=84=9C?= =?UTF-8?q?=20bottom=20sheet=20=EC=9D=B4=EC=9A=A9=ED=95=B4=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=ED=95=9C=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EC=84=9C?= =?UTF-8?q?=EB=B2=84=EC=97=90=20=EC=A0=84=EC=86=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 전송 성공 여부에 따라 스낵바 표시 - 기본 이미지로 전송 시 이미지 뷰에 로드하는 과정에서 발생하는 glide 에러 해결 필요 --- .../meongcare/info/view/ProfileFragment.kt | 33 ++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/project/meongcare/info/view/ProfileFragment.kt b/app/src/main/java/com/project/meongcare/info/view/ProfileFragment.kt index 1933ccee3..4c1ae22c5 100644 --- a/app/src/main/java/com/project/meongcare/info/view/ProfileFragment.kt +++ b/app/src/main/java/com/project/meongcare/info/view/ProfileFragment.kt @@ -23,6 +23,7 @@ import com.project.meongcare.databinding.FragmentProfileBinding import com.project.meongcare.info.viewmodel.ProfileViewModel import com.project.meongcare.login.model.data.local.UserPreferences import com.project.meongcare.onboarding.model.data.local.PhotoMenuListener +import com.project.meongcare.onboarding.view.createMultipartBody import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.launch import javax.inject.Inject @@ -33,6 +34,7 @@ class ProfileFragment : Fragment(), PhotoMenuListener { private lateinit var mainActivity: MainActivity private val profileViewModel: ProfileViewModel by viewModels() + private lateinit var profileUri: Uri @Inject lateinit var userPreferences: UserPreferences @@ -86,7 +88,25 @@ class ProfileFragment : Fragment(), PhotoMenuListener { } } - val accessToken = "" + profileViewModel.patchProfileResponse.observe(viewLifecycleOwner) { response -> + if (response == 200) { + binding.run { + Glide.with(this@ProfileFragment) + .load(profileUri) + .into(imageviewProfileImage) + } + makeSnackBar(binding.root, requireContext(), "프로필 사진 변경이 완료되었습니다.") + } else { + binding.run { + Glide.with(this@ProfileFragment) + .load(R.drawable.profile_default_image) + .into(imageviewProfileImage) + } + makeSnackBar(binding.root, requireContext(), "프로필 사진 변경에 실패하였습니다.") + } + } + + val accessToken = "Bearer eyJhbGciOiJIUzI1NiJ9.eyJpZCI6MywiZXhwIjoxNzA0NzY4MzU0fQ.cN4yZ3Ou9YcUHusdd8Z_IsmA7KF-gzZ3kVc5fljELTM" profileViewModel.getUserProfile(accessToken) profileViewModel.getDogList(accessToken) @@ -137,13 +157,10 @@ class ProfileFragment : Fragment(), PhotoMenuListener { } override fun onUriPassed(uri: Uri) { - // uri로 회원 정보 patch api 연결한 후 통신 정상이면 이미지 뷰에 표시되도록 로직 변경 - binding.run { - Glide.with(this@ProfileFragment) - .load(uri) - .error(R.drawable.profile_default_image) - .into(imageviewProfileImage) - } + val accessToken = "Bearer eyJhbGciOiJIUzI1NiJ9.eyJpZCI6MywiZXhwIjoxNzA0NzY4MzU0fQ.cN4yZ3Ou9YcUHusdd8Z_IsmA7KF-gzZ3kVc5fljELTM" + profileUri = uri + val multipartBody = createMultipartBody(requireContext(), uri) + profileViewModel.patchProfileImage(accessToken, multipartBody) } private fun kakaoLogout() { From 3353506991d2bee1cb1ac50e791e2163f0d6618e Mon Sep 17 00:00:00 2001 From: "lge6716@gmail.com" Date: Tue, 9 Jan 2024 11:56:16 +0900 Subject: [PATCH 10/12] =?UTF-8?q?refactor:=20ProfileRepositoryImpl=20?= =?UTF-8?q?=ED=81=B4=EB=9E=98=EC=8A=A4=20patchProfileImage=20=EB=A9=94?= =?UTF-8?q?=EC=84=9C=EB=93=9C=20=EB=A7=A4=EA=B0=9C=EB=B3=80=EC=88=98=20?= =?UTF-8?q?=EA=B0=9C=ED=96=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../info/model/data/repository/ProfileRepositoryImpl.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/project/meongcare/info/model/data/repository/ProfileRepositoryImpl.kt b/app/src/main/java/com/project/meongcare/info/model/data/repository/ProfileRepositoryImpl.kt index 9323b2b94..534e20fb0 100644 --- a/app/src/main/java/com/project/meongcare/info/model/data/repository/ProfileRepositoryImpl.kt +++ b/app/src/main/java/com/project/meongcare/info/model/data/repository/ProfileRepositoryImpl.kt @@ -154,7 +154,10 @@ class ProfileRepositoryImpl } } - override suspend fun patchProfileImage(accessToken: String, file: MultipartBody.Part): Int? { + override suspend fun patchProfileImage( + accessToken: String, + file: MultipartBody.Part, + ): Int? { return try { val response = profileRetrofitClient.profileApi.patchProfileImage(accessToken, file) if (response.code() == 200) { From d836025019e37681e1b10765e313b633d1bdeef9 Mon Sep 17 00:00:00 2001 From: "lge6716@gmail.com" Date: Tue, 9 Jan 2024 11:56:54 +0900 Subject: [PATCH 11/12] =?UTF-8?q?refactor:=20SettingFragment=20=ED=81=B4?= =?UTF-8?q?=EB=9E=98=EC=8A=A4=EC=9D=98=20makeSnackBar=20=EB=A9=94=EC=84=9C?= =?UTF-8?q?=EB=93=9C=20=EB=A7=A4=EA=B0=9C=EB=B3=80=EC=88=98=20=EA=B0=9C?= =?UTF-8?q?=ED=96=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/project/meongcare/info/view/SettingFragment.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/project/meongcare/info/view/SettingFragment.kt b/app/src/main/java/com/project/meongcare/info/view/SettingFragment.kt index d200c7da4..0557a5c7a 100644 --- a/app/src/main/java/com/project/meongcare/info/view/SettingFragment.kt +++ b/app/src/main/java/com/project/meongcare/info/view/SettingFragment.kt @@ -95,7 +95,11 @@ class SettingFragment : Fragment() { } } -fun makeSnackBar(view: View, context: Context, message: String) { +fun makeSnackBar( + view: View, + context: Context, + message: String, +) { val snackBar = Snackbar.make(view, message, Snackbar.LENGTH_SHORT) val snackBarLayout = snackBar.view as Snackbar.SnackbarLayout From b555df961cc9a5001dbafc199ab0e33a0dcfd636 Mon Sep 17 00:00:00 2001 From: "lge6716@gmail.com" Date: Tue, 9 Jan 2024 11:57:40 +0900 Subject: [PATCH 12/12] =?UTF-8?q?refactor:=20UserProfileSelectBottomSheetF?= =?UTF-8?q?ragment=EC=9D=98=20multiline=20=EC=BD=94=EB=93=9C=20=EA=B0=9C?= =?UTF-8?q?=ED=96=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UserProfileSelectBottomSheetFragment.kt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/project/meongcare/info/view/UserProfileSelectBottomSheetFragment.kt b/app/src/main/java/com/project/meongcare/info/view/UserProfileSelectBottomSheetFragment.kt index 83450c078..fddd3a32b 100644 --- a/app/src/main/java/com/project/meongcare/info/view/UserProfileSelectBottomSheetFragment.kt +++ b/app/src/main/java/com/project/meongcare/info/view/UserProfileSelectBottomSheetFragment.kt @@ -114,14 +114,15 @@ class UserProfileSelectBottomSheetFragment : BottomSheetDialogFragment() { } private fun setDefaultImage() { - val defaultImageUri = requireContext().resources.let { resources -> - Uri.Builder() - .scheme(ContentResolver.SCHEME_ANDROID_RESOURCE) - .authority(resources.getResourcePackageName(R.drawable.profile_default_image)) - .appendPath(resources.getResourceTypeName(R.drawable.profile_default_image)) - .appendPath(resources.getResourceEntryName(R.drawable.profile_default_image)) - .build() - } + val defaultImageUri = + requireContext().resources.let { resources -> + Uri.Builder() + .scheme(ContentResolver.SCHEME_ANDROID_RESOURCE) + .authority(resources.getResourcePackageName(R.drawable.profile_default_image)) + .appendPath(resources.getResourceTypeName(R.drawable.profile_default_image)) + .appendPath(resources.getResourceEntryName(R.drawable.profile_default_image)) + .build() + } sendUri(defaultImageUri) dismiss() }