Skip to content

Commit

Permalink
Merge branch 'feature/#129-space-detail-ui' of https://github.com/Tea…
Browse files Browse the repository at this point in the history
…m-Recordy/Recordy-Android into feature/#129-space-detail-ui
  • Loading branch information
nagaeng committed Oct 8, 2024
2 parents 0ff665f + e03cc61 commit c0cf5d0
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 35 deletions.
15 changes: 8 additions & 7 deletions feature/detail/src/main/java/com/record/detail/DetailScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fun DetailpageScreen(
) {
val pagerState = rememberPagerState(
initialPage = state.detailpageTab.ordinal,
pageCount = {2},
pageCount = { 2 },
)
val coroutineScope = rememberCoroutineScope()

Expand All @@ -115,23 +115,23 @@ fun DetailpageScreen(
Box(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 20.dp)
.padding(horizontal = 20.dp),
) {
Column(
modifier = Modifier.align(Alignment.Center)
modifier = Modifier.align(Alignment.Center),
) {
Text(
text = state.placeName,
style = RecordyTheme.typography.title1,
color = RecordyTheme.colors.white,
modifier = Modifier.align(Alignment.CenterHorizontally)
modifier = Modifier.align(Alignment.CenterHorizontally),
)
Spacer(modifier = Modifier.height(4.dp))
Text(
text = state.placeAddress,
style = RecordyTheme.typography.body2M,
color = RecordyTheme.colors.gray03,
modifier = Modifier.align(Alignment.CenterHorizontally)
modifier = Modifier.align(Alignment.CenterHorizontally),
)
Spacer(modifier = Modifier.height(24.dp))

Expand All @@ -153,7 +153,7 @@ fun DetailpageScreen(
textColor = RecordyTheme.colors.background,
backgroundColor = RecordyTheme.colors.gray01,
shape = RoundedCornerShape(8.dp),
onClick = { },
onClick = { },
padding = PaddingValues(horizontal = 19.dp, vertical = 8.dp),
modifier = Modifier,
)
Expand Down Expand Up @@ -182,7 +182,7 @@ fun DetailpageScreen(
onItemClick = {},
onChipSelected = { selectedChip ->
selectedChipState.value = selectedChip
}
},
)
}

Expand All @@ -201,6 +201,7 @@ fun DetailpageScreen(
}
}
}

