Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<resources>
<string name="app_name">Dplay</string>
<string name="app_name">디플레이</string>
<string name="notification_title">디플레이</string>
<string name="notification_content">오늘의 질문이 도착했어요</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class AuthRemoteDataSource

suspend fun reissue(refreshToken: String): TokenResponse {
try {
val response = authService.reissue(refreshToken = refreshToken)
val response = authService.reissue(refreshToken = "Bearer $refreshToken")
return response.data ?: throw Exception("Data is null")
} catch (e: Exception) {
throw e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class QuestionPostsPagingSource(
private val postService: PostService,
private val questionId: Long,
private val onTotalCountFetched: (Int) -> Unit,
private val onLockedFetched: (Boolean) -> Unit,
) : PagingSource<String, QuestionPostItemResponse>() {
override fun getRefreshKey(state: PagingState<String, QuestionPostItemResponse>): String? = null

Expand All @@ -26,6 +27,7 @@ class QuestionPostsPagingSource(
val data = response.data ?: throw Exception("data is null")
if (params.key == null) {
onTotalCountFetched(data.totalCount)
onLockedFetched(data.locked)
}
val posts = data.items
val nextCursor = data.nextCursor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.example.data.mapper.todomain
import com.example.data.model.response.TodayPostItemResponse
import com.example.data.model.response.TodayPostTrackResponse
import com.example.data.model.response.TodayPostsResponse
import com.example.domain.model.BADGE
import com.example.domain.model.Badge
import com.example.domain.model.DailyQuestion
import com.example.domain.model.FeedItem
import com.example.domain.model.HomeScreenData
Expand All @@ -28,7 +28,7 @@ fun TodayPostItemResponse.toDomain(): FeedItem =
postId = postId,
isScrapped = isScrapped,
content = content,
badge = badge?.let { BADGE.valueOf(it) },
badge = badge?.let { Badge.valueOf(it) },
track = track.toDomain(),
writer = user.toDomain(),
like = like.toDomain(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ fun UserResponse.toDomain(): Writer =
userId = this.userId,
nickname = this.nickname,
profileImg = this.profileImg,
isAdmin = this.isAdmin,
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.example.data.model.response

import com.example.domain.model.BADGE
import com.example.domain.model.Badge
import com.example.domain.model.FeedItem
import com.example.domain.model.Like
import com.example.domain.model.Track
Expand Down Expand Up @@ -52,7 +52,7 @@ data class QuestionPostItemResponse(
postId = postId,
isScrapped = isScrapped,
content = content,
badge = if (isEditorPick) BADGE.EDITOR else null,
badge = if (isEditorPick) Badge.EDITOR else null,
track =
Track(
trackId = track.trackId,
Expand All @@ -66,6 +66,7 @@ data class QuestionPostItemResponse(
userId = user.userId,
nickname = user.nickname,
profileImg = user.profileImg.orEmpty(),
isAdmin = user.isAdmin,
),
like =
Like(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ data class UserResponse(
val nickname: String,
@SerialName("profileImg")
val profileImg: String?,
@SerialName("isAdmin")
val isAdmin: Boolean,
)
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class PostRepositoryImpl
override fun getPostsByQuestionId(
questionId: Long,
onTotalCountFetched: (Int) -> Unit,
onLockedFetched: (Boolean) -> Unit,
): Flow<PagingData<FeedItem>> =
Pager(
config =
Expand All @@ -101,6 +102,7 @@ class PostRepositoryImpl
postService = postService,
questionId = questionId,
onTotalCountFetched = onTotalCountFetched,
onLockedFetched = onLockedFetched,
)
},
).flow.map { pagingData ->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
package com.example.designsystem.component

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand All @@ -19,31 +24,45 @@ fun DPlayDayTopicItem(
onClick: () -> Unit,
modifier: Modifier = Modifier,
) {
Row(modifier = modifier.fillMaxWidth().noRippleClickable(onClick = onClick)) {
Text(
text = dayText,
Row(
modifier =
modifier
.fillMaxWidth()
.noRippleClickable(onClick = onClick),
) {
Box(
modifier =
Modifier
.size(50.dp)
.roundedBackgroundWithPadding(
backgroundColor = DPlayTheme.colors.gray600,
cornerRadius = 8.dp,
padding = PaddingValues(horizontal = 16.5.dp, vertical = 16.dp),
),
color = DPlayTheme.colors.gray100,
style = DPlayTheme.typography.bodyBold14,
)
Text(
text = topic,
contentAlignment = Alignment.Center,
) {
Text(
text = dayText,
color = DPlayTheme.colors.gray100,
style = DPlayTheme.typography.bodyBold14,
)
}
Box(
modifier =
Modifier
.height(50.dp)
.weight(1f)
.roundedBackgroundWithPadding(
backgroundColor = DPlayTheme.colors.gray100,
cornerRadius = 8.dp,
padding = PaddingValues(horizontal = 10.dp, vertical = 16.dp),
padding = PaddingValues(start = 10.dp),
),
style = DPlayTheme.typography.bodySemi14,
)
contentAlignment = Alignment.CenterStart,
) {
Text(
text = topic,
style = DPlayTheme.typography.bodySemi14,
)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import coil3.compose.AsyncImage
Expand Down Expand Up @@ -62,11 +63,15 @@ fun DPlayImageCheck(

Spacer(modifier = Modifier.width(12.dp))

Column {
Column(
modifier = Modifier.weight(1f),
) {
Text(
text = musicName,
style = DPlayTheme.typography.bodySemi16,
color = DPlayTheme.colors.dplayBlack,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)

Spacer(modifier = Modifier.height(4.dp))
Expand All @@ -75,11 +80,11 @@ fun DPlayImageCheck(
text = artistName,
style = DPlayTheme.typography.bodyMed14,
color = DPlayTheme.colors.gray400,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
}

Spacer(modifier = Modifier.weight(1f))

if (isChecked) {
DplayBaseIcon(
iconRes = R.drawable.ic_check_circle_darkgray_24,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import com.example.designsystem.util.noRippleClickable
@Composable
fun DPlayLargeCover(
isLikeChecked: Boolean,
isAdmin: Boolean,
likeCount: Int,
writerProfileImageUrl: String?,
writerNickname: String,
Expand Down Expand Up @@ -70,7 +71,12 @@ fun DPlayLargeCover(
}
}

Box(modifier = modifier.fillMaxWidth().clip(textCoverShape)) {
Box(
modifier =
modifier
.fillMaxWidth()
.clip(textCoverShape),
) {
Box(
modifier =
Modifier
Expand Down Expand Up @@ -141,7 +147,12 @@ fun DPlayLargeCover(
modifier = Modifier.noRippleClickable(onClick = onWriterProfileClick),
) {
AsyncImage(
model = writerProfileImageUrl ?: R.drawable.base_profile_image,
model =
if (isAdmin) {
R.drawable.img_profile
} else {
writerProfileImageUrl ?: R.drawable.base_profile_image
},
contentDescription = null,
modifier =
Modifier
Expand Down Expand Up @@ -206,7 +217,7 @@ fun DPlayLargeCover(
.background(
color = color.dplayWhite,
shape = RoundedCornerShape(16.dp),
).padding(10.dp),
).padding(6.dp),
onClick = onStreamClick,
)
}
Expand Down Expand Up @@ -250,6 +261,7 @@ private fun DPlayLockedLargeCoverPreview() {
onLikeClick = {},
onCoverClick = {},
onWriterProfileClick = {},
isAdmin = false,
)
}
}
Expand All @@ -270,6 +282,7 @@ private fun DPlayLargeCoverPreview() {
onCoverClick = {},
onWriterProfileClick = {},
isLocked = false,
isAdmin = false,
)
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.example.designsystem.component

import androidx.annotation.StringRes
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
Expand All @@ -25,8 +26,9 @@ import com.example.designsystem.util.roundedBackgroundWithPadding
@Composable
fun DplayTooltip(
onCloseButtonClicked: () -> Unit,
onTextButtonClicked: () -> Unit,
onTextButtonClicked: (() -> Unit)?,
modifier: Modifier = Modifier,
@StringRes textStringRes: Int = R.string.tooltip_default_description,
) {
Column(modifier = modifier) {
Box(
Expand Down Expand Up @@ -63,18 +65,20 @@ fun DplayTooltip(
Text(
style = DPlayTheme.typography.bodyMed14,
color = DPlayTheme.colors.dplayWhite,
text = stringResource(R.string.tooltip_default_description),
text = stringResource(textStringRes),
)
DplayClickableIcon(
iconRes = R.drawable.ic_close_24,
onClick = onCloseButtonClicked,
)
}
Spacer(modifier = Modifier.height(16.dp))
DPlayUnderlineTextButton(
onClick = onTextButtonClicked,
text = stringResource(R.string.tooltip_learn_more),
)
if (onTextButtonClicked != null) {
Spacer(modifier = Modifier.height(16.dp))
DPlayUnderlineTextButton(
onClick = onTextButtonClicked,
text = stringResource(R.string.tooltip_learn_more),
)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.example.designsystem.component.button

import androidx.annotation.StringRes
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
Expand All @@ -24,6 +25,7 @@ import com.example.designsystem.theme.DPlayTheme
@Composable
fun DPlayGuidelineButton(
onClick: () -> Unit,
@StringRes textStringRes: Int,
modifier: Modifier = Modifier,
) {
DPlayButtonSlot(
Expand All @@ -47,7 +49,7 @@ fun DPlayGuidelineButton(
)

Text(
text = stringResource(R.string.guideline_button_label),
text = stringResource(textStringRes),
style = DPlayTheme.typography.capMed12,
color = DPlayTheme.colors.gray400,
)
Expand All @@ -69,6 +71,7 @@ fun DPlayGuidelineButtonPreview() {
) {
DPlayGuidelineButton(
onClick = {},
textStringRes = R.string.guideline_button_label,
)
}
}
Expand Down
Binary file modified core/designsystem/src/main/res/drawable/img_key.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ data class FeedItem(
val postId: Long,
val isScrapped: Boolean,
val content: String,
val badge: BADGE?,
val badge: Badge?,
val track: Track,
val writer: Writer,
val like: Like,
)

enum class BADGE {
enum class Badge {
EDITOR,
BEST,
NEW,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ package com.example.domain.model

enum class UserRelation {
ME,
ADMIN,
OTHER;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ data class Writer(
val userId: Long,
val nickname: String,
val profileImg: String?,
val isAdmin: Boolean,
)
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ interface PostRepository {
fun getPostsByQuestionId(
questionId: Long,
onTotalCountFetched: (Int) -> Unit,
onLockedFetched: (Boolean) -> Unit,
): Flow<PagingData<FeedItem>>
}
Loading