From ba5eb7a9a8bb555a8a93014745828928fa472059 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Fri, 8 Mar 2024 01:51:08 +0900 Subject: [PATCH 01/15] =?UTF-8?q?[FIX/#227]=20fragment=20=ED=81=AC?= =?UTF-8?q?=EA=B8=B0=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../profile/participant/ParticipantProfileActivity.kt | 7 ++++--- .../profile/participant/ParticipantProfileViewModel.kt | 3 --- .../participant/ParticipantProfileViewPagerAdapter.kt | 3 ++- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/presentation/src/main/java/com/going/presentation/profile/participant/ParticipantProfileActivity.kt b/presentation/src/main/java/com/going/presentation/profile/participant/ParticipantProfileActivity.kt index 01b0b4ad..680be390 100644 --- a/presentation/src/main/java/com/going/presentation/profile/participant/ParticipantProfileActivity.kt +++ b/presentation/src/main/java/com/going/presentation/profile/participant/ParticipantProfileActivity.kt @@ -35,6 +35,7 @@ class ParticipantProfileActivity : private val participantId: Long by lazy { intent.getLongExtra(PARTICIPANT_ID, 0) } + var isEmpty: Boolean = true override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -60,6 +61,7 @@ class ParticipantProfileActivity : private fun bindData(profile: ParticipantProfileResponseModel) { binding.run { if (profile.result != -1) { + isEmpty = false UserTendencyResultList[profile.result].run { ivProfile.load(profileImage) { transformations(CircleCropTransformation()) @@ -101,7 +103,7 @@ class ParticipantProfileActivity : binding.appbarTripProfile.layoutParams as CoordinatorLayout.LayoutParams val behavior = params.behavior as AppBarLayout.Behavior? - with(tab.position == 0 && participantProfileViewModel.isEmpty) { + with(tab.position == 0 && isEmpty) { behavior?.setDragCallback(object : DragCallback() { override fun canDrag(appBarLayout: AppBarLayout): Boolean { return !this@with @@ -110,7 +112,6 @@ class ParticipantProfileActivity : setFragmentHeight(this) if (this) binding.appbarTripProfile.setExpanded(true) - } binding.vpTripProfile.currentItem = tab.position @@ -144,7 +145,7 @@ class ParticipantProfileActivity : binding.vpTripProfile.layoutParams = binding.vpTripProfile.layoutParams.also { it.height = - if (temp) displayHeight - toolbarHeight - appBarHeight - tabHeight else displayHeight + if (temp) displayHeight - toolbarHeight - appBarHeight - tabHeight else displayHeight - toolbarHeight } } diff --git a/presentation/src/main/java/com/going/presentation/profile/participant/ParticipantProfileViewModel.kt b/presentation/src/main/java/com/going/presentation/profile/participant/ParticipantProfileViewModel.kt index 59a605cc..dc9c76a9 100644 --- a/presentation/src/main/java/com/going/presentation/profile/participant/ParticipantProfileViewModel.kt +++ b/presentation/src/main/java/com/going/presentation/profile/participant/ParticipantProfileViewModel.kt @@ -23,9 +23,6 @@ class ParticipantProfileViewModel @Inject constructor( val participantProfile: SharedFlow = _participantProfile var number: Int = 0 - val isEmpty: Boolean by lazy { - number == -1 - } fun getUserInfoState(participantId: Long) { viewModelScope.launch { diff --git a/presentation/src/main/java/com/going/presentation/profile/participant/ParticipantProfileViewPagerAdapter.kt b/presentation/src/main/java/com/going/presentation/profile/participant/ParticipantProfileViewPagerAdapter.kt index b2c13cc2..84fd51fc 100644 --- a/presentation/src/main/java/com/going/presentation/profile/participant/ParticipantProfileViewPagerAdapter.kt +++ b/presentation/src/main/java/com/going/presentation/profile/participant/ParticipantProfileViewPagerAdapter.kt @@ -2,6 +2,7 @@ package com.going.presentation.profile.participant import androidx.fragment.app.Fragment import androidx.viewpager2.adapter.FragmentStateAdapter +import com.going.presentation.profile.trip.tripprofiletag.profiletag.TripProfileTagFragment class ParticipantProfileViewPagerAdapter(activity: ParticipantProfileActivity) : FragmentStateAdapter(activity) { override fun getItemCount(): Int = 2 @@ -9,6 +10,6 @@ class ParticipantProfileViewPagerAdapter(activity: ParticipantProfileActivity) : override fun createFragment(position: Int): Fragment = when (position) { 0 -> ParticipantProfileCharacterFragment() - else -> ParticipantProfileTagFragment() + else -> TripProfileTagFragment() } } \ No newline at end of file From be44b78184d8bd885e9ec7b756c06dc1ba11c56a Mon Sep 17 00:00:00 2001 From: Dongmin Date: Fri, 8 Mar 2024 02:13:58 +0900 Subject: [PATCH 02/15] =?UTF-8?q?[FEAT/#227]=20patch=20api=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/going/data/datasource/ProfileDataSource.kt | 2 ++ .../com/going/data/datasourceImpl/ProfileDataSourceImpl.kt | 3 +++ .../com/going/data/repositoryImpl/ProfileRepositoryImpl.kt | 5 +++++ data/src/main/java/com/going/data/service/ProfileService.kt | 4 ++++ .../kotlin/com/going/domain/repository/ProfileRepository.kt | 2 ++ 5 files changed, 16 insertions(+) diff --git a/data/src/main/java/com/going/data/datasource/ProfileDataSource.kt b/data/src/main/java/com/going/data/datasource/ProfileDataSource.kt index ab6398db..04ed5292 100644 --- a/data/src/main/java/com/going/data/datasource/ProfileDataSource.kt +++ b/data/src/main/java/com/going/data/datasource/ProfileDataSource.kt @@ -9,6 +9,8 @@ import com.going.domain.entity.request.ParticipantProfileRequestModel interface ProfileDataSource { suspend fun getUserProfile(): BaseResponse + suspend fun patchUserProfile(): BaseResponse + suspend fun getParticipantProfile( participantProfileRequestModel: ParticipantProfileRequestDto ): BaseResponse diff --git a/data/src/main/java/com/going/data/datasourceImpl/ProfileDataSourceImpl.kt b/data/src/main/java/com/going/data/datasourceImpl/ProfileDataSourceImpl.kt index 84418481..2cc8afa3 100644 --- a/data/src/main/java/com/going/data/datasourceImpl/ProfileDataSourceImpl.kt +++ b/data/src/main/java/com/going/data/datasourceImpl/ProfileDataSourceImpl.kt @@ -15,6 +15,9 @@ class ProfileDataSourceImpl @Inject constructor( override suspend fun getUserProfile(): BaseResponse = profileService.getUserProfile() + override suspend fun patchUserProfile(): BaseResponse = + profileService.patchUserProfile() + override suspend fun getParticipantProfile(participantProfileRequestDto: ParticipantProfileRequestDto): BaseResponse = profileService.getParticipantProfile(participantProfileRequestDto.participantId) } diff --git a/data/src/main/java/com/going/data/repositoryImpl/ProfileRepositoryImpl.kt b/data/src/main/java/com/going/data/repositoryImpl/ProfileRepositoryImpl.kt index 2a7db2bd..7ea3b486 100644 --- a/data/src/main/java/com/going/data/repositoryImpl/ProfileRepositoryImpl.kt +++ b/data/src/main/java/com/going/data/repositoryImpl/ProfileRepositoryImpl.kt @@ -16,6 +16,11 @@ class ProfileRepositoryImpl @Inject constructor( profileDataSource.getUserProfile().data.toProfileModel() } + override suspend fun patchUserProfile(): Result = + kotlin.runCatching { + profileDataSource.patchUserProfile().data.toProfileModel() + } + override suspend fun getParticipantProfile( participantProfileRequestModel: ParticipantProfileRequestModel ): Result = diff --git a/data/src/main/java/com/going/data/service/ProfileService.kt b/data/src/main/java/com/going/data/service/ProfileService.kt index 75a867d9..0eb1bf44 100644 --- a/data/src/main/java/com/going/data/service/ProfileService.kt +++ b/data/src/main/java/com/going/data/service/ProfileService.kt @@ -6,12 +6,16 @@ import com.going.data.dto.response.ParticipantProfileResponseDto import com.going.data.dto.response.UserProfileResponseDto import com.going.domain.entity.request.ParticipantProfileRequestModel import retrofit2.http.GET +import retrofit2.http.PATCH import retrofit2.http.Path interface ProfileService { @GET("api/users/profile") suspend fun getUserProfile(): BaseResponse + @PATCH("api/users/profile") + suspend fun patchUserProfile(): BaseResponse + @GET("api/trips/participants/{participantId}") suspend fun getParticipantProfile( @Path("participantId") participantId: Long diff --git a/domain/src/main/kotlin/com/going/domain/repository/ProfileRepository.kt b/domain/src/main/kotlin/com/going/domain/repository/ProfileRepository.kt index 6ea6f7ac..9508756f 100644 --- a/domain/src/main/kotlin/com/going/domain/repository/ProfileRepository.kt +++ b/domain/src/main/kotlin/com/going/domain/repository/ProfileRepository.kt @@ -7,5 +7,7 @@ import com.going.domain.entity.response.ParticipantProfileResponseModel interface ProfileRepository { suspend fun getUserProfile(): Result + suspend fun patchUserProfile(): Result + suspend fun getParticipantProfile(participantProfileRequestModel: ParticipantProfileRequestModel): Result } From dbd8b2b644daa5a07c4a27defdfe5f2c24dc501f Mon Sep 17 00:00:00 2001 From: Dongmin Date: Fri, 8 Mar 2024 02:52:08 +0900 Subject: [PATCH 03/15] =?UTF-8?q?[FEAT/#227]=20patch=20api=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/going/data/datasource/ProfileDataSource.kt | 8 +++++++- .../going/data/datasourceImpl/ProfileDataSourceImpl.kt | 7 +++++-- .../going/data/repositoryImpl/ProfileRepositoryImpl.kt | 9 ++++++--- .../main/java/com/going/data/service/ProfileService.kt | 8 +++++++- .../com/going/domain/repository/ProfileRepository.kt | 5 +++-- 5 files changed, 28 insertions(+), 9 deletions(-) diff --git a/data/src/main/java/com/going/data/datasource/ProfileDataSource.kt b/data/src/main/java/com/going/data/datasource/ProfileDataSource.kt index 04ed5292..3cf9eb43 100644 --- a/data/src/main/java/com/going/data/datasource/ProfileDataSource.kt +++ b/data/src/main/java/com/going/data/datasource/ProfileDataSource.kt @@ -1,15 +1,21 @@ package com.going.data.datasource import com.going.data.dto.BaseResponse +import com.going.data.dto.NonDataBaseResponse import com.going.data.dto.request.ParticipantProfileRequestDto +import com.going.data.dto.request.UserProfileRequestDto import com.going.data.dto.response.ParticipantProfileResponseDto import com.going.data.dto.response.UserProfileResponseDto import com.going.domain.entity.request.ParticipantProfileRequestModel +import com.going.domain.entity.request.UserProfileRequestModel +import retrofit2.http.Body interface ProfileDataSource { suspend fun getUserProfile(): BaseResponse - suspend fun patchUserProfile(): BaseResponse + suspend fun patchUserProfile( + @Body userProfileResponseModel: UserProfileRequestDto + ): NonDataBaseResponse suspend fun getParticipantProfile( participantProfileRequestModel: ParticipantProfileRequestDto diff --git a/data/src/main/java/com/going/data/datasourceImpl/ProfileDataSourceImpl.kt b/data/src/main/java/com/going/data/datasourceImpl/ProfileDataSourceImpl.kt index 2cc8afa3..bb798a66 100644 --- a/data/src/main/java/com/going/data/datasourceImpl/ProfileDataSourceImpl.kt +++ b/data/src/main/java/com/going/data/datasourceImpl/ProfileDataSourceImpl.kt @@ -2,7 +2,9 @@ package com.going.data.datasourceImpl import com.going.data.datasource.ProfileDataSource import com.going.data.dto.BaseResponse +import com.going.data.dto.NonDataBaseResponse import com.going.data.dto.request.ParticipantProfileRequestDto +import com.going.data.dto.request.UserProfileRequestDto import com.going.data.dto.response.ParticipantProfileResponseDto import com.going.data.dto.response.UserProfileResponseDto import com.going.data.service.ProfileService @@ -15,8 +17,9 @@ class ProfileDataSourceImpl @Inject constructor( override suspend fun getUserProfile(): BaseResponse = profileService.getUserProfile() - override suspend fun patchUserProfile(): BaseResponse = - profileService.patchUserProfile() + override suspend fun patchUserProfile(request: UserProfileRequestDto): NonDataBaseResponse = + profileService.patchUserProfile(request) + override suspend fun getParticipantProfile(participantProfileRequestDto: ParticipantProfileRequestDto): BaseResponse = profileService.getParticipantProfile(participantProfileRequestDto.participantId) diff --git a/data/src/main/java/com/going/data/repositoryImpl/ProfileRepositoryImpl.kt b/data/src/main/java/com/going/data/repositoryImpl/ProfileRepositoryImpl.kt index 7ea3b486..cc8e4f97 100644 --- a/data/src/main/java/com/going/data/repositoryImpl/ProfileRepositoryImpl.kt +++ b/data/src/main/java/com/going/data/repositoryImpl/ProfileRepositoryImpl.kt @@ -1,26 +1,29 @@ package com.going.data.repositoryImpl import com.going.data.datasource.ProfileDataSource +import com.going.data.dto.request.toDto import com.going.data.dto.request.toParticipantRequestDto import com.going.domain.entity.request.ParticipantProfileRequestModel import com.going.domain.entity.request.UserProfileRequestModel import com.going.domain.entity.response.ParticipantProfileResponseModel +import com.going.domain.entity.response.UserProfileResponseModel import com.going.domain.repository.ProfileRepository import javax.inject.Inject class ProfileRepositoryImpl @Inject constructor( private val profileDataSource: ProfileDataSource ) : ProfileRepository { - override suspend fun getUserProfile(): Result = + override suspend fun getUserProfile(): Result = runCatching { profileDataSource.getUserProfile().data.toProfileModel() } - override suspend fun patchUserProfile(): Result = + override suspend fun patchUserProfile(userProfileResponseModel: UserProfileRequestModel): Result = kotlin.runCatching { - profileDataSource.patchUserProfile().data.toProfileModel() + profileDataSource.patchUserProfile(userProfileResponseModel.toDto()) } + override suspend fun getParticipantProfile( participantProfileRequestModel: ParticipantProfileRequestModel ): Result = diff --git a/data/src/main/java/com/going/data/service/ProfileService.kt b/data/src/main/java/com/going/data/service/ProfileService.kt index 0eb1bf44..313bd8cc 100644 --- a/data/src/main/java/com/going/data/service/ProfileService.kt +++ b/data/src/main/java/com/going/data/service/ProfileService.kt @@ -1,10 +1,14 @@ package com.going.data.service import com.going.data.dto.BaseResponse +import com.going.data.dto.NonDataBaseResponse import com.going.data.dto.request.ParticipantProfileRequestDto +import com.going.data.dto.request.StartInviteTripRequestDto +import com.going.data.dto.request.UserProfileRequestDto import com.going.data.dto.response.ParticipantProfileResponseDto import com.going.data.dto.response.UserProfileResponseDto import com.going.domain.entity.request.ParticipantProfileRequestModel +import retrofit2.http.Body import retrofit2.http.GET import retrofit2.http.PATCH import retrofit2.http.Path @@ -14,7 +18,9 @@ interface ProfileService { suspend fun getUserProfile(): BaseResponse @PATCH("api/users/profile") - suspend fun patchUserProfile(): BaseResponse + suspend fun patchUserProfile( + @Body request: UserProfileRequestDto, + ): NonDataBaseResponse @GET("api/trips/participants/{participantId}") suspend fun getParticipantProfile( diff --git a/domain/src/main/kotlin/com/going/domain/repository/ProfileRepository.kt b/domain/src/main/kotlin/com/going/domain/repository/ProfileRepository.kt index 9508756f..6405f538 100644 --- a/domain/src/main/kotlin/com/going/domain/repository/ProfileRepository.kt +++ b/domain/src/main/kotlin/com/going/domain/repository/ProfileRepository.kt @@ -3,11 +3,12 @@ package com.going.domain.repository import com.going.domain.entity.request.ParticipantProfileRequestModel import com.going.domain.entity.request.UserProfileRequestModel import com.going.domain.entity.response.ParticipantProfileResponseModel +import com.going.domain.entity.response.UserProfileResponseModel interface ProfileRepository { - suspend fun getUserProfile(): Result + suspend fun getUserProfile(): Result - suspend fun patchUserProfile(): Result + suspend fun patchUserProfile(userProfileResponseModel: UserProfileRequestModel): Result suspend fun getParticipantProfile(participantProfileRequestModel: ParticipantProfileRequestModel): Result } From 7caf4191b3312343b0c3ad30027044a4fa4bc971 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Fri, 8 Mar 2024 02:52:29 +0900 Subject: [PATCH 04/15] =?UTF-8?q?[CHORE/#227]=20=EB=B3=80=EC=88=98?= =?UTF-8?q?=EB=AA=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/dto/request/UserProfileRequestDto.kt | 18 ++++++++++++++++++ .../dto/response/UserProfileResponseDto.kt | 3 ++- .../entity/request/UserProfileRequestModel.kt | 1 - .../response/UserProfileResponseModel.kt | 7 +++++++ .../tendency/result/TendencyResultViewModel.kt | 5 +++-- 5 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 data/src/main/java/com/going/data/dto/request/UserProfileRequestDto.kt create mode 100644 domain/src/main/kotlin/com/going/domain/entity/response/UserProfileResponseModel.kt diff --git a/data/src/main/java/com/going/data/dto/request/UserProfileRequestDto.kt b/data/src/main/java/com/going/data/dto/request/UserProfileRequestDto.kt new file mode 100644 index 00000000..4252ad2d --- /dev/null +++ b/data/src/main/java/com/going/data/dto/request/UserProfileRequestDto.kt @@ -0,0 +1,18 @@ +package com.going.data.dto.request + +import com.going.domain.entity.request.TokenReissueRequestModel +import com.going.domain.entity.request.UserProfileRequestModel +import com.going.domain.entity.response.UserProfileResponseModel +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +data class UserProfileRequestDto( + @SerialName("name") + val name: String, + @SerialName("intro") + val intro: String, +) + +fun UserProfileRequestModel.toDto() = UserProfileRequestDto(name, intro) + diff --git a/data/src/main/java/com/going/data/dto/response/UserProfileResponseDto.kt b/data/src/main/java/com/going/data/dto/response/UserProfileResponseDto.kt index c9db28ae..09aedcc7 100644 --- a/data/src/main/java/com/going/data/dto/response/UserProfileResponseDto.kt +++ b/data/src/main/java/com/going/data/dto/response/UserProfileResponseDto.kt @@ -1,6 +1,7 @@ package com.going.data.dto.response import com.going.domain.entity.request.UserProfileRequestModel +import com.going.domain.entity.response.UserProfileResponseModel import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @@ -13,5 +14,5 @@ data class UserProfileResponseDto( @SerialName("result") val result: Int, ) { - fun toProfileModel() = UserProfileRequestModel(name, intro, result) + fun toProfileModel() = UserProfileResponseModel(name, intro, result) } diff --git a/domain/src/main/kotlin/com/going/domain/entity/request/UserProfileRequestModel.kt b/domain/src/main/kotlin/com/going/domain/entity/request/UserProfileRequestModel.kt index 77c046d6..6d46de19 100644 --- a/domain/src/main/kotlin/com/going/domain/entity/request/UserProfileRequestModel.kt +++ b/domain/src/main/kotlin/com/going/domain/entity/request/UserProfileRequestModel.kt @@ -3,5 +3,4 @@ package com.going.domain.entity.request data class UserProfileRequestModel( val name: String, val intro: String, - val result: Int, ) diff --git a/domain/src/main/kotlin/com/going/domain/entity/response/UserProfileResponseModel.kt b/domain/src/main/kotlin/com/going/domain/entity/response/UserProfileResponseModel.kt new file mode 100644 index 00000000..9718c728 --- /dev/null +++ b/domain/src/main/kotlin/com/going/domain/entity/response/UserProfileResponseModel.kt @@ -0,0 +1,7 @@ +package com.going.domain.entity.response + +data class UserProfileResponseModel( + val name: String, + val intro: String, + val result: Int, +) diff --git a/presentation/src/main/java/com/going/presentation/tendency/result/TendencyResultViewModel.kt b/presentation/src/main/java/com/going/presentation/tendency/result/TendencyResultViewModel.kt index 5dd64fad..b39fb735 100644 --- a/presentation/src/main/java/com/going/presentation/tendency/result/TendencyResultViewModel.kt +++ b/presentation/src/main/java/com/going/presentation/tendency/result/TendencyResultViewModel.kt @@ -3,6 +3,7 @@ package com.going.presentation.tendency.result import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.going.domain.entity.request.UserProfileRequestModel +import com.going.domain.entity.response.UserProfileResponseModel import com.going.domain.repository.ProfileRepository import com.going.ui.state.UiState import dagger.hilt.android.lifecycle.HiltViewModel @@ -16,8 +17,8 @@ class TendencyResultViewModel @Inject constructor( private val profileRepository: ProfileRepository, ) : ViewModel() { - private val _userInfoState = MutableStateFlow>(UiState.Empty) - val userInfoState: StateFlow> = _userInfoState + private val _userInfoState = MutableStateFlow>(UiState.Empty) + val userInfoState: StateFlow> = _userInfoState val tendencyId = MutableStateFlow(0) From 87460e9bc832c8d307a0f02e59eca2021f4f46b9 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Fri, 8 Mar 2024 02:52:42 +0900 Subject: [PATCH 05/15] =?UTF-8?q?[ADD/#227]=20string=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=20=EB=B0=8F=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- presentation/src/main/res/layout/activity_profile_edit.xml | 2 +- presentation/src/main/res/values/strings.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/presentation/src/main/res/layout/activity_profile_edit.xml b/presentation/src/main/res/layout/activity_profile_edit.xml index b3a2a52f..f2b40ae2 100644 --- a/presentation/src/main/res/layout/activity_profile_edit.xml +++ b/presentation/src/main/res/layout/activity_profile_edit.xml @@ -79,7 +79,7 @@ android:enabled="false" android:outlineProvider="none" android:paddingVertical="10dp" - android:text="@string/sign_up_finish_btn" + android:text="@string/save" android:textColor="@color/gray_200" android:textSize="16sp" app:layout_constraintBottom_toBottomOf="parent" diff --git a/presentation/src/main/res/values/strings.xml b/presentation/src/main/res/values/strings.xml index 9964da6f..9d60dc71 100644 --- a/presentation/src/main/res/values/strings.xml +++ b/presentation/src/main/res/values/strings.xml @@ -30,6 +30,7 @@ 안내 확인 + 저장 인터넷 연결을 확인해주세요 From 5c6718cb549ea34f8ad24026be199a41777d94f9 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Fri, 8 Mar 2024 02:53:01 +0900 Subject: [PATCH 06/15] =?UTF-8?q?[FEAT/#227]=20=ED=94=84=EB=A1=9C=ED=95=84?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=20=EA=B5=AC=ED=98=84=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../profile/edit/ProfileEditActivity.kt | 18 ++++++++++++ .../profile/edit/ProfileEditViewModel.kt | 28 ++++++++++++++++++- .../profile/my/ProfileActivity.kt | 5 ++++ .../profile/my/ProfileViewModel.kt | 5 ++-- 4 files changed, 53 insertions(+), 3 deletions(-) diff --git a/presentation/src/main/java/com/going/presentation/profile/edit/ProfileEditActivity.kt b/presentation/src/main/java/com/going/presentation/profile/edit/ProfileEditActivity.kt index 8d18bbe8..1db5a4c0 100644 --- a/presentation/src/main/java/com/going/presentation/profile/edit/ProfileEditActivity.kt +++ b/presentation/src/main/java/com/going/presentation/profile/edit/ProfileEditActivity.kt @@ -11,6 +11,7 @@ import com.going.presentation.R import com.going.presentation.databinding.ActivityProfileEditBinding import com.going.ui.base.BaseActivity import com.going.ui.extension.setOnSingleClickListener +import com.going.ui.extension.toast import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach @@ -30,6 +31,8 @@ class ProfileEditActivity : observeInfoTextChanged() observeIsValueChanged() initBackBtnClickListener() + initProfileEditBtnClickListener() + observeIsChangedSuccess() } private fun setEtNameArguments() { @@ -82,6 +85,21 @@ class ProfileEditActivity : } } + private fun initProfileEditBtnClickListener() { + binding.btnProfileEditFinish.setOnSingleClickListener { + viewModel.patchUserInfo() + } + } + + private fun observeIsChangedSuccess() { + viewModel.isChangedSuccess.flowWithLifecycle(lifecycle).onEach { + if (it) { + toast(getString(R.string.todo_change_toast_success)) + finish() + } else toast(getString(R.string.server_error)) + }.launchIn(lifecycleScope) + } + companion object { private const val NICKNAME = "NICKNAME" private const val INFO = "INFO" diff --git a/presentation/src/main/java/com/going/presentation/profile/edit/ProfileEditViewModel.kt b/presentation/src/main/java/com/going/presentation/profile/edit/ProfileEditViewModel.kt index 42b5bee7..4ccb9a27 100644 --- a/presentation/src/main/java/com/going/presentation/profile/edit/ProfileEditViewModel.kt +++ b/presentation/src/main/java/com/going/presentation/profile/edit/ProfileEditViewModel.kt @@ -1,14 +1,29 @@ package com.going.presentation.profile.edit import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope +import com.going.domain.entity.request.UserProfileRequestModel +import com.going.domain.repository.ProfileRepository import com.going.presentation.onboarding.signup.SignUpViewModel +import dagger.hilt.android.lifecycle.HiltViewModel +import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.SharedFlow import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.launch +import javax.inject.Inject -class ProfileEditViewModel : ViewModel() { +@HiltViewModel +class ProfileEditViewModel @Inject constructor( + private val profileRepository: ProfileRepository, +) : ViewModel() { private val _isValueChanged = MutableStateFlow(false) val isValueChanged: StateFlow = _isValueChanged + private val _isChangedSuccess = MutableSharedFlow() + val isChangedSuccess: SharedFlow + get() = _isChangedSuccess + private var isNameChanged = false private var isInfoChanged = false @@ -44,6 +59,17 @@ class ProfileEditViewModel : ViewModel() { nowName.length <= getMaxNameLen() && nowInfo.length <= getMaxInfoLen() && (isInfoChanged || isNameChanged) } + fun patchUserInfo() { + viewModelScope.launch { + profileRepository.patchUserProfile(UserProfileRequestModel(nowName, nowInfo)) + .onSuccess { + _isChangedSuccess.emit(true) + }.onFailure { + _isChangedSuccess.emit(false) + } + } + } + fun getMaxNameLen() = SignUpViewModel.MAX_NAME_LEN fun getMaxInfoLen() = SignUpViewModel.MAX_INFO_LEN diff --git a/presentation/src/main/java/com/going/presentation/profile/my/ProfileActivity.kt b/presentation/src/main/java/com/going/presentation/profile/my/ProfileActivity.kt index 5d7e5b1e..43f351d5 100644 --- a/presentation/src/main/java/com/going/presentation/profile/my/ProfileActivity.kt +++ b/presentation/src/main/java/com/going/presentation/profile/my/ProfileActivity.kt @@ -42,6 +42,11 @@ class ProfileActivity : initRestartBtnClickListener() } + override fun onResume() { + super.onResume() + getUserInfo() + } + private fun getUserInfo() { profileViewModel.getUserInfoState() } diff --git a/presentation/src/main/java/com/going/presentation/profile/my/ProfileViewModel.kt b/presentation/src/main/java/com/going/presentation/profile/my/ProfileViewModel.kt index dd390654..76defeb9 100644 --- a/presentation/src/main/java/com/going/presentation/profile/my/ProfileViewModel.kt +++ b/presentation/src/main/java/com/going/presentation/profile/my/ProfileViewModel.kt @@ -3,6 +3,7 @@ package com.going.presentation.profile.my import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.going.domain.entity.request.UserProfileRequestModel +import com.going.domain.entity.response.UserProfileResponseModel import com.going.domain.repository.ProfileRepository import com.going.ui.state.UiState import dagger.hilt.android.lifecycle.HiltViewModel @@ -16,8 +17,8 @@ class ProfileViewModel @Inject constructor( private val profileRepository: ProfileRepository, ) : ViewModel() { - private val _userInfoState = MutableStateFlow>(UiState.Empty) - val userInfoState: StateFlow> = _userInfoState + private val _userInfoState = MutableStateFlow>(UiState.Empty) + val userInfoState: StateFlow> = _userInfoState val profileId = MutableStateFlow(0) From 43c9495093acfc2a35613f262608e3133c80ed27 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Fri, 8 Mar 2024 03:17:03 +0900 Subject: [PATCH 07/15] =?UTF-8?q?[FIX/#227]=20Splash=20=EB=A1=9C=EC=A7=81?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../onboarding/splash/SplashActivity.kt | 10 +---- .../onboarding/splash/SplashViewModel.kt | 37 ++++--------------- 2 files changed, 9 insertions(+), 38 deletions(-) diff --git a/presentation/src/main/java/com/going/presentation/onboarding/splash/SplashActivity.kt b/presentation/src/main/java/com/going/presentation/onboarding/splash/SplashActivity.kt index 25920af2..17b83af6 100644 --- a/presentation/src/main/java/com/going/presentation/onboarding/splash/SplashActivity.kt +++ b/presentation/src/main/java/com/going/presentation/onboarding/splash/SplashActivity.kt @@ -5,12 +5,10 @@ import android.os.Bundle import androidx.activity.viewModels import androidx.lifecycle.flowWithLifecycle import androidx.lifecycle.lifecycleScope -import com.going.domain.entity.AuthState import com.going.presentation.R import com.going.presentation.dashboard.DashBoardActivity import com.going.presentation.databinding.ActivitySplashBinding import com.going.presentation.onboarding.signin.SignInActivity -import com.going.presentation.tendency.splash.TendencySplashActivity import com.going.presentation.util.navigateToScreenClear import com.going.ui.base.BaseActivity import com.going.ui.extension.setNavigationBarColorFromResource @@ -46,12 +44,8 @@ class SplashActivity : BaseActivity(R.layout.activity_spl private fun observeUserState() { viewModel.userState.flowWithLifecycle(lifecycle).onEach { state -> - when (state) { - AuthState.LOADING -> return@onEach - AuthState.SUCCESS -> navigateToScreenClear() - AuthState.FAILURE -> navigateToScreenClear() - AuthState.OTHER_PAGE -> navigateToScreenClear() - } + if (state) navigateToScreenClear() + else navigateToScreenClear() }.launchIn(lifecycleScope) } diff --git a/presentation/src/main/java/com/going/presentation/onboarding/splash/SplashViewModel.kt b/presentation/src/main/java/com/going/presentation/onboarding/splash/SplashViewModel.kt index eca2a62a..70f316e1 100644 --- a/presentation/src/main/java/com/going/presentation/onboarding/splash/SplashViewModel.kt +++ b/presentation/src/main/java/com/going/presentation/onboarding/splash/SplashViewModel.kt @@ -3,56 +3,33 @@ package com.going.presentation.onboarding.splash import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.ViewModel import androidx.lifecycle.lifecycleScope -import androidx.lifecycle.viewModelScope -import com.going.domain.entity.AuthState -import com.going.domain.repository.AuthRepository import com.going.domain.repository.TokenRepository -import com.going.presentation.util.toErrorCode import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.delay -import kotlinx.coroutines.flow.MutableStateFlow -import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.flow.MutableSharedFlow +import kotlinx.coroutines.flow.SharedFlow import kotlinx.coroutines.launch import javax.inject.Inject @HiltViewModel class SplashViewModel @Inject constructor( - private val authRepository: AuthRepository, private val tokenRepository: TokenRepository, ) : ViewModel() { - private val _userState = MutableStateFlow(AuthState.LOADING) - val userState: StateFlow = _userState + private val _userState = MutableSharedFlow() + val userState: SharedFlow + get() = _userState + private fun getHasAccessToken(): Boolean = tokenRepository.getAccessToken().isNotBlank() fun initSplash(lifecycleOwner: LifecycleOwner) { lifecycleOwner.lifecycleScope.launch { delay(DELAY_TIME) - if (getHasAccessToken()) { - getUserState() - } else { - _userState.value = AuthState.FAILURE - } + _userState.emit(getHasAccessToken()) } } - private fun getUserState() = - viewModelScope.launch { - authRepository.getSplash().onSuccess { - _userState.value = AuthState.SUCCESS - }.onFailure { - val errorCode = toErrorCode(it) - - _userState.value = when (errorCode) { - TENDENCY -> AuthState.OTHER_PAGE - else -> AuthState.FAILURE - } - } - } - companion object { private const val DELAY_TIME = 2200L - - private const val TENDENCY = "e4045" } } From 3c92910be3c89363f9467b06c3fef16a8b11d678 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Fri, 8 Mar 2024 03:20:10 +0900 Subject: [PATCH 08/15] =?UTF-8?q?[CHORE/#227]=20=EB=AF=B8=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=20xml=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/layout/activity_mock.xml | 48 ------------------- 1 file changed, 48 deletions(-) delete mode 100644 presentation/src/main/res/layout/activity_mock.xml diff --git a/presentation/src/main/res/layout/activity_mock.xml b/presentation/src/main/res/layout/activity_mock.xml deleted file mode 100644 index 91ac8195..00000000 --- a/presentation/src/main/res/layout/activity_mock.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From df0bff9037200b328aa3b5bd46890062c7783aba Mon Sep 17 00:00:00 2001 From: Dongmin Date: Fri, 8 Mar 2024 03:22:59 +0900 Subject: [PATCH 09/15] =?UTF-8?q?[CHORE/#227]=20windowSoftInputMode=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 12ac7016..8da8985c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -157,6 +157,7 @@ Date: Fri, 8 Mar 2024 03:27:05 +0900 Subject: [PATCH 10/15] =?UTF-8?q?[ADD/#227]=20=EC=9D=B4=EB=AF=B8=EC=A7=80?= =?UTF-8?q?=20=EC=A0=80=EC=9E=A5=20=ED=85=8D=EC=8A=A4=ED=8A=B8=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EB=B0=8F=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/going/presentation/profile/edit/ProfileEditActivity.kt | 2 +- presentation/src/main/res/values/strings.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/presentation/src/main/java/com/going/presentation/profile/edit/ProfileEditActivity.kt b/presentation/src/main/java/com/going/presentation/profile/edit/ProfileEditActivity.kt index 1db5a4c0..47c5542b 100644 --- a/presentation/src/main/java/com/going/presentation/profile/edit/ProfileEditActivity.kt +++ b/presentation/src/main/java/com/going/presentation/profile/edit/ProfileEditActivity.kt @@ -94,7 +94,7 @@ class ProfileEditActivity : private fun observeIsChangedSuccess() { viewModel.isChangedSuccess.flowWithLifecycle(lifecycle).onEach { if (it) { - toast(getString(R.string.todo_change_toast_success)) + toast(getString(R.string.edit_profile_finish)) finish() } else toast(getString(R.string.server_error)) }.launchIn(lifecycleScope) diff --git a/presentation/src/main/res/values/strings.xml b/presentation/src/main/res/values/strings.xml index 9d60dc71..093d3cc8 100644 --- a/presentation/src/main/res/values/strings.xml +++ b/presentation/src/main/res/values/strings.xml @@ -240,6 +240,7 @@ - 나가기 수정하기 + 프로필을 수정했어요 선택하기 %1$d.%2$d.%3$d 시작일을 먼저 입력해 주세요 From a2be65f0a590126436055e838f34e96cd819b992 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Fri, 8 Mar 2024 13:26:05 +0900 Subject: [PATCH 11/15] =?UTF-8?q?[FEAT/#227]=20viewPager=20=EA=B4=80?= =?UTF-8?q?=EB=A0=A8=20=EC=98=A4=EB=A5=98=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../profile/participant/ParticipantProfileActivity.kt | 7 ++++++- .../tripprofiletag/profiletag/TripProfileTagFragment.kt | 3 +++ .../src/main/res/layout/fragment_trip_profile_tag.xml | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/presentation/src/main/java/com/going/presentation/profile/participant/ParticipantProfileActivity.kt b/presentation/src/main/java/com/going/presentation/profile/participant/ParticipantProfileActivity.kt index 680be390..d959aa2a 100644 --- a/presentation/src/main/java/com/going/presentation/profile/participant/ParticipantProfileActivity.kt +++ b/presentation/src/main/java/com/going/presentation/profile/participant/ParticipantProfileActivity.kt @@ -3,6 +3,7 @@ package com.going.presentation.profile.participant import android.content.Context import android.content.Intent import android.os.Bundle +import android.util.Log import androidx.activity.viewModels import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.core.view.isVisible @@ -14,6 +15,7 @@ import com.going.domain.entity.response.ParticipantProfileResponseModel import com.going.presentation.R import com.going.presentation.databinding.ActivityParticipantProfileBinding import com.going.presentation.profile.edit.ProfileEditActivity +import com.going.presentation.profile.trip.tripprofiletag.profiletag.TripProfileTagFragment import com.going.presentation.tendency.result.UserTendencyResultList import com.going.presentation.util.downloadImage import com.going.ui.base.BaseActivity @@ -112,6 +114,9 @@ class ParticipantProfileActivity : setFragmentHeight(this) if (this) binding.appbarTripProfile.setExpanded(true) + + val myFragment = supportFragmentManager.findFragmentByTag("f" + binding.vpTripProfile.currentItem) + if (myFragment is TripProfileTagFragment) myFragment.scrollTop() } binding.vpTripProfile.currentItem = tab.position @@ -145,7 +150,7 @@ class ParticipantProfileActivity : binding.vpTripProfile.layoutParams = binding.vpTripProfile.layoutParams.also { it.height = - if (temp) displayHeight - toolbarHeight - appBarHeight - tabHeight else displayHeight - toolbarHeight + if (temp) displayHeight - toolbarHeight - appBarHeight - tabHeight else displayHeight - toolbarHeight - tabHeight } } diff --git a/presentation/src/main/java/com/going/presentation/profile/trip/tripprofiletag/profiletag/TripProfileTagFragment.kt b/presentation/src/main/java/com/going/presentation/profile/trip/tripprofiletag/profiletag/TripProfileTagFragment.kt index 77b05dc1..5a5543d6 100644 --- a/presentation/src/main/java/com/going/presentation/profile/trip/tripprofiletag/profiletag/TripProfileTagFragment.kt +++ b/presentation/src/main/java/com/going/presentation/profile/trip/tripprofiletag/profiletag/TripProfileTagFragment.kt @@ -47,4 +47,7 @@ class TripProfileTagFragment : } } + fun scrollTop() { + binding.testNV.scrollTo(0, 0) + } } diff --git a/presentation/src/main/res/layout/fragment_trip_profile_tag.xml b/presentation/src/main/res/layout/fragment_trip_profile_tag.xml index b13502f5..d791a540 100644 --- a/presentation/src/main/res/layout/fragment_trip_profile_tag.xml +++ b/presentation/src/main/res/layout/fragment_trip_profile_tag.xml @@ -8,6 +8,7 @@ From 50fd32a3ef7e2ee51b9bb1f3a83b025460f3e627 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Fri, 8 Mar 2024 13:27:08 +0900 Subject: [PATCH 12/15] =?UTF-8?q?[CHORE/#227]=20=EB=84=A4=EC=9D=B4?= =?UTF-8?q?=EB=B0=8D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trip/tripprofiletag/profiletag/TripProfileTagFragment.kt | 4 +--- .../src/main/res/layout/fragment_trip_profile_tag.xml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/presentation/src/main/java/com/going/presentation/profile/trip/tripprofiletag/profiletag/TripProfileTagFragment.kt b/presentation/src/main/java/com/going/presentation/profile/trip/tripprofiletag/profiletag/TripProfileTagFragment.kt index 5a5543d6..ae87a5a8 100644 --- a/presentation/src/main/java/com/going/presentation/profile/trip/tripprofiletag/profiletag/TripProfileTagFragment.kt +++ b/presentation/src/main/java/com/going/presentation/profile/trip/tripprofiletag/profiletag/TripProfileTagFragment.kt @@ -47,7 +47,5 @@ class TripProfileTagFragment : } } - fun scrollTop() { - binding.testNV.scrollTo(0, 0) - } + fun scrollTop() = binding.nsvPreferenceTag.scrollTo(0, 0) } diff --git a/presentation/src/main/res/layout/fragment_trip_profile_tag.xml b/presentation/src/main/res/layout/fragment_trip_profile_tag.xml index d791a540..422c25de 100644 --- a/presentation/src/main/res/layout/fragment_trip_profile_tag.xml +++ b/presentation/src/main/res/layout/fragment_trip_profile_tag.xml @@ -8,7 +8,7 @@ From 973683d691322c60b08cb73597d0638405a7ae1d Mon Sep 17 00:00:00 2001 From: Dongmin Date: Fri, 8 Mar 2024 14:06:39 +0900 Subject: [PATCH 13/15] =?UTF-8?q?[CHORE/#227]=20=EB=B6=88=ED=95=84?= =?UTF-8?q?=EC=9A=94=20=ED=85=8D=EC=8A=A4=ED=8A=B8=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/going/data/repositoryImpl/ProfileRepositoryImpl.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/src/main/java/com/going/data/repositoryImpl/ProfileRepositoryImpl.kt b/data/src/main/java/com/going/data/repositoryImpl/ProfileRepositoryImpl.kt index cc8e4f97..c1f413ed 100644 --- a/data/src/main/java/com/going/data/repositoryImpl/ProfileRepositoryImpl.kt +++ b/data/src/main/java/com/going/data/repositoryImpl/ProfileRepositoryImpl.kt @@ -19,7 +19,7 @@ class ProfileRepositoryImpl @Inject constructor( } override suspend fun patchUserProfile(userProfileResponseModel: UserProfileRequestModel): Result = - kotlin.runCatching { + runCatching { profileDataSource.patchUserProfile(userProfileResponseModel.toDto()) } From 584ed41b2b6dfc3a413bf39726f7646f048633b6 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Fri, 8 Mar 2024 14:40:01 +0900 Subject: [PATCH 14/15] =?UTF-8?q?[CHORE/#227]=20black=5F000=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/todo/mytodo/todolist/MyTodoListViewHolder.kt | 2 +- .../todo/ourtodo/todolist/OurTodoListViewHolder.kt | 2 +- .../res/drawable/layer_list_trip_dash_board_view_pager.xml | 4 ++-- presentation/src/main/res/layout/activity_create_trip.xml | 4 ++-- presentation/src/main/res/values/colors.xml | 1 - 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/presentation/src/main/java/com/going/presentation/todo/mytodo/todolist/MyTodoListViewHolder.kt b/presentation/src/main/java/com/going/presentation/todo/mytodo/todolist/MyTodoListViewHolder.kt index 16c28562..bea34144 100644 --- a/presentation/src/main/java/com/going/presentation/todo/mytodo/todolist/MyTodoListViewHolder.kt +++ b/presentation/src/main/java/com/going/presentation/todo/mytodo/todolist/MyTodoListViewHolder.kt @@ -39,7 +39,7 @@ class MyTodoListViewHolder( ivMyTodoLock.setImageResource(R.drawable.ic_lock_complete) tvMyTodoLock.setTextColor(binding.root.context.colorOf(R.color.gray_300)) } else { - tvMyTodoItemTitle.setTextColor(binding.root.context.colorOf(R.color.black_000)) + tvMyTodoItemTitle.setTextColor(binding.root.context.colorOf(R.color.gray_700)) tvMyTodoItemDate.setTextColor(binding.root.context.colorOf(R.color.gray_300)) layoutMyTodoLock.setBackgroundResource(R.drawable.shape_rect_2_gray400_line) ivMyTodoLock.setImageResource(R.drawable.ic_lock_uncomplete) diff --git a/presentation/src/main/java/com/going/presentation/todo/ourtodo/todolist/OurTodoListViewHolder.kt b/presentation/src/main/java/com/going/presentation/todo/ourtodo/todolist/OurTodoListViewHolder.kt index 416c422c..ded7c72c 100644 --- a/presentation/src/main/java/com/going/presentation/todo/ourtodo/todolist/OurTodoListViewHolder.kt +++ b/presentation/src/main/java/com/going/presentation/todo/ourtodo/todolist/OurTodoListViewHolder.kt @@ -34,7 +34,7 @@ class OurTodoListViewHolder( tvOurTodoItemTitle.setTextColor(binding.root.context.colorOf(R.color.gray_300)) tvOurTodoItemDate.setTextColor(binding.root.context.colorOf(R.color.gray_200)) } else { - tvOurTodoItemTitle.setTextColor(binding.root.context.colorOf(R.color.black_000)) + tvOurTodoItemTitle.setTextColor(binding.root.context.colorOf(R.color.gray_700)) tvOurTodoItemDate.setTextColor(binding.root.context.colorOf(R.color.gray_300)) } diff --git a/presentation/src/main/res/drawable/layer_list_trip_dash_board_view_pager.xml b/presentation/src/main/res/drawable/layer_list_trip_dash_board_view_pager.xml index 8f662551..5948dab2 100644 --- a/presentation/src/main/res/drawable/layer_list_trip_dash_board_view_pager.xml +++ b/presentation/src/main/res/drawable/layer_list_trip_dash_board_view_pager.xml @@ -3,12 +3,12 @@ - + - + \ No newline at end of file diff --git a/presentation/src/main/res/layout/activity_create_trip.xml b/presentation/src/main/res/layout/activity_create_trip.xml index a06b86d3..70a21aaf 100644 --- a/presentation/src/main/res/layout/activity_create_trip.xml +++ b/presentation/src/main/res/layout/activity_create_trip.xml @@ -110,7 +110,7 @@ android:layout_height="wrap_content" android:layout_marginTop="37dp" android:text="@string/create_trip_one_line_info_tv_title" - android:textColor="@color/black_000" + android:textColor="@color/gray_700" app:layout_constraintStart_toStartOf="@id/et_create_trip_name" app:layout_constraintTop_toBottomOf="@id/et_create_trip_name" /> @@ -141,7 +141,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/create_trip_slash" - android:textColor="@color/black_000" + android:textColor="@color/gray_700" app:layout_constraintStart_toStartOf="@id/et_create_trip_name" app:layout_constraintTop_toBottomOf="@id/et_create_trip_name" /> diff --git a/presentation/src/main/res/values/colors.xml b/presentation/src/main/res/values/colors.xml index 86d36625..f0a9e77f 100644 --- a/presentation/src/main/res/values/colors.xml +++ b/presentation/src/main/res/values/colors.xml @@ -11,7 +11,6 @@ #FFFFFF - #151515 #F3F3F6 #E4E5ED From 75ff1bddc790a73cfb050ec88b20a5b3db0a3d33 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Fri, 8 Mar 2024 15:03:55 +0900 Subject: [PATCH 15/15] =?UTF-8?q?[CHORE/#227]=20custom=20Snackbar=20?= =?UTF-8?q?=EC=9D=BC=EB=B6=80=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../going/presentation/profile/edit/ProfileEditActivity.kt | 3 ++- .../profile/participant/ParticipantProfileActivity.kt | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/presentation/src/main/java/com/going/presentation/profile/edit/ProfileEditActivity.kt b/presentation/src/main/java/com/going/presentation/profile/edit/ProfileEditActivity.kt index 47c5542b..d1422875 100644 --- a/presentation/src/main/java/com/going/presentation/profile/edit/ProfileEditActivity.kt +++ b/presentation/src/main/java/com/going/presentation/profile/edit/ProfileEditActivity.kt @@ -9,6 +9,7 @@ import androidx.lifecycle.flowWithLifecycle import androidx.lifecycle.lifecycleScope import com.going.presentation.R import com.going.presentation.databinding.ActivityProfileEditBinding +import com.going.presentation.designsystem.snackbar.customSnackBar import com.going.ui.base.BaseActivity import com.going.ui.extension.setOnSingleClickListener import com.going.ui.extension.toast @@ -96,7 +97,7 @@ class ProfileEditActivity : if (it) { toast(getString(R.string.edit_profile_finish)) finish() - } else toast(getString(R.string.server_error)) + } else customSnackBar(binding.root, getString(R.string.server_error)) }.launchIn(lifecycleScope) } diff --git a/presentation/src/main/java/com/going/presentation/profile/participant/ParticipantProfileActivity.kt b/presentation/src/main/java/com/going/presentation/profile/participant/ParticipantProfileActivity.kt index d959aa2a..ae0147e1 100644 --- a/presentation/src/main/java/com/going/presentation/profile/participant/ParticipantProfileActivity.kt +++ b/presentation/src/main/java/com/going/presentation/profile/participant/ParticipantProfileActivity.kt @@ -3,7 +3,6 @@ package com.going.presentation.profile.participant import android.content.Context import android.content.Intent import android.os.Bundle -import android.util.Log import androidx.activity.viewModels import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.core.view.isVisible @@ -14,6 +13,7 @@ import coil.transform.CircleCropTransformation import com.going.domain.entity.response.ParticipantProfileResponseModel import com.going.presentation.R import com.going.presentation.databinding.ActivityParticipantProfileBinding +import com.going.presentation.designsystem.snackbar.customSnackBar import com.going.presentation.profile.edit.ProfileEditActivity import com.going.presentation.profile.trip.tripprofiletag.profiletag.TripProfileTagFragment import com.going.presentation.tendency.result.UserTendencyResultList @@ -56,7 +56,7 @@ class ParticipantProfileActivity : private fun observeParticipantProfileState() { participantProfileViewModel.participantProfile.flowWithLifecycle(lifecycle).onEach { - it?.let { bindData(it) } ?: toast(getString(R.string.server_error)) + it?.let { bindData(it) } ?: customSnackBar(binding.root, getString(R.string.server_error)) }.launchIn(lifecycleScope) } @@ -115,7 +115,8 @@ class ParticipantProfileActivity : if (this) binding.appbarTripProfile.setExpanded(true) - val myFragment = supportFragmentManager.findFragmentByTag("f" + binding.vpTripProfile.currentItem) + val myFragment = + supportFragmentManager.findFragmentByTag("f" + binding.vpTripProfile.currentItem) if (myFragment is TripProfileTagFragment) myFragment.scrollTop() }