Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ fun FlintBasicButton(
Text(
text = text,
color = contentColor,
style = if (enabled) FlintTheme.typography.body1Sb16 else FlintTheme.typography.body1M16,
style = if (state == FlintButtonState.Able) FlintTheme.typography.body1Sb16 else FlintTheme.typography.body1M16,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.unit.dp
import com.flint.core.designsystem.theme.FlintTheme

enum class FlintButtonState(
val enabled: Boolean,
) {
Able(enabled = true) {
enum class FlintButtonState() {
Able {
override val background: Brush
@Composable
@ReadOnlyComposable
Expand All @@ -29,7 +27,7 @@ enum class FlintButtonState(
get() = null
},

Disable(enabled = false) {
Disable {
override val background: Brush
@Composable
@ReadOnlyComposable
Expand All @@ -46,7 +44,7 @@ enum class FlintButtonState(
get() = null
},

Outline(enabled = true) {
Outline {
override val background: Brush
@Composable
@ReadOnlyComposable
Expand All @@ -63,7 +61,7 @@ enum class FlintButtonState(
get() = BorderStroke(2.dp, FlintTheme.colors.gray500)
},

ColorOutline(enabled = true) {
ColorOutline {
override val background: Brush
@Composable
@ReadOnlyComposable
Expand All @@ -78,7 +76,8 @@ enum class FlintButtonState(
@Composable
@ReadOnlyComposable
get() = BorderStroke(2.dp, FlintTheme.colors.primary400)
}, ;
},
;

abstract val background: Brush
@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ data class CollectionsResponseDto(
data class Collection(
@SerialName("collectionId") val collectionId: String,
@SerialName("imageUrl") val imageUrl: String,
@SerialName("title") val title: String,
@SerialName("description") val description: String,
@SerialName("contentTitle") val contentTitle: String,
@SerialName("contentDescription") val contentDescription: String,
)

@Serializable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ private fun BookmarkedCollectionItemResponseDto.toModel(): CollectionItemModel {
private fun CollectionsResponseDto.Collection.toModel(): CollectionsModel.Collection =
CollectionsModel.Collection(
collectionId = collectionId,
description = description,
contentDescription = contentDescription,
imageUrl = imageUrl,
title = title
contentTitle = contentTitle
)

private fun CollectionsResponseDto.Meta.toModel(): CollectionsModel.Meta =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ data class CollectionsModel(
) {
data class Collection(
val collectionId: String,
val description: String,
val contentDescription: String,
val imageUrl: String,
val title: String,
val contentTitle: String,
)

data class Meta(
Expand Down
34 changes: 20 additions & 14 deletions app/src/main/java/com/flint/presentation/explore/ExploreScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.defaultMinSize
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
Expand All @@ -23,6 +22,7 @@ import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextAlign
Expand Down Expand Up @@ -115,8 +115,8 @@ private fun ExploreScreen(
ExplorePageItem(
imageUrl = collection.imageUrl,
id = collection.collectionId,
title = collection.title,
description = collection.description,
contentTitle = collection.contentTitle,
contentDescription = collection.contentDescription,
onButtonClick = { onWatchCollectionButtonClick(it, collection.imageUrl) },
)
} else {
Expand All @@ -133,8 +133,8 @@ private fun ExploreScreen(
private fun ExplorePageItem(
imageUrl: String,
id: String,
title: String,
description: String,
contentTitle: String,
contentDescription: String,
onButtonClick: (collectionId: String) -> Unit,
modifier: Modifier = Modifier,
) {
Expand All @@ -153,14 +153,20 @@ private fun ExplorePageItem(
Box(
modifier =
Modifier
.background(brush = FlintTheme.colors.imgBlur)
.fillMaxWidth()
.aspectRatio(389f / 400f),
.background(
brush = Brush.verticalGradient(
colors = listOf(
Color(0xFF121212).copy(0f),
Color(0xFF121212).copy(1f)
),
)
)
.fillMaxSize(),
)

Column(modifier.padding(horizontal = 16.dp)) {
Text(
text = title,
text = contentTitle,
color = FlintTheme.colors.white,
style = FlintTheme.typography.display2M28,
maxLines = 2,
Expand All @@ -170,7 +176,7 @@ private fun ExplorePageItem(
Spacer(Modifier.height(12.dp))

Text(
text = description,
text = contentDescription,
color = FlintTheme.colors.white,
style = FlintTheme.typography.body1R16,
maxLines = 8,
Expand Down Expand Up @@ -200,8 +206,8 @@ private fun ExplorePageItemPreview() {
ExplorePageItem(
imageUrl = "https://buly.kr/G3Edbfu",
id = "",
title = "너의 모든 것".repeat(10),
description =
contentTitle = "너의 모든 것".repeat(10),
contentDescription =
"""
뉴욕의 서점 매니저이자 반듯한 독서가, 조.
그가 대학원생 벡을 만나 한눈에 반한다.
Expand Down Expand Up @@ -284,9 +290,9 @@ private fun ExploreScreenPreview() {
List(10) {
CollectionsModel.Collection(
collectionId = "0",
title = "너의 모든 것",
contentTitle = "너의 모든 것",
imageUrl = "https://buly.kr/G3Edbfu",
description =
contentDescription =
"""
뉴욕의 서점 매니저이자 반듯한 독서가, 조.
그가 대학원생 벡을 만나 한눈에 반한다.
Expand Down