|
1 | 1 | package com.threegap.bitnagil.presentation.intro |
2 | 2 |
|
3 | | -import androidx.compose.foundation.background |
4 | | -import androidx.compose.foundation.layout.Box |
| 3 | +import androidx.compose.foundation.Image |
5 | 4 | import androidx.compose.foundation.layout.Column |
6 | 5 | import androidx.compose.foundation.layout.Spacer |
| 6 | +import androidx.compose.foundation.layout.aspectRatio |
7 | 7 | import androidx.compose.foundation.layout.fillMaxSize |
8 | 8 | import androidx.compose.foundation.layout.fillMaxWidth |
9 | 9 | import androidx.compose.foundation.layout.height |
10 | 10 | import androidx.compose.foundation.layout.padding |
11 | | -import androidx.compose.material3.Button |
12 | 11 | import androidx.compose.material3.Text |
13 | 12 | import androidx.compose.runtime.Composable |
14 | 13 | import androidx.compose.ui.Alignment |
15 | 14 | import androidx.compose.ui.Modifier |
16 | | -import androidx.compose.ui.graphics.Color |
| 15 | +import androidx.compose.ui.layout.ContentScale |
| 16 | +import androidx.compose.ui.platform.LocalDensity |
| 17 | +import androidx.compose.ui.platform.LocalWindowInfo |
| 18 | +import androidx.compose.ui.res.painterResource |
17 | 19 | import androidx.compose.ui.text.style.TextAlign |
18 | 20 | import androidx.compose.ui.tooling.preview.Preview |
19 | 21 | import androidx.compose.ui.unit.dp |
20 | 22 | import androidx.hilt.navigation.compose.hiltViewModel |
| 23 | +import com.threegap.bitnagil.designsystem.BitnagilTheme |
| 24 | +import com.threegap.bitnagil.designsystem.R |
| 25 | +import com.threegap.bitnagil.designsystem.component.atom.BitnagilTextButton |
21 | 26 | import com.threegap.bitnagil.presentation.intro.model.IntroIntent |
22 | 27 | import com.threegap.bitnagil.presentation.intro.model.IntroSideEffect |
23 | 28 | import org.orbitmvi.orbit.compose.collectSideEffect |
@@ -45,47 +50,46 @@ private fun IntroScreen( |
45 | 50 | onStartButtonClick: () -> Unit, |
46 | 51 | modifier: Modifier = Modifier, |
47 | 52 | ) { |
| 53 | + val windowInfo = LocalWindowInfo.current |
| 54 | + val screenHeight = with(LocalDensity.current) { |
| 55 | + windowInfo.containerSize.height.toDp() |
| 56 | + } |
| 57 | + |
48 | 58 | Column( |
49 | 59 | horizontalAlignment = Alignment.CenterHorizontally, |
50 | | - modifier = modifier |
51 | | - .fillMaxSize() |
52 | | - .padding(horizontal = 16.dp), |
| 60 | + modifier = modifier.fillMaxSize(), |
53 | 61 | ) { |
| 62 | + Spacer(modifier = Modifier.height(screenHeight * 0.0748f)) |
| 63 | + |
54 | 64 | Text( |
55 | 65 | text = "당신의 하루 리듬을 이해하고,\n작은 변화를 함께 시작해볼게요.", |
| 66 | + color = BitnagilTheme.colors.navy500, |
| 67 | + style = BitnagilTheme.typography.title2Bold, |
56 | 68 | textAlign = TextAlign.Center, |
57 | | - modifier = Modifier |
58 | | - .fillMaxWidth() |
59 | | - .padding(top = 48.dp), |
| 69 | + modifier = Modifier.fillMaxWidth(), |
60 | 70 | ) |
61 | 71 |
|
62 | | - Spacer( |
63 | | - modifier = Modifier.height(38.dp), |
64 | | - ) |
| 72 | + Spacer(modifier = Modifier.height(screenHeight * 0.151f)) |
65 | 73 |
|
66 | | - Box( |
| 74 | + Image( |
| 75 | + painter = painterResource(R.drawable.intro_character), |
| 76 | + contentDescription = null, |
| 77 | + contentScale = ContentScale.Fit, |
67 | 78 | modifier = Modifier |
68 | | - .background(Color.Gray) |
69 | | - .fillMaxWidth() |
70 | | - .height(458.dp), |
71 | | - ) { |
72 | | - Text( |
73 | | - text = "빛나길 로고", |
74 | | - ) |
75 | | - } |
76 | | - |
77 | | - Spacer( |
78 | | - modifier = Modifier.height(38.dp), |
| 79 | + .padding(50.dp) |
| 80 | + .aspectRatio(260f / 295f), |
79 | 81 | ) |
80 | 82 |
|
81 | | - Button( |
| 83 | + Spacer(modifier = Modifier.weight(1f)) |
| 84 | + |
| 85 | + BitnagilTextButton( |
| 86 | + text = "시작하기", |
82 | 87 | onClick = onStartButtonClick, |
83 | 88 | modifier = Modifier |
84 | 89 | .fillMaxWidth() |
| 90 | + .padding(horizontal = 16.dp) |
85 | 91 | .padding(bottom = 20.dp), |
86 | | - ) { |
87 | | - Text("시작하기") |
88 | | - } |
| 92 | + ) |
89 | 93 | } |
90 | 94 | } |
91 | 95 |
|
|
0 commit comments