Skip to content

Commit

Permalink
[FIX]#111: Vote에 있는 문제 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
flash159483 committed Aug 19, 2024
1 parent 4560d45 commit 546acac
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 28 deletions.
22 changes: 17 additions & 5 deletions app/src/main/kotlin/com/bff/wespot/AppNavGraphs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package com.bff.wespot
import androidx.compose.animation.AnimatedContentTransitionScope
import androidx.compose.animation.EnterTransition
import androidx.compose.animation.ExitTransition
import androidx.compose.animation.core.Spring
import androidx.compose.animation.core.spring
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.runtime.Composable
Expand All @@ -15,22 +17,22 @@ import androidx.navigation.NavGraph
import androidx.navigation.NavHostController
import com.bff.wespot.entire.screen.destinations.AccountSettingScreenDestination
import com.bff.wespot.entire.screen.destinations.BlockListScreenDestination
import com.bff.wespot.entire.screen.destinations.CharacterEditScreenDestination
import com.bff.wespot.entire.screen.destinations.EntireScreenDestination
import com.bff.wespot.entire.screen.destinations.NotificationSettingScreenDestination
import com.bff.wespot.entire.screen.destinations.ProfileEditScreenDestination
import com.bff.wespot.entire.screen.destinations.RevokeConfirmScreenDestination
import com.bff.wespot.entire.screen.destinations.RevokeScreenDestination
import com.bff.wespot.entire.screen.destinations.SettingScreenDestination
import com.bff.wespot.entire.screen.destinations.ProfileEditScreenDestination
import com.bff.wespot.entire.screen.destinations.CharacterEditScreenDestination
import com.bff.wespot.message.screen.destinations.MessageEditScreenDestination
import com.bff.wespot.message.screen.destinations.MessageScreenDestination
import com.bff.wespot.message.screen.destinations.MessageWriteScreenDestination
import com.bff.wespot.message.screen.destinations.ReceiverSelectionScreenDestination
import com.bff.wespot.message.screen.destinations.ReservedMessageScreenDestination
import com.bff.wespot.message.viewmodel.SendViewModel
import com.bff.wespot.model.ToastState
import com.bff.wespot.notification.screen.destinations.NotificationScreenDestination
import com.bff.wespot.navigation.Navigator
import com.bff.wespot.notification.screen.destinations.NotificationScreenDestination
import com.bff.wespot.vote.screen.destinations.CharacterSettingScreenDestination
import com.bff.wespot.vote.screen.destinations.IndividualVoteScreenDestination
import com.bff.wespot.vote.screen.destinations.IntroductionScreenDestination
Expand Down Expand Up @@ -209,7 +211,12 @@ private fun AnimatedContentTransitionScope<*>.defaultEnterTransition(
if (initialNavGraph.id != targetNavGraph.id) {
return fadeIn()
}
return fadeIn() + slideIntoContainer(AnimatedContentTransitionScope.SlideDirection.Start)
return fadeIn() + slideIntoContainer(
AnimatedContentTransitionScope.SlideDirection.Start,
animationSpec = spring(
stiffness = Spring.StiffnessMediumLow,
),
)
}

