-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
#74 : 차단된 메세지 리스트업 및 차단 해제 구현
- Loading branch information
Showing
31 changed files
with
450 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
core/model/src/main/kotlin/com/bff/wespot/model/message/Sender.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.bff.wespot.model.message | ||
|
||
data class Sender( | ||
val id: Int, | ||
val backgroundColor: String, | ||
val iconUrl: String, | ||
) { | ||
constructor() : this(-1, "", "") | ||
} |
19 changes: 19 additions & 0 deletions
19
core/model/src/main/kotlin/com/bff/wespot/model/message/response/BlockedMessage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.bff.wespot.model.message.response | ||
|
||
import com.bff.wespot.model.message.Sender | ||
import com.bff.wespot.model.user.response.User | ||
import java.time.LocalDateTime | ||
|
||
data class BlockedMessage( | ||
val id: Int, | ||
val senderName: String, | ||
val senderProfile: Sender, | ||
val receiver: User, | ||
val content: String, | ||
val receivedAt: LocalDateTime?, | ||
val isRead: Boolean, | ||
val isReported: Boolean, | ||
val isBlocked: Boolean, | ||
) { | ||
constructor() : this(-1, "", Sender(), User(), "", LocalDateTime.MIN, false, false, false) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 111 additions & 0 deletions
111
core/ui/src/main/kotlin/com/bff/wespot/ui/ReservedMessageItem.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
package com.bff.wespot.ui | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.foundation.shape.CircleShape | ||
import androidx.compose.material3.FilterChip | ||
import androidx.compose.material3.FilterChipDefaults | ||
import androidx.compose.material3.HorizontalDivider | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.clip | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.platform.LocalContext | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.unit.dp | ||
import coil.compose.AsyncImage | ||
import coil.request.ImageRequest | ||
import com.bff.wespot.designsystem.theme.Gray400 | ||
import com.bff.wespot.designsystem.theme.Gray600 | ||
import com.bff.wespot.designsystem.theme.StaticTypeScale | ||
import com.bff.wespot.designsystem.theme.WeSpotThemeManager | ||
import com.bff.wespot.util.hexToColor | ||
|
||
@Composable | ||
fun ReservedMessageItem( | ||
title: String, | ||
subTitle: String, | ||
backgroundColor: String, | ||
iconUrl: String, | ||
chipText: String, | ||
chipEnabled: Boolean = true, | ||
chipDisabledText: String = "", | ||
onClick: () -> Unit, | ||
) { | ||
Column { | ||
Row( | ||
modifier = Modifier.padding(start = 18.dp, end = 18.dp, top = 12.dp), | ||
verticalAlignment = Alignment.CenterVertically, | ||
) { | ||
Box( | ||
modifier = Modifier | ||
.size(42.dp) | ||
.clip(CircleShape) | ||
.background( | ||
runCatching { | ||
hexToColor(backgroundColor) | ||
}.getOrDefault(WeSpotThemeManager.colors.cardBackgroundColor), | ||
), | ||
contentAlignment = Alignment.Center, | ||
) { | ||
AsyncImage( | ||
model = ImageRequest.Builder(LocalContext.current) | ||
.data(iconUrl) | ||
.crossfade(true) | ||
.build(), | ||
contentDescription = stringResource(com.bff.wespot.ui.R.string.user_character_image), | ||
) | ||
} | ||
|
||
Column( | ||
modifier = Modifier | ||
.padding(horizontal = 10.dp) | ||
.weight(1f), | ||
) { | ||
Text( | ||
text = title, | ||
style = StaticTypeScale.Default.body6, | ||
color = WeSpotThemeManager.colors.txtSubColor, | ||
) | ||
|
||
Text( | ||
text = subTitle, | ||
style = StaticTypeScale.Default.body6, | ||
color = WeSpotThemeManager.colors.txtTitleColor, | ||
) | ||
} | ||
|
||
FilterChip( | ||
shape = WeSpotThemeManager.shapes.extraLarge, | ||
onClick = { onClick() }, | ||
selected = false, | ||
label = { | ||
Text( | ||
text = if (chipEnabled) chipText else chipDisabledText, | ||
style = StaticTypeScale.Default.body6, | ||
) | ||
}, | ||
enabled = chipEnabled, | ||
border = null, | ||
colors = FilterChipDefaults.filterChipColors( | ||
containerColor = WeSpotThemeManager.colors.secondaryBtnColor, | ||
labelColor = Color(0xFFF7F7F8), | ||
disabledContainerColor = Gray600, | ||
disabledLabelColor = Gray400, | ||
), | ||
) | ||
} | ||
|
||
HorizontalDivider( | ||
modifier = Modifier.padding(top = 24.dp, start = 24.dp, end = 24.dp), | ||
thickness = 1.dp, | ||
color = WeSpotThemeManager.colors.cardBackgroundColor, | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="user_character_image">User Character Image</string> | ||
<string name="message_edit">수정하기</string> | ||
<string name="school_icon">school icon</string> | ||
<string name="select_character">%1$s님을 잘 나타낼 수 있는 \n캐릭터를 선택해 주세요</string> | ||
<string name="character">캐릭터 고르기</string> | ||
<string name="background">배경 색 고르기</string> | ||
<string name="complete">선택 완료</string> | ||
<string name="introduce_to_friend">친구들에게 %1$s을 소개하는 한 줄을 작성해주세요</string> | ||
<string name="introduction_placeholder">안녕 나는 1반의 비타민</string> | ||
<string name="edit_complete">작성 완료</string> | ||
</resources> | ||
</resources> |
36 changes: 36 additions & 0 deletions
36
...te/src/main/kotlin/com/bff/wespot/data/remote/model/message/response/BlockedMessageDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.bff.wespot.data.remote.model.message.response | ||
|
||
import com.bff.wespot.data.remote.extensions.toISOLocalDateTime | ||
import com.bff.wespot.data.remote.model.user.response.UserDto | ||
import com.bff.wespot.model.message.response.BlockedMessage | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class BlockedMessageListDto( | ||
val messages: List<BlockedMessageDto>, | ||
) | ||
|
||
@Serializable | ||
data class BlockedMessageDto( | ||
val id: Int, | ||
val senderName: String, | ||
val senderProfile: SenderDto, | ||
val receiver: UserDto, | ||
val content: String, | ||
val receivedAt: String?, | ||
val isRead: Boolean, | ||
val isReported: Boolean, | ||
val isBlocked: Boolean, | ||
) { | ||
fun toBlockedMessage(): BlockedMessage = BlockedMessage( | ||
id = id, | ||
senderName = senderName, | ||
senderProfile = senderProfile.toSender(), | ||
receiver = receiver.toUser(), | ||
content = content, | ||
receivedAt = receivedAt?.toISOLocalDateTime(), | ||
isRead = isRead, | ||
isReported = isReported, | ||
isBlocked = isBlocked, | ||
) | ||
} |
17 changes: 17 additions & 0 deletions
17
data-remote/src/main/kotlin/com/bff/wespot/data/remote/model/message/response/SenderDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.bff.wespot.data.remote.model.message.response | ||
|
||
import com.bff.wespot.model.message.Sender | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class SenderDto ( | ||
val id: Int, | ||
val backgroundColor: String, | ||
val iconUrl: String, | ||
) { | ||
fun toSender(): Sender = Sender( | ||
id = id, | ||
backgroundColor = backgroundColor, | ||
iconUrl = iconUrl, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.