diff --git a/core/ui/src/main/res/values/colors.xml b/core/ui/src/main/res/values/colors.xml
index 370e7a6d..c1eaa43e 100644
--- a/core/ui/src/main/res/values/colors.xml
+++ b/core/ui/src/main/res/values/colors.xml
@@ -14,6 +14,7 @@
#2d2d2d
#4b4b4b
#939393
+ #414141
#222222
#2c2c2c
diff --git a/feature/tohot/src/main/java/tht/feature/tohot/component/card/ToHotCard.kt b/feature/tohot/src/main/java/tht/feature/tohot/component/card/ToHotCard.kt
index 5f47e49b..fdbb0cbe 100644
--- a/feature/tohot/src/main/java/tht/feature/tohot/component/card/ToHotCard.kt
+++ b/feature/tohot/src/main/java/tht/feature/tohot/component/card/ToHotCard.kt
@@ -6,7 +6,6 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.pager.rememberPagerState
-import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
@@ -15,7 +14,6 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
-import androidx.compose.ui.draw.clip
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.tht.tht.domain.signup.model.IdealTypeModel
@@ -72,9 +70,7 @@ fun ToHotCard(
}
FallingCard(
- modifier = modifier
- .fillMaxSize()
- .clip(RoundedCornerShape(12.dp)),
+ modifier = modifier,
fallingProgress = fallingAnimatedProgress.value
) {
ToHotCardImagePager(
diff --git a/feature/tohot/src/main/java/tht/feature/tohot/component/card/ToHotNotifyCard.kt b/feature/tohot/src/main/java/tht/feature/tohot/component/card/ToHotNotifyCard.kt
index a82ede08..2ac8b65a 100644
--- a/feature/tohot/src/main/java/tht/feature/tohot/component/card/ToHotNotifyCard.kt
+++ b/feature/tohot/src/main/java/tht/feature/tohot/component/card/ToHotNotifyCard.kt
@@ -2,6 +2,7 @@ package tht.feature.tohot.component.card
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
+import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize
@@ -13,6 +14,7 @@ import androidx.compose.material.ButtonDefaults
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
+import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.res.painterResource
@@ -36,10 +38,25 @@ fun ToHotNotifyCard(
Column(
modifier = modifier
.background(
- colorResource(id = tht.core.ui.R.color.black_222222)
+ brush = Brush.linearGradient(
+ colors = listOf(
+ colorResource(tht.core.ui.R.color.black_1D1D1D),
+ colorResource(tht.core.ui.R.color.black_161616),
+ colorResource(tht.core.ui.R.color.black_1D1D1D)
+ )
+ ),
+ shape = RoundedCornerShape(12.dp)
+ )
+ .border(
+ width = 1.dp,
+ brush = Brush.linearGradient(
+ colors = listOf(
+ colorResource(tht.core.ui.R.color.gray_414141).copy(alpha = 0.3f),
+ colorResource(tht.core.ui.R.color.black_1A1A1A).copy(alpha = 0.9f)
+ )
+ ),
+ shape = RoundedCornerShape(12.dp)
)
- .fillMaxSize()
- .clip(RoundedCornerShape(12.dp))
) {
ToHotEmptyTimeProgressContainer(
modifier = Modifier
@@ -97,6 +114,10 @@ fun ToHotNotifyCard(
@Preview
private fun ToHotNotifyCardPreview() {
ToHotNotifyCard(
+ modifier = Modifier
+ .fillMaxSize()
+ .padding(start = 14.dp, end = 14.dp, top = 6.dp, bottom = 14.dp)
+ .clip(RoundedCornerShape(12.dp)),
image = painterResource(id = R.drawable.ic_mudy_none_initial_user),
title = "가나다라마바사",
description = "preview",
diff --git a/feature/tohot/src/main/java/tht/feature/tohot/component/card/TopicSelectTypeCardScreen.kt b/feature/tohot/src/main/java/tht/feature/tohot/component/card/TopicSelectTypeCardScreen.kt
index 534debe7..098939b8 100644
--- a/feature/tohot/src/main/java/tht/feature/tohot/component/card/TopicSelectTypeCardScreen.kt
+++ b/feature/tohot/src/main/java/tht/feature/tohot/component/card/TopicSelectTypeCardScreen.kt
@@ -67,8 +67,8 @@ fun TopicSelectTypeCardScreen(
width = 1.dp,
brush = Brush.linearGradient(
colors = listOf(
- colorResource(R.color.gray_8d8d8d).copy(alpha = 0.3f),
- colorResource(R.color.black_414141).copy(alpha = 0.9f)
+ colorResource(R.color.gray_414141).copy(alpha = 0.3f),
+ colorResource(R.color.black_1A1A1A).copy(alpha = 0.9f)
)
),
shape = RoundedCornerShape(12.dp)
diff --git a/feature/tohot/src/main/java/tht/feature/tohot/tohot/screen/ToHotScreen.kt b/feature/tohot/src/main/java/tht/feature/tohot/tohot/screen/ToHotScreen.kt
index 6815203f..70ce3c18 100644
--- a/feature/tohot/src/main/java/tht/feature/tohot/tohot/screen/ToHotScreen.kt
+++ b/feature/tohot/src/main/java/tht/feature/tohot/tohot/screen/ToHotScreen.kt
@@ -6,10 +6,12 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.pager.PagerState
import androidx.compose.foundation.pager.VerticalPager
import androidx.compose.foundation.pager.rememberPagerState
+import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.snapshotFlow
import androidx.compose.ui.Modifier
+import androidx.compose.ui.draw.clip
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import kotlinx.collections.immutable.ImmutableList
@@ -76,12 +78,32 @@ internal fun ToHotScreen(
)
}
+ val cardModifier = Modifier
+ .fillMaxSize()
+ .padding(start = 14.dp, end = 14.dp, top = 6.dp, bottom = 14.dp)
+ .clip(RoundedCornerShape(12.dp))
+
when (toHotCardState) {
- ToHotCardState.Enter -> ToHotEnterCard(onClick = onEnterClick)
- ToHotCardState.NoneInitializeUser -> ToHotNoneInitialUserCard(onClick = onRefreshClick)
- ToHotCardState.NoneNextUser -> ToHotNoneNextUserCard(onClick = onRefreshClick)
- ToHotCardState.QuerySuccess -> ToHotQuerySuccessCard(onClick = onEnterClick)
- ToHotCardState.Error -> ToHotErrorCard(onClick = onRefreshClick)
+ ToHotCardState.Enter -> ToHotEnterCard(
+ modifier = cardModifier,
+ onClick = onEnterClick
+ )
+ ToHotCardState.NoneInitializeUser -> ToHotNoneInitialUserCard(
+ modifier = cardModifier,
+ onClick = onRefreshClick
+ )
+ ToHotCardState.NoneNextUser -> ToHotNoneNextUserCard(
+ modifier = cardModifier,
+ onClick = onRefreshClick
+ )
+ ToHotCardState.QuerySuccess -> ToHotQuerySuccessCard(
+ modifier = cardModifier,
+ onClick = onEnterClick
+ )
+ ToHotCardState.Error -> ToHotErrorCard(
+ modifier = cardModifier,
+ onClick = onRefreshClick
+ )
ToHotCardState.NoneSelectTopic,
ToHotCardState.Running -> {
@@ -103,9 +125,7 @@ internal fun ToHotScreen(
val isCurrentCard = currentUserIdx == pagerState.currentPage &&
idx == currentUserIdx
ToHotCard(
- modifier = Modifier
- .fillMaxSize()
- .padding(start = 14.dp, end = 14.dp, top = 6.dp, bottom = 14.dp),
+ modifier = cardModifier,
imageUrls = card.user.profileImgUrl,
name = card.user.nickname,
age = card.user.age,
@@ -132,9 +152,7 @@ internal fun ToHotScreen(
is ToHotCardUiModel.Topic -> {
TopicSelectCard(
- modifier = Modifier
- .fillMaxSize()
- .padding(start = 14.dp, end = 14.dp, top = 6.dp, bottom = 14.dp),
+ modifier = cardModifier,
topicCard = card.topic,
selectTopicIdx = topicInfo.selectTopicIdx,
onSelectTopic = onSelectTopic,
diff --git a/feature/tohot/src/main/java/tht/feature/tohot/tohot/viewmodel/ToHotViewModel.kt b/feature/tohot/src/main/java/tht/feature/tohot/tohot/viewmodel/ToHotViewModel.kt
index 1fc9a866..558173cd 100644
--- a/feature/tohot/src/main/java/tht/feature/tohot/tohot/viewmodel/ToHotViewModel.kt
+++ b/feature/tohot/src/main/java/tht/feature/tohot/tohot/viewmodel/ToHotViewModel.kt
@@ -8,9 +8,9 @@ import com.example.compose_ui.common.viewmodel.Store
import com.example.compose_ui.common.viewmodel.intent
import com.example.compose_ui.common.viewmodel.store
import com.tht.tht.domain.tohot.FetchToHotStateUseCase
+import com.tht.tht.domain.tohot.SelectTopicUseCase
import com.tht.tht.domain.tohot.ToHotStateModel
import com.tht.tht.domain.token.model.NeedLogoutException
-import com.tht.tht.domain.tohot.SelectTopicUseCase
import com.tht.tht.domain.user.BlockUserUseCase
import com.tht.tht.domain.user.ReportUserUseCase
import com.tht.tht.domain.user.SendDislikeUseCase
@@ -115,6 +115,11 @@ class ToHotViewModel @Inject constructor(
reduce {
toHotState.toUiState(it, autoRunToHot)
}
+ if (autoRunToHot) {
+ tryScrollToNext(
+ currentIdx = store.state.value.enableTimerIdx
+ )
+ }
}.onFailure { e ->
e.printStackTrace()
reduce {
@@ -341,10 +346,9 @@ class ToHotViewModel @Inject constructor(
selectTopicIdx = store.state.value.topic.selectTopicIdx
)
if (selectTopic == null || selectTopic.idx < 0) return
-
intent {
reduce { it.copy(loading = ToHotLoading.TopicSelect) }
- selectTopicUseCase(topicIdx = selectTopic.idx)
+ selectTopicUseCase.invoke(topicIdx = selectTopic.idx)
.unWrapTokenException()
.onSuccess {
when (it) {
@@ -352,7 +356,7 @@ class ToHotViewModel @Inject constructor(
reduce { state ->
state.copy(
topic = state.topic.copy(
- selectTopicIdx = -1,
+ selectTopicIdx = selectTopic.idx,
currentTopic = selectTopic
),
loading = ToHotLoading.None,