diff --git a/app/src/main/java/com/project/meongcare/Information/model/data/remote/ProfileApi.kt b/app/src/main/java/com/project/meongcare/info/model/data/remote/ProfileApi.kt similarity index 93% rename from app/src/main/java/com/project/meongcare/Information/model/data/remote/ProfileApi.kt rename to app/src/main/java/com/project/meongcare/info/model/data/remote/ProfileApi.kt index 1e8758155..cb4b8bf80 100644 --- a/app/src/main/java/com/project/meongcare/Information/model/data/remote/ProfileApi.kt +++ b/app/src/main/java/com/project/meongcare/info/model/data/remote/ProfileApi.kt @@ -1,6 +1,6 @@ -package com.project.meongcare.Information.model.data.remote +package com.project.meongcare.info.model.data.remote -import com.project.meongcare.Information.model.entities.GetDogInfoResponse +import com.project.meongcare.info.model.entities.GetDogInfoResponse import com.project.meongcare.home.model.entities.GetDogListResponse import com.project.meongcare.home.model.entities.GetUserProfileResponse import okhttp3.MultipartBody diff --git a/app/src/main/java/com/project/meongcare/Information/model/data/remote/ProfileRetrofitClient.kt b/app/src/main/java/com/project/meongcare/info/model/data/remote/ProfileRetrofitClient.kt similarity index 96% rename from app/src/main/java/com/project/meongcare/Information/model/data/remote/ProfileRetrofitClient.kt rename to app/src/main/java/com/project/meongcare/info/model/data/remote/ProfileRetrofitClient.kt index cb832ac2e..37838b8ca 100644 --- a/app/src/main/java/com/project/meongcare/Information/model/data/remote/ProfileRetrofitClient.kt +++ b/app/src/main/java/com/project/meongcare/info/model/data/remote/ProfileRetrofitClient.kt @@ -1,4 +1,4 @@ -package com.project.meongcare.Information.model.data.remote +package com.project.meongcare.info.model.data.remote import okhttp3.ResponseBody import retrofit2.Converter diff --git a/app/src/main/java/com/project/meongcare/Information/model/data/repository/ProfileModule.kt b/app/src/main/java/com/project/meongcare/info/model/data/repository/ProfileModule.kt similarity index 85% rename from app/src/main/java/com/project/meongcare/Information/model/data/repository/ProfileModule.kt rename to app/src/main/java/com/project/meongcare/info/model/data/repository/ProfileModule.kt index 8d6826130..e36800d5f 100644 --- a/app/src/main/java/com/project/meongcare/Information/model/data/repository/ProfileModule.kt +++ b/app/src/main/java/com/project/meongcare/info/model/data/repository/ProfileModule.kt @@ -1,4 +1,4 @@ -package com.project.meongcare.Information.model.data.repository +package com.project.meongcare.info.model.data.repository import dagger.Module import dagger.Provides @@ -14,4 +14,4 @@ object ProfileModule { fun provideProfileRepository(profileRepositoryImpl: ProfileRepositoryImpl): ProfileRepository { return profileRepositoryImpl } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/project/meongcare/Information/model/data/repository/ProfileRepository.kt b/app/src/main/java/com/project/meongcare/info/model/data/repository/ProfileRepository.kt similarity index 87% rename from app/src/main/java/com/project/meongcare/Information/model/data/repository/ProfileRepository.kt rename to app/src/main/java/com/project/meongcare/info/model/data/repository/ProfileRepository.kt index 600283581..063743f1a 100644 --- a/app/src/main/java/com/project/meongcare/Information/model/data/repository/ProfileRepository.kt +++ b/app/src/main/java/com/project/meongcare/info/model/data/repository/ProfileRepository.kt @@ -1,6 +1,6 @@ -package com.project.meongcare.Information.model.data.repository +package com.project.meongcare.info.model.data.repository -import com.project.meongcare.Information.model.entities.GetDogInfoResponse +import com.project.meongcare.info.model.entities.GetDogInfoResponse import com.project.meongcare.home.model.entities.DogProfile import com.project.meongcare.home.model.entities.GetUserProfileResponse import okhttp3.MultipartBody diff --git a/app/src/main/java/com/project/meongcare/Information/model/data/repository/ProfileRepositoryImpl.kt b/app/src/main/java/com/project/meongcare/info/model/data/repository/ProfileRepositoryImpl.kt similarity index 93% rename from app/src/main/java/com/project/meongcare/Information/model/data/repository/ProfileRepositoryImpl.kt rename to app/src/main/java/com/project/meongcare/info/model/data/repository/ProfileRepositoryImpl.kt index d6184afe4..fad3f7484 100644 --- a/app/src/main/java/com/project/meongcare/Information/model/data/repository/ProfileRepositoryImpl.kt +++ b/app/src/main/java/com/project/meongcare/info/model/data/repository/ProfileRepositoryImpl.kt @@ -1,8 +1,8 @@ -package com.project.meongcare.Information.model.data.repository +package com.project.meongcare.info.model.data.repository import android.util.Log -import com.project.meongcare.Information.model.data.remote.ProfileRetrofitClient -import com.project.meongcare.Information.model.entities.GetDogInfoResponse +import com.project.meongcare.info.model.data.remote.ProfileRetrofitClient +import com.project.meongcare.info.model.entities.GetDogInfoResponse import com.project.meongcare.home.model.entities.DogProfile import com.project.meongcare.home.model.entities.GetUserProfileResponse import okhttp3.MultipartBody @@ -11,7 +11,7 @@ import javax.inject.Inject class ProfileRepositoryImpl @Inject - constructor(private val profileRetrofitClient: ProfileRetrofitClient): ProfileRepository { + constructor(private val profileRetrofitClient: ProfileRetrofitClient) : ProfileRepository { override suspend fun getUserProfile(accessToken: String): GetUserProfileResponse? { try { val response = profileRetrofitClient.profileApi.getUserProfile(accessToken) @@ -86,7 +86,7 @@ class ProfileRepositoryImpl dogId: Long, accessToken: String, file: MultipartBody.Part, - dto: RequestBody + dto: RequestBody, ): Int? { return try { val response = profileRetrofitClient.profileApi.putDogInfo(dogId, accessToken, file, dto) @@ -135,7 +135,10 @@ class ProfileRepositoryImpl } } - override suspend fun patchPushAgreement(pushAgreement: Boolean, accessToken: String): Int? { + override suspend fun patchPushAgreement( + pushAgreement: Boolean, + accessToken: String, + ): Int? { return try { val response = profileRetrofitClient.profileApi.patchPushAgreement(pushAgreement, accessToken) if (response.code() == 200) { diff --git a/app/src/main/java/com/project/meongcare/Information/model/entities/GetDogInfoResponse.kt b/app/src/main/java/com/project/meongcare/info/model/entities/GetDogInfoResponse.kt similarity index 87% rename from app/src/main/java/com/project/meongcare/Information/model/entities/GetDogInfoResponse.kt rename to app/src/main/java/com/project/meongcare/info/model/entities/GetDogInfoResponse.kt index e3770c6d2..e7cbeace7 100644 --- a/app/src/main/java/com/project/meongcare/Information/model/entities/GetDogInfoResponse.kt +++ b/app/src/main/java/com/project/meongcare/info/model/entities/GetDogInfoResponse.kt @@ -1,4 +1,4 @@ -package com.project.meongcare.Information.model.entities +package com.project.meongcare.info.model.entities import android.os.Parcelable import kotlinx.parcelize.Parcelize diff --git a/app/src/main/java/com/project/meongcare/Information/view/PetEditFragment.kt b/app/src/main/java/com/project/meongcare/info/view/PetEditFragment.kt similarity index 92% rename from app/src/main/java/com/project/meongcare/Information/view/PetEditFragment.kt rename to app/src/main/java/com/project/meongcare/info/view/PetEditFragment.kt index 6dabcf39f..3010b59ff 100644 --- a/app/src/main/java/com/project/meongcare/Information/view/PetEditFragment.kt +++ b/app/src/main/java/com/project/meongcare/info/view/PetEditFragment.kt @@ -1,4 +1,4 @@ -package com.project.meongcare.Information.view +package com.project.meongcare.info.view import android.net.Uri import android.os.Build @@ -16,8 +16,8 @@ import androidx.navigation.fragment.findNavController import com.bumptech.glide.Glide import com.google.gson.Gson import com.project.meongcare.CalendarBottomSheetFragment -import com.project.meongcare.Information.model.entities.GetDogInfoResponse -import com.project.meongcare.Information.viewmodel.ProfileViewModel +import com.project.meongcare.info.model.entities.GetDogInfoResponse +import com.project.meongcare.info.viewmodel.ProfileViewModel import com.project.meongcare.MainActivity import com.project.meongcare.R import com.project.meongcare.databinding.FragmentPetEditBinding @@ -156,7 +156,7 @@ class PetEditFragment : Fragment(), PhotoMenuListener, DateSubmitListener { val requestBody: RequestBody = json.toRequestBody("application/json; charset=utf-8".toMediaTypeOrNull()) val filePart = createMultipartBody(mainActivity, petEditViewModel.dogProfile.value) - val accessToken = "Bearer eyJhbGciOiJIUzI1NiJ9.eyJpZCI6MywiZXhwIjoxNzA0NjI4MzQzfQ._y66Fy6QfznE14qRncC0kPaEVHErorVRwW4zAhoW2hI" + val accessToken = "" petEditViewModel.putDogInfo(dogInfo.dogId, accessToken, filePart, requestBody) } } @@ -164,7 +164,11 @@ class PetEditFragment : Fragment(), PhotoMenuListener, DateSubmitListener { return binding.root } - private fun editTextWatcher(editText: EditText, targetView: View, hint: String) { + private fun editTextWatcher( + editText: EditText, + targetView: View, + hint: String, + ) { editText.addTextChangedListener { editText.doAfterTextChanged { editable -> updateEditTextStyle(editText, targetView, hint) @@ -172,7 +176,11 @@ class PetEditFragment : Fragment(), PhotoMenuListener, DateSubmitListener { } } - private fun updateEditTextStyle(editText: EditText, targetView: View, hint: String) { + private fun updateEditTextStyle( + editText: EditText, + targetView: View, + hint: String, + ) { if (editText.text.isNullOrEmpty()) { targetView.setBackgroundResource(R.drawable.all_rect_gray1_r5_outline_sub1) editText.hint = "필수 입력 값입니다" @@ -200,8 +208,8 @@ class PetEditFragment : Fragment(), PhotoMenuListener, DateSubmitListener { edittextPeteditName.setText(dogInfo.name) edittextPeteditType.setText(dogInfo.type) when (dogInfo.sex) { - Gender.FEMALE.english -> chipgroupPeteditGroupGender.check(R.id.chip_petedit_female) - Gender.MALE.english -> chipgroupPeteditGroupGender.check(R.id.chip_petedit_male) + Gender.FEMALE.english -> chipgroupPeteditGroupGender.check(R.id.chip_petedit_female) + Gender.MALE.english -> chipgroupPeteditGroupGender.check(R.id.chip_petedit_male) } checkboxPeteditNeuterStatus.isChecked = dogInfo.castrate isCbxChecked = dogInfo.castrate diff --git a/app/src/main/java/com/project/meongcare/Information/view/PetInfoFragment.kt b/app/src/main/java/com/project/meongcare/info/view/PetInfoFragment.kt similarity index 95% rename from app/src/main/java/com/project/meongcare/Information/view/PetInfoFragment.kt rename to app/src/main/java/com/project/meongcare/info/view/PetInfoFragment.kt index 0a83816b2..e8328dbef 100644 --- a/app/src/main/java/com/project/meongcare/Information/view/PetInfoFragment.kt +++ b/app/src/main/java/com/project/meongcare/info/view/PetInfoFragment.kt @@ -1,4 +1,4 @@ -package com.project.meongcare.Information.view +package com.project.meongcare.info.view import android.os.Bundle import android.view.LayoutInflater @@ -8,8 +8,8 @@ import androidx.fragment.app.Fragment import androidx.fragment.app.viewModels import androidx.navigation.fragment.findNavController import com.bumptech.glide.Glide -import com.project.meongcare.Information.model.entities.GetDogInfoResponse -import com.project.meongcare.Information.viewmodel.ProfileViewModel +import com.project.meongcare.info.model.entities.GetDogInfoResponse +import com.project.meongcare.info.viewmodel.ProfileViewModel import com.project.meongcare.R import com.project.meongcare.databinding.FragmentPetAddEditBinding import com.project.meongcare.onboarding.view.Gender diff --git a/app/src/main/java/com/project/meongcare/Information/view/ProfileDogAdapter.kt b/app/src/main/java/com/project/meongcare/info/view/ProfileDogAdapter.kt similarity index 97% rename from app/src/main/java/com/project/meongcare/Information/view/ProfileDogAdapter.kt rename to app/src/main/java/com/project/meongcare/info/view/ProfileDogAdapter.kt index 06d2911d9..7a7a00b5f 100644 --- a/app/src/main/java/com/project/meongcare/Information/view/ProfileDogAdapter.kt +++ b/app/src/main/java/com/project/meongcare/info/view/ProfileDogAdapter.kt @@ -1,9 +1,8 @@ -package com.project.meongcare.Information.view +package com.project.meongcare.info.view import android.content.Context import android.os.Bundle import android.view.LayoutInflater -import android.view.View import android.view.ViewGroup import android.widget.TextView import androidx.cardview.widget.CardView diff --git a/app/src/main/java/com/project/meongcare/Information/view/ProfileFragment.kt b/app/src/main/java/com/project/meongcare/info/view/ProfileFragment.kt similarity index 98% rename from app/src/main/java/com/project/meongcare/Information/view/ProfileFragment.kt rename to app/src/main/java/com/project/meongcare/info/view/ProfileFragment.kt index aec9a69a4..78c93c4dd 100644 --- a/app/src/main/java/com/project/meongcare/Information/view/ProfileFragment.kt +++ b/app/src/main/java/com/project/meongcare/info/view/ProfileFragment.kt @@ -1,4 +1,4 @@ -package com.project.meongcare.Information.view +package com.project.meongcare.info.view import android.net.Uri import android.os.Bundle @@ -17,7 +17,7 @@ import com.google.android.gms.auth.api.signin.GoogleSignIn import com.google.android.gms.auth.api.signin.GoogleSignInOptions import com.kakao.sdk.user.UserApiClient import com.navercorp.nid.NaverIdLoginSDK -import com.project.meongcare.Information.viewmodel.ProfileViewModel +import com.project.meongcare.info.viewmodel.ProfileViewModel import com.project.meongcare.MainActivity import com.project.meongcare.R import com.project.meongcare.databinding.FragmentProfileBinding diff --git a/app/src/main/java/com/project/meongcare/Information/view/SettingFragment.kt b/app/src/main/java/com/project/meongcare/info/view/SettingFragment.kt similarity index 97% rename from app/src/main/java/com/project/meongcare/Information/view/SettingFragment.kt rename to app/src/main/java/com/project/meongcare/info/view/SettingFragment.kt index 7eb21e455..a8c129211 100644 --- a/app/src/main/java/com/project/meongcare/Information/view/SettingFragment.kt +++ b/app/src/main/java/com/project/meongcare/info/view/SettingFragment.kt @@ -1,4 +1,4 @@ -package com.project.meongcare.Information.view +package com.project.meongcare.info.view import android.os.Bundle import android.view.Gravity @@ -12,7 +12,7 @@ import androidx.fragment.app.Fragment import androidx.fragment.app.viewModels import androidx.navigation.fragment.findNavController import com.google.android.material.snackbar.Snackbar -import com.project.meongcare.Information.viewmodel.ProfileViewModel +import com.project.meongcare.info.viewmodel.ProfileViewModel import com.project.meongcare.R import com.project.meongcare.databinding.FragmentSettingBinding import com.project.meongcare.login.model.data.local.UserPreferences @@ -87,6 +87,7 @@ 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 diff --git a/app/src/main/java/com/project/meongcare/Information/view/UserProfileSelectBottomSheetFragment.kt b/app/src/main/java/com/project/meongcare/info/view/UserProfileSelectBottomSheetFragment.kt similarity index 97% rename from app/src/main/java/com/project/meongcare/Information/view/UserProfileSelectBottomSheetFragment.kt rename to app/src/main/java/com/project/meongcare/info/view/UserProfileSelectBottomSheetFragment.kt index 0a79bed37..a7de546d0 100644 --- a/app/src/main/java/com/project/meongcare/Information/view/UserProfileSelectBottomSheetFragment.kt +++ b/app/src/main/java/com/project/meongcare/info/view/UserProfileSelectBottomSheetFragment.kt @@ -1,4 +1,4 @@ -package com.project.meongcare.Information.view +package com.project.meongcare.info.view import android.app.Activity import android.content.Context @@ -62,7 +62,7 @@ class UserProfileSelectBottomSheetFragment : BottomSheetDialogFragment() { ActivityResultContracts.StartActivityForResult(), ) { if (it.resultCode == Activity.RESULT_OK) { - it.data?.data?.let { uri -> + it.data?.data?.let { uri -> if (uri != null) { sendUri(uri) } diff --git a/app/src/main/java/com/project/meongcare/Information/viewmodel/ProfileViewModel.kt b/app/src/main/java/com/project/meongcare/info/viewmodel/ProfileViewModel.kt similarity index 94% rename from app/src/main/java/com/project/meongcare/Information/viewmodel/ProfileViewModel.kt rename to app/src/main/java/com/project/meongcare/info/viewmodel/ProfileViewModel.kt index 79ed47701..d1d9e2bd2 100644 --- a/app/src/main/java/com/project/meongcare/Information/viewmodel/ProfileViewModel.kt +++ b/app/src/main/java/com/project/meongcare/info/viewmodel/ProfileViewModel.kt @@ -1,11 +1,11 @@ -package com.project.meongcare.Information.viewmodel +package com.project.meongcare.info.viewmodel import android.net.Uri import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.project.meongcare.Information.model.data.repository.ProfileRepository -import com.project.meongcare.Information.model.entities.GetDogInfoResponse +import com.project.meongcare.info.model.data.repository.ProfileRepository +import com.project.meongcare.info.model.entities.GetDogInfoResponse import com.project.meongcare.home.model.entities.DogProfile import com.project.meongcare.home.model.entities.GetUserProfileResponse import dagger.hilt.android.lifecycle.HiltViewModel