diff --git a/android/app/src/main/java/com/happy/friendogly/presentation/ui/club/common/mapper/ClubDetailMapper.kt b/android/app/src/main/java/com/happy/friendogly/presentation/ui/club/common/mapper/ClubDetailMapper.kt
index e066599cf..c5bbb4830 100644
--- a/android/app/src/main/java/com/happy/friendogly/presentation/ui/club/common/mapper/ClubDetailMapper.kt
+++ b/android/app/src/main/java/com/happy/friendogly/presentation/ui/club/common/mapper/ClubDetailMapper.kt
@@ -1,6 +1,7 @@
package com.happy.friendogly.presentation.ui.club.common.mapper
import com.happy.friendogly.domain.model.ClubDetail
+import com.happy.friendogly.domain.model.ClubState
import com.happy.friendogly.presentation.ui.club.detail.model.ClubDetailUiModel
import com.happy.friendogly.presentation.ui.club.detail.model.ClubDetailViewType
@@ -10,7 +11,10 @@ fun ClubDetail.toPresentation(): ClubDetailUiModel {
filters = allowedGender.toGenderGroupFilters() + allowedSize.toSizeGroupFilters(),
content = content,
title = title,
- petProfiles = petDetails.map { it.toPresentation() },
+ petProfiles =
+ petDetails
+ .map { it.toPresentation() }
+ .sortedByDescending { it.isMyPet },
userProfiles = memberDetails.map { it.toPresentation() },
clubDate = createdAt,
currentNumberOfPeople = currentMemberCount,
@@ -24,6 +28,7 @@ fun ClubDetail.toPresentation(): ClubDetailUiModel {
clubDetailViewType =
ClubDetailViewType.from(
isMine = isMine,
+ isOpenState = status == ClubState.OPEN,
isMyParticipated = alreadyParticipate,
canParticipation = canParticipate,
isUserPetEmpty = isMyPetsEmpty,
diff --git a/android/app/src/main/java/com/happy/friendogly/presentation/ui/club/detail/ClubDetailBindingAdapters.kt b/android/app/src/main/java/com/happy/friendogly/presentation/ui/club/detail/ClubDetailBindingAdapters.kt
index 11b1e93e1..9898bb44a 100644
--- a/android/app/src/main/java/com/happy/friendogly/presentation/ui/club/detail/ClubDetailBindingAdapters.kt
+++ b/android/app/src/main/java/com/happy/friendogly/presentation/ui/club/detail/ClubDetailBindingAdapters.kt
@@ -18,7 +18,7 @@ fun TextView.bindDetailViewTypeBackground(clubDetailViewType: ClubDetailViewType
R.color.coral400,
)
- ClubDetailViewType.END_RECRUITMENT ->
+ ClubDetailViewType.END_RECRUITMENT, ClubDetailViewType.NO_AVAILABLE_PET ->
ContextCompat.getColorStateList(
context,
R.color.gray300,
@@ -35,6 +35,7 @@ fun TextView.bindDetailViewTypeText(clubDetailViewType: ClubDetailViewType?) {
ClubDetailViewType.RECRUITMENT -> context.getString(R.string.club_detail_participate_text)
ClubDetailViewType.END_RECRUITMENT -> context.getString(R.string.club_detail_un_participate_text)
ClubDetailViewType.MINE, ClubDetailViewType.PARTICIPATED -> context.getString(R.string.club_detail_mine_text)
+ ClubDetailViewType.NO_AVAILABLE_PET -> context.getString(R.string.club_detail_no_available_pet)
}
this.text = text
}
@@ -49,7 +50,9 @@ fun TextView.bindDetailViewTypeStyle(clubDetailViewType: ClubDetailViewType?) {
ClubDetailViewType.MINE,
-> R.style.Theme_AppCompat_TextView_SemiBold_White_Size14
- ClubDetailViewType.END_RECRUITMENT -> R.style.Theme_AppCompat_TextView_SemiBold_Gray07_Size14
+ ClubDetailViewType.END_RECRUITMENT,
+ ClubDetailViewType.NO_AVAILABLE_PET,
+ -> R.style.Theme_AppCompat_TextView_SemiBold_Gray07_Size14
}
this.setTextAppearance(textStyle)
}
diff --git a/android/app/src/main/java/com/happy/friendogly/presentation/ui/club/detail/model/ClubDetailViewType.kt b/android/app/src/main/java/com/happy/friendogly/presentation/ui/club/detail/model/ClubDetailViewType.kt
index 453cf4720..5910170c8 100644
--- a/android/app/src/main/java/com/happy/friendogly/presentation/ui/club/detail/model/ClubDetailViewType.kt
+++ b/android/app/src/main/java/com/happy/friendogly/presentation/ui/club/detail/model/ClubDetailViewType.kt
@@ -5,11 +5,13 @@ enum class ClubDetailViewType {
END_RECRUITMENT,
PARTICIPATED,
MINE,
+ NO_AVAILABLE_PET,
;
companion object {
fun from(
isMine: Boolean,
+ isOpenState: Boolean,
isMyParticipated: Boolean,
canParticipation: Boolean,
isUserPetEmpty: Boolean,
@@ -20,6 +22,8 @@ enum class ClubDetailViewType {
PARTICIPATED
} else if (canParticipation or isUserPetEmpty) {
RECRUITMENT
+ } else if (!canParticipation && isOpenState) {
+ NO_AVAILABLE_PET
} else {
END_RECRUITMENT
}
diff --git a/android/app/src/main/java/com/happy/friendogly/presentation/ui/club/menu/ClubMenuBindingAdapters.kt b/android/app/src/main/java/com/happy/friendogly/presentation/ui/club/menu/ClubMenuBindingAdapters.kt
index 1b8a5f335..c6bfa2208 100644
--- a/android/app/src/main/java/com/happy/friendogly/presentation/ui/club/menu/ClubMenuBindingAdapters.kt
+++ b/android/app/src/main/java/com/happy/friendogly/presentation/ui/club/menu/ClubMenuBindingAdapters.kt
@@ -11,7 +11,9 @@ fun FrameLayout.bindMyParticipation(clubDetailViewType: ClubDetailViewType) {
when (clubDetailViewType) {
ClubDetailViewType.RECRUITMENT,
ClubDetailViewType.END_RECRUITMENT,
+ ClubDetailViewType.NO_AVAILABLE_PET,
-> false
+
ClubDetailViewType.PARTICIPATED,
ClubDetailViewType.MINE,
-> true
diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml
index 052da06f1..edb5ff98e 100644
--- a/android/app/src/main/res/values/strings.xml
+++ b/android/app/src/main/res/values/strings.xml
@@ -200,6 +200,7 @@
참여하기
모집종료
모임보기
+ 참여 불가
수정하기
방나가기
신고하기