Skip to content

Commit 75f84b2

Browse files
committed
[feature/#38] 요정 등장화면 폴드 기기대응
1 parent 0eaf5a6 commit 75f84b2

File tree

1 file changed

+65
-47
lines changed
  • feature/result/src/commonMain/kotlin/com/nexters/emotia/feature/result/fairy

1 file changed

+65
-47
lines changed

feature/result/src/commonMain/kotlin/com/nexters/emotia/feature/result/fairy/FairyScreen.kt

Lines changed: 65 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
1818
import androidx.compose.foundation.layout.navigationBarsPadding
1919
import androidx.compose.foundation.layout.offset
2020
import androidx.compose.foundation.layout.size
21+
import androidx.compose.foundation.layout.widthIn
2122
import androidx.compose.foundation.shape.RoundedCornerShape
2223
import androidx.compose.runtime.Composable
2324
import androidx.compose.runtime.LaunchedEffect
@@ -41,6 +42,7 @@ import coil3.compose.SubcomposeAsyncImage
4142
import coil3.request.ImageRequest
4243
import coil3.request.crossfade
4344
import com.nexters.emotia.core.designsystem.component.TypingAnimatedSpeechBubble
45+
import com.nexters.emotia.core.designsystem.theme.EmotiaTheme.colors
4446
import com.nexters.emotia.feature.result.fairy.contract.FairyIntent
4547
import com.nexters.emotia.feature.result.fairy.contract.FairySideEffect
4648
import emotia.core.designsystem.generated.resources.Res
@@ -98,6 +100,7 @@ fun FairyScreen(
98100
Box(
99101
modifier = modifier
100102
.fillMaxSize()
103+
.background(colors.black)
101104
.navigationBarsPadding()
102105
.clickable(
103106
interactionSource = remember { MutableInteractionSource() },
@@ -112,46 +115,74 @@ fun FairyScreen(
112115
}
113116
}
114117
) {
115-
Column(modifier = Modifier.fillMaxSize()) {
116-
Box(modifier = Modifier.fillMaxWidth()) {
117-
Image(
118-
painter = painterResource(Res.drawable.img_letter_background),
119-
contentDescription = "Background Image",
120-
modifier = Modifier.fillMaxWidth(),
121-
contentScale = ContentScale.FillWidth
122-
)
118+
Box(
119+
modifier = Modifier.fillMaxSize(),
120+
contentAlignment = Alignment.TopCenter
121+
) {
122+
Column(
123+
modifier = Modifier
124+
.widthIn(max = 500.dp)
125+
.fillMaxWidth()
126+
) {
127+
Box(modifier = Modifier.fillMaxWidth()) {
128+
Image(
129+
painter = painterResource(Res.drawable.img_letter_background),
130+
contentDescription = "Background Image",
131+
modifier = Modifier.fillMaxWidth(),
132+
contentScale = ContentScale.FillWidth
133+
)
123134

124-
SubcomposeAsyncImage(
125-
model = ImageRequest.Builder(LocalPlatformContext.current)
126-
.data(fairyImage)
127-
.crossfade(true)
128-
.build(),
129-
contentDescription = "$fairyImage image",
130-
contentScale = ContentScale.Inside,
135+
SubcomposeAsyncImage(
136+
model = ImageRequest.Builder(LocalPlatformContext.current)
137+
.data(fairyImage)
138+
.crossfade(true)
139+
.build(),
140+
contentDescription = "$fairyImage image",
141+
contentScale = ContentScale.Inside,
142+
modifier = Modifier
143+
.size(108.dp)
144+
.align(Alignment.BottomCenter)
145+
.offset(y = (-49).dp)
146+
.clip(RoundedCornerShape(16.dp)),
147+
error = {
148+
// TODO : 에러 이미지 처리
149+
},
150+
)
151+
}
152+
153+
Box(
131154
modifier = Modifier
132-
.size(108.dp)
133-
.align(Alignment.BottomCenter)
134-
.offset(y = (-49).dp)
135-
.clip(RoundedCornerShape(16.dp)),
136-
error = {
137-
// TODO : 에러 이미지 처리
138-
},
155+
.weight(1f)
156+
.fillMaxWidth()
157+
.background(
158+
brush = Brush.verticalGradient(
159+
colors = listOf(
160+
Color(0xFF171E2D),
161+
Color(0xFF1A1A1B)
162+
)
163+
)
164+
)
139165
)
140166
}
141167

142-
Box(
143-
modifier = Modifier
144-
.weight(1f)
145-
.fillMaxWidth()
146-
.background(
147-
brush = Brush.verticalGradient(
148-
colors = listOf(
149-
Color(0xFF171E2D),
150-
Color(0xFF1A1A1B)
151-
)
168+
if (stepTexts != null && animatedRadius >= 1800f) {
169+
Box(
170+
modifier = Modifier
171+
.widthIn(max = 500.dp)
172+
.align(Alignment.BottomCenter)
173+
) {
174+
AnimatedVisibility(
175+
visible = true,
176+
enter = fadeIn(tween(300)),
177+
exit = fadeOut(tween(300))
178+
) {
179+
TypingAnimatedSpeechBubble(
180+
fullText = stepTexts,
181+
useAlternativeBackground = false
152182
)
153-
)
154-
)
183+
}
184+
}
185+
}
155186
}
156187

157188
if (animatedRadius < 1800f) {
@@ -181,19 +212,6 @@ fun FairyScreen(
181212
}
182213
}
183214

184-
if (stepTexts != null && animatedRadius >= 1800f) {
185-
AnimatedVisibility(
186-
visible = true,
187-
enter = fadeIn(tween(300)),
188-
exit = fadeOut(tween(300)),
189-
modifier = Modifier.align(Alignment.BottomCenter)
190-
) {
191-
TypingAnimatedSpeechBubble(
192-
fullText = stepTexts,
193-
useAlternativeBackground = false
194-
)
195-
}
196-
}
197215
}
198216
}
199217

0 commit comments

Comments
 (0)