private fun AnimatedContentTransitionScope<*>.defaultExitTransition(
Expand All @@ -221,7 +228,12 @@ private fun AnimatedContentTransitionScope<*>.defaultExitTransition(
if (initialNavGraph.id != targetNavGraph.id) {
return fadeOut()
}
return fadeOut() + slideOutOfContainer(AnimatedContentTransitionScope.SlideDirection.End)
return fadeOut() + slideOutOfContainer(
AnimatedContentTransitionScope.SlideDirection.End,
animationSpec = spring(
stiffness = Spring.StiffnessMediumLow,
),
)
}

private val NavDestination.hostNavGraph: NavGraph
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.bff.wespot.designsystem.component.indicator

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Surface
import androidx.compose.material3.Tab
import androidx.compose.material3.TabRow
Expand Down Expand Up @@ -43,15 +45,17 @@ fun WSHomeTabRow(
color = WeSpotThemeManager.colors.abledTxtColor,
)
},
divider = {
HorizontalDivider(color = WeSpotThemeManager.colors.tertiaryBtnColor)
},
) {
tabList.forEachIndexed { index, tab ->
val selected = selectedTabIndex == index
Tab(
selected = selected,
onClick = { onTabSelected(index) },
modifier = Modifier
.padding(vertical = 11.dp)
.padding(horizontal = 20.dp),
.padding(vertical = 11.dp),
) {
Text(
text = tab,
Expand All @@ -61,6 +65,13 @@ fun WSHomeTabRow(
} else {
WeSpotThemeManager.colors.disableIcnColor
},
modifier = Modifier.padding(
if (index == 0) {
PaddingValues(start = 20.dp)
} else {
PaddingValues(end = 20.dp)
},
),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ fun WsTextField(
.wrapContentSize()
.border(
BorderStroke(1.dp, WeSpotThemeManager.colors.primaryColor),
shape = WeSpotThemeManager.shapes.small
shape = WeSpotThemeManager.shapes.small,
)
.padding(1.dp)
.padding(1.dp),
) {
OutlinedTextField(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,5 @@ private enum class AuthCarouselItem(
) {
FIRST(R.raw.onboarding01, R.drawable.onboarding_01_bkg, R.string.onboarding1),
SignUp(R.raw.onboarding02, R.drawable.onboarding_02_bkg, R.string.onboarding2),
Welcome(R.raw.onboarding03, R.drawable.onboarding_03_bkg, R.string.onboarding3);
Welcome(R.raw.onboarding03, R.drawable.onboarding_03_bkg, R.string.onboarding3),
}
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,13 @@ fun SchoolScreen(
) {
it()
}

}

Box(
modifier = Modifier
.fillMaxSize()
.zIndex(1f), contentAlignment = Alignment.BottomCenter
.zIndex(1f),
contentAlignment = Alignment.BottomCenter,
) {
ListBottomGradient(height = 120)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ internal fun EntireScreen(
.clickable { navigator.navigateToSetting() }
.padding(end = 16.dp),
imageVector = ImageVector.vectorResource(
com.bff.wespot.designsystem.R.drawable.icn_settings
com.bff.wespot.designsystem.R.drawable.icn_settings,
),
contentDescription = stringResource(R.string.setting_icon),
tint = WeSpotThemeManager.colors.secondaryBtnColor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ fun VoteResultScreen(
}
}

if (state.onBoarding) {
if (state.onBoarding && !showLottie) {
Box(
modifier = Modifier
.fillMaxSize()
Expand Down Expand Up @@ -329,7 +329,11 @@ fun VoteResultScreen(
Box(
modifier = Modifier
.fillMaxSize()
.padding(bottom = 104.dp),
.padding(bottom = 104.dp)
.blur(
if (state.onBoarding) 10.dp else 0.dp,
edgeTreatment = BlurredEdgeTreatment.Unbounded,
),
contentAlignment = Alignment.BottomCenter,
) {
DotIndicators(pagerState = pagerState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ fun VotingScreen(
) {
if (state.loading && showGuideScreen) {
return@Scaffold
} else if (!showGuideScreen) {
} else if (showGuideScreen) {
VotingGuideScreen(it, navigator)
} else {
VotingProgressScreen(
Expand Down Expand Up @@ -243,7 +243,7 @@ private fun VotingProgressScreen(
}
Text(
text =
"${state.currentVote.voteUser.name}${stringResource(id = R.string.vote_question)}",
"${state.currentVote.voteUser.name}${stringResource(id = R.string.vote_question)}",
style = StaticTypeScale.Default.header1,
modifier = Modifier.padding(horizontal = 20.dp),
)
Expand Down Expand Up @@ -282,13 +282,13 @@ private fun VotingProgressScreen(
}
},
buttonType =
if (state.selectedVote[state.pageNumber - 1].voteOptionId == voteItem.id ||
selected == voteItem.id
) {
WSOutlineButtonType.Highlight
} else {
WSOutlineButtonType.None
},
if (state.selectedVote[state.pageNumber - 1].voteOptionId == voteItem.id ||
selected == voteItem.id
) {
WSOutlineButtonType.Highlight
} else {
WSOutlineButtonType.None
},
paddingValues = PaddingValues(vertical = 8.dp, horizontal = 20.dp),
) {
Text(
Expand Down Expand Up @@ -328,7 +328,7 @@ private fun VotingGuideScreen(
modifier = Modifier
.fillMaxSize()
.padding(paddingValues),
verticalArrangement = Arrangement.spacedBy(16.dp)
verticalArrangement = Arrangement.spacedBy(16.dp),
) {
Text(
text = stringResource(R.string.guide_title),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ internal fun VoteCard(
if (result.voteCount == 0) {
Image(
painter = painterResource(
id = com.bff.wespot.designsystem.R.drawable.question
id = com.bff.wespot.designsystem.R.drawable.question,
),
contentDescription = stringResource(
id = R.string.vote_ongoing,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,16 @@ class VoteResultViewModel @Inject constructor(
dataStoreRepository.getBoolean(DataStoreKey.VOTE_ONBOARDING).collect {
if (!it) {
reduce { state.copy(onBoarding = !it) }
dataStoreRepository.saveBoolean(DataStoreKey.VOTE_ONBOARDING, true)
}
}
}
}

private fun setVoteOnBoarding() = intent {
reduce {
viewModelScope.launch {
dataStoreRepository.saveBoolean(DataStoreKey.VOTE_ONBOARDING, true)
}
state.copy(
onBoarding = false,
)
Expand Down
2 changes: 1 addition & 1 deletion feature/vote/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="invite_friend">위스팟에 친구 초대하기</string>
<string name="invite_friend_description">다양한 친구들과 더 재미있게 사용해 보세요</string>
<string name="invite_friend_description">친구들과 더 재미있게 사용해 보세요</string>
<string name="vote_ongoing">지금 우리반 투표가 진행 중이에요\n반 친구들에 대해 알려주세요</string>
<string name="vote_description">투표 사진</string>
<string name="voting">투표하기</string>
Expand Down

0 comments on commit 546acac

Please sign in to comment.