|
1 | 1 | package com.ninecraft.booket.feature.detail.book |
2 | 2 |
|
| 3 | +import android.R.attr.onClick |
| 4 | +import android.R.attr.text |
| 5 | +import androidx.compose.foundation.layout.Column |
| 6 | +import androidx.compose.foundation.layout.Row |
| 7 | +import androidx.compose.foundation.layout.Spacer |
| 8 | +import androidx.compose.foundation.layout.fillMaxSize |
| 9 | +import androidx.compose.foundation.layout.fillMaxWidth |
| 10 | +import androidx.compose.foundation.layout.height |
| 11 | +import androidx.compose.foundation.layout.padding |
| 12 | +import androidx.compose.foundation.layout.size |
| 13 | +import androidx.compose.foundation.layout.width |
| 14 | +import androidx.compose.foundation.shape.RoundedCornerShape |
| 15 | +import androidx.compose.material3.Icon |
| 16 | +import androidx.compose.material3.Text |
| 17 | +import androidx.compose.material3.VerticalDivider |
3 | 18 | import androidx.compose.runtime.Composable |
| 19 | +import androidx.compose.ui.Alignment |
4 | 20 | import androidx.compose.ui.Modifier |
| 21 | +import androidx.compose.ui.draw.clip |
| 22 | +import androidx.compose.ui.graphics.vector.ImageVector |
| 23 | +import androidx.compose.ui.res.painterResource |
| 24 | +import androidx.compose.ui.res.vectorResource |
| 25 | +import androidx.compose.ui.text.style.TextOverflow |
| 26 | +import androidx.compose.ui.unit.dp |
5 | 27 | import com.ninecraft.booket.core.designsystem.ComponentPreview |
| 28 | +import com.ninecraft.booket.core.designsystem.R as designR |
| 29 | +import com.ninecraft.booket.core.designsystem.component.NetworkImage |
| 30 | +import com.ninecraft.booket.core.designsystem.component.ReedDivider |
| 31 | +import com.ninecraft.booket.core.designsystem.component.button.ReedButton |
| 32 | +import com.ninecraft.booket.core.designsystem.component.button.ReedButtonColorStyle |
| 33 | +import com.ninecraft.booket.core.designsystem.component.button.largeButtonStyle |
6 | 34 | import com.ninecraft.booket.core.designsystem.theme.ReedTheme |
7 | 35 | import com.ninecraft.booket.core.ui.component.ReedBackTopAppBar |
8 | 36 | import com.ninecraft.booket.core.ui.component.ReedFullScreen |
| 37 | +import com.ninecraft.booket.feature.detail.book.component.CollectedSeed |
9 | 38 | import com.ninecraft.booket.feature.screens.BookDetailScreen |
10 | 39 | import com.slack.circuit.codegen.annotations.CircuitInject |
11 | 40 | import dagger.hilt.android.components.ActivityRetainedComponent |
@@ -37,7 +66,103 @@ internal fun BookDetailContent( |
37 | 66 | state: BookDetailUiState, |
38 | 67 | modifier: Modifier = Modifier, |
39 | 68 | ) { |
40 | | - |
| 69 | + Column { |
| 70 | + Row( |
| 71 | + modifier = modifier |
| 72 | + .fillMaxWidth() |
| 73 | + .padding(horizontal = ReedTheme.spacing.spacing5), |
| 74 | + ) { |
| 75 | + NetworkImage( |
| 76 | + imageUrl = "", |
| 77 | + contentDescription = "Book CoverImage", |
| 78 | + modifier = Modifier |
| 79 | + .padding(end = ReedTheme.spacing.spacing4) |
| 80 | + .width(70.dp) |
| 81 | + .height(99.dp) |
| 82 | + .clip(RoundedCornerShape(size = ReedTheme.radius.xs)), |
| 83 | + placeholder = painterResource(designR.drawable.ic_placeholder), |
| 84 | + ) |
| 85 | + Column(modifier = Modifier.weight(1f)) { |
| 86 | + Text( |
| 87 | + text = "여름은 오래 그곳에 남아", |
| 88 | + color = ReedTheme.colors.contentPrimary, |
| 89 | + overflow = TextOverflow.Ellipsis, |
| 90 | + maxLines = 2, |
| 91 | + style = ReedTheme.typography.headline1SemiBold, |
| 92 | + ) |
| 93 | + Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing2)) |
| 94 | + Row( |
| 95 | + modifier = Modifier.fillMaxWidth(), |
| 96 | + verticalAlignment = Alignment.CenterVertically, |
| 97 | + ) { |
| 98 | + Text( |
| 99 | + text = "미쓰이에 마사시", |
| 100 | + color = ReedTheme.colors.contentTertiary, |
| 101 | + overflow = TextOverflow.Ellipsis, |
| 102 | + maxLines = 1, |
| 103 | + style = ReedTheme.typography.label2Regular, |
| 104 | + modifier = Modifier.weight(0.7f, fill = false), |
| 105 | + ) |
| 106 | + Spacer(Modifier.width(ReedTheme.spacing.spacing1)) |
| 107 | + VerticalDivider( |
| 108 | + modifier = Modifier.height(14.dp), |
| 109 | + thickness = 1.dp, |
| 110 | + color = ReedTheme.colors.contentTertiary, |
| 111 | + ) |
| 112 | + Spacer(Modifier.width(ReedTheme.spacing.spacing1)) |
| 113 | + Text( |
| 114 | + text = "비채", |
| 115 | + color = ReedTheme.colors.contentTertiary, |
| 116 | + overflow = TextOverflow.Ellipsis, |
| 117 | + maxLines = 1, |
| 118 | + style = ReedTheme.typography.label2Regular, |
| 119 | + modifier = Modifier.weight(0.3f, fill = false), |
| 120 | + ) |
| 121 | + } |
| 122 | + Spacer(Modifier.width(ReedTheme.spacing.spacing05)) |
| 123 | + Text( |
| 124 | + text = "2024년", |
| 125 | + color = ReedTheme.colors.contentTertiary, |
| 126 | + overflow = TextOverflow.Ellipsis, |
| 127 | + maxLines = 1, |
| 128 | + style = ReedTheme.typography.label2Regular, |
| 129 | + ) |
| 130 | + } |
| 131 | + } |
| 132 | + Spacer(Modifier.height(ReedTheme.spacing.spacing3)) |
| 133 | + Spacer(Modifier.height(ReedTheme.spacing.spacing4)) |
| 134 | + Row( |
| 135 | + modifier = Modifier |
| 136 | + .fillMaxWidth() |
| 137 | + .padding(horizontal = ReedTheme.spacing.spacing5), |
| 138 | + ) { |
| 139 | + ReedButton( |
| 140 | + onClick = {}, |
| 141 | + text = "읽는 중", |
| 142 | + sizeStyle = largeButtonStyle, |
| 143 | + colorStyle = ReedButtonColorStyle.SECONDARY, |
| 144 | + modifier = Modifier.weight(1f), |
| 145 | + trailingIcon = { |
| 146 | + Icon( |
| 147 | + imageVector = ImageVector.vectorResource(designR.drawable.ic_chevron_down), |
| 148 | + contentDescription = "Dropdown Icon", |
| 149 | + modifier = Modifier.size(22.dp), |
| 150 | + ) |
| 151 | + }, |
| 152 | + ) |
| 153 | + Spacer(modifier = Modifier.width(ReedTheme.spacing.spacing2)) |
| 154 | + ReedButton( |
| 155 | + onClick = {}, |
| 156 | + text = "독서 기록 추가", |
| 157 | + sizeStyle = largeButtonStyle, |
| 158 | + colorStyle = ReedButtonColorStyle.PRIMARY, |
| 159 | + modifier = Modifier.weight(2.34f), |
| 160 | + ) |
| 161 | + } |
| 162 | + CollectedSeed(state = state) |
| 163 | + Spacer(Modifier.height(ReedTheme.spacing.spacing6)) |
| 164 | + ReedDivider() |
| 165 | + } |
41 | 166 | } |
42 | 167 |
|
43 | 168 | @ComponentPreview |
|
0 commit comments