Skip to content

Commit

Permalink
Merge pull request #136 from YAPP-Github/feature/flash159483/#134
Browse files Browse the repository at this point in the history
#134: 투표 인터렉션 추가
  • Loading branch information
flash159483 authored Aug 25, 2024
2 parents e896564 + ad99cda commit 585024e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 deletions.
25 changes: 25 additions & 0 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 Down Expand Up @@ -159,6 +161,7 @@ internal fun NavDestination.checkDestination(position: NavigationBarPosition): B
}
if (result) BarType.DEFAULT else BarType.NONE
}

NavigationBarPosition.TOP -> {
hierarchy.forEach { destination ->
when (destination.route) {
Expand Down Expand Up @@ -224,6 +227,19 @@ private fun AnimatedContentTransitionScope<*>.defaultEnterTransition(
if (initialNavGraph.id != targetNavGraph.id) {
return fadeIn()
}

if (target.destination.hierarchy.any { it.route == "vote/voting_screen" } &&
initial.destination.hierarchy.any { it.route == "vote/voting_screen" }) {
return slideIntoContainer(
AnimatedContentTransitionScope.SlideDirection.Start,
animationSpec = spring(
stiffness = Spring.StiffnessMediumLow,
),
initialOffset = {
it / 3
},
)
}
return fadeIn()
}

Expand All @@ -236,6 +252,15 @@ private fun AnimatedContentTransitionScope<*>.defaultExitTransition(
if (initialNavGraph.id != targetNavGraph.id) {
return fadeOut()
}
if (target.destination.hierarchy.any { it.route == "vote/voting_screen" }) {
return slideOutOfContainer(
AnimatedContentTransitionScope.SlideDirection.End,
animationSpec = spring(
stiffness = Spring.StiffnessMediumLow,
),
)
}

return fadeOut()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,14 @@ private fun VotingProgressScreen(
},
paddingValues = PaddingValues(vertical = 8.dp, horizontal = 20.dp),
) {
Text(
text = voteItem.content,
style = StaticTypeScale.Default.body3,
modifier = Modifier.padding(vertical = 14.dp),
textAlign = TextAlign.Start,
)
Box(modifier = Modifier.fillMaxWidth()) {
Text(
text = voteItem.content,
style = StaticTypeScale.Default.body3,
modifier = Modifier.padding(vertical = 18.dp, horizontal = 14.dp),
textAlign = TextAlign.Start,
)
}
}
}
}
Expand Down

0 comments on commit 585024e

Please sign in to comment.