@OptIn(ExperimentalFoundationApi::class)
@Composable
fun CustomTabRow(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.record.detail

enum class DetailpageTab (val displayName: String) {
enum class DetailpageTab(val displayName: String) {
LIST("전시 리스트"),
REVIEW("후기 영상")
REVIEW("후기 영상"),
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package com.record.detail
import androidx.lifecycle.viewModelScope
import com.record.model.VideoType
import com.record.ui.base.BaseViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import com.record.video.repository.VideoRepository
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.collections.immutable.toImmutableList
import kotlinx.coroutines.async
import kotlinx.coroutines.launch
import javax.inject.Inject

@HiltViewModel
class DetailpageViewModel @Inject constructor (
class DetailpageViewModel @Inject constructor(
private val videoRepository: VideoRepository,
) : BaseViewModel<DetailpageState, DetailpageSideEffect>(DetailpageState()) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ fun NavGraphBuilder.detailNavGraph(
navigateToVideo = navigateToVideo,
navigateToUplaod = navigateToUpload,
)

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ package com.record.detail.screen
enum class ChipTab(val displayName: String) {
ALL("전체"),
FREE("무료"),
ENDING_SOON("곧 끝남");
ENDING_SOON("곧 끝남"),
}

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import com.record.designsystem.theme.RecordyTheme
fun EmptyDataScreen(
message: String,
showButton: Boolean,
onButtonClick: () -> Unit = {}
onButtonClick: () -> Unit = {},
) {
Box(modifier = Modifier.fillMaxSize()) {
Column(
Expand All @@ -38,7 +38,6 @@ fun EmptyDataScreen(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.fillMaxSize(),
) {

Text(
text = message,
style = RecordyTheme.typography.title3SB,
Expand Down
33 changes: 15 additions & 18 deletions feature/detail/src/main/java/com/record/detail/screen/ListScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fun ListScreen(
exhibitionCount: Int,
selectedChip: ChipTab,
onChipSelected: (ChipTab) -> Unit,
onItemClick: (String) -> Unit
onItemClick: (String) -> Unit,
) {
Column(
modifier = Modifier
Expand All @@ -59,14 +59,14 @@ fun ListScreen(
ChipRow(
chipTabs = ChipTab.entries,
selectedChip = selectedChip,
onChipSelected = onChipSelected
onChipSelected = onChipSelected,
)

Box(
modifier = Modifier
.fillMaxWidth()
.padding(top = 12.dp),
contentAlignment = Alignment.TopEnd
contentAlignment = Alignment.TopEnd,
) {
Text(
text = buildCountText(exhibitionCount),
Expand All @@ -92,7 +92,7 @@ fun ListScreen(
name = name,
startDate = startDate,
endDate = endDate,
onButtonClick = { }
onButtonClick = { },
)
Spacer(modifier = Modifier.height(16.dp))
}
Expand All @@ -102,21 +102,20 @@ fun ListScreen(
}
}


@Composable
fun ExhibitionItem(name: String, startDate: Date, endDate: Date, onButtonClick: () -> Unit) {
Box(
modifier = Modifier
.fillMaxWidth()
.clip(RoundedCornerShape(8.dp))
.background(RecordyTheme.colors.gray10)
.padding(vertical = 12.dp, horizontal = 16.dp)
.padding(vertical = 12.dp, horizontal = 16.dp),
) {
Column(
modifier = Modifier.fillMaxWidth()
modifier = Modifier.fillMaxWidth(),
) {
Column(
modifier = Modifier.fillMaxWidth()
modifier = Modifier.fillMaxWidth(),
) {
Text(
text = name,
Expand All @@ -132,21 +131,19 @@ fun ExhibitionItem(name: String, startDate: Date, endDate: Date, onButtonClick:
}
Row(
modifier = Modifier.fillMaxSize(),
horizontalArrangement = Arrangement.End
horizontalArrangement = Arrangement.End,
) {
Image(
painter = painterResource(id = R.drawable.ic_more_informations),
contentDescription = null,
modifier = Modifier
.clickable { onButtonClick() }
.clickable { onButtonClick() },
)
}
}
}
}



fun formatDate(startDate: Date, endDate: Date): String {
val dateFormat = SimpleDateFormat("yyyy년 MM월 dd일", Locale.getDefault())
return "${dateFormat.format(startDate)}~${dateFormat.format(endDate)}"
Expand All @@ -156,17 +153,17 @@ fun formatDate(startDate: Date, endDate: Date): String {
fun ChipRow(
chipTabs: List<ChipTab>,
selectedChip: ChipTab,
onChipSelected: (ChipTab) -> Unit
onChipSelected: (ChipTab) -> Unit,
) {
LazyRow(
modifier = Modifier,
horizontalArrangement = Arrangement.spacedBy(8.dp)
horizontalArrangement = Arrangement.spacedBy(8.dp),
) {
items(chipTabs) { chipTab ->
Chip(
text = chipTab.displayName,
isSelected = chipTab == selectedChip,
onClick = { onChipSelected(chipTab) }
onClick = { onChipSelected(chipTab) },
)
}
}
Expand All @@ -176,20 +173,20 @@ fun ChipRow(
fun Chip(
text: String,
isSelected: Boolean,
onClick: () -> Unit
onClick: () -> Unit,
) {
Box(
modifier = Modifier
.clip(RoundedCornerShape(30.dp))
.background(if (isSelected) RecordyTheme.colors.gray01 else RecordyTheme.colors.gray09)
.clickable { onClick() }
.padding(horizontal = 10.dp, vertical = 8.dp),
contentAlignment = Alignment.Center
contentAlignment = Alignment.Center,
) {
Text(
text = text,
color = if (isSelected) RecordyTheme.colors.background else RecordyTheme.colors.gray03,
style = RecordyTheme.typography.caption1R
style = RecordyTheme.typography.caption1R,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import com.record.ui.scroll.OnBottomReached
import com.record.video.model.VideoData
import kotlinx.collections.immutable.ImmutableList


@Composable
fun ReviewScreen(
videoItems: ImmutableList<VideoData>,
Expand Down

0 comments on commit c0cf5d0

Please sign in to comment.