Skip to content

Commit 423a24f

Browse files
committed
[BOOK-195] feat: 키보드 올라왔을 때 문장 기록 TextField가 같이 밀려 올라가도록 수정
1 parent b0b11dc commit 423a24f

File tree

1 file changed

+74
-62
lines changed
  • feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step

1 file changed

+74
-62
lines changed

feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/QuoteStep.kt

Lines changed: 74 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
package com.ninecraft.booket.feature.record.step
22

33
import androidx.compose.foundation.background
4-
import androidx.compose.foundation.layout.Column
4+
import androidx.compose.foundation.layout.Arrangement
5+
import androidx.compose.foundation.layout.Row
56
import androidx.compose.foundation.layout.Spacer
7+
import androidx.compose.foundation.layout.fillMaxSize
68
import androidx.compose.foundation.layout.fillMaxWidth
79
import androidx.compose.foundation.layout.height
10+
import androidx.compose.foundation.layout.imePadding
811
import androidx.compose.foundation.layout.padding
12+
import androidx.compose.foundation.lazy.LazyColumn
913
import androidx.compose.foundation.text.KeyboardOptions
1014
import androidx.compose.foundation.text.input.TextFieldLineLimits
1115
import androidx.compose.material3.Icon
1216
import androidx.compose.material3.Text
1317
import androidx.compose.runtime.Composable
14-
import androidx.compose.ui.Alignment
1518
import androidx.compose.ui.Modifier
1619
import androidx.compose.ui.focus.FocusDirection
1720
import androidx.compose.ui.graphics.vector.ImageVector
@@ -31,6 +34,7 @@ import com.ninecraft.booket.core.designsystem.theme.White
3134
import com.ninecraft.booket.feature.record.R
3235
import com.ninecraft.booket.feature.record.register.RecordRegisterUiEvent
3336
import com.ninecraft.booket.feature.record.register.RecordRegisterUiState
37+
import com.ninecraft.booket.core.designsystem.R as designR
3438

3539
@Composable
3640
internal fun QuoteStep(
@@ -39,71 +43,79 @@ internal fun QuoteStep(
3943
) {
4044
val focusManager = LocalFocusManager.current
4145

42-
Column(
46+
LazyColumn(
4347
modifier = modifier
48+
.fillMaxSize()
4449
.background(White)
50+
.imePadding()
4551
.padding(horizontal = ReedTheme.spacing.spacing5),
4652
) {
47-
Text(
48-
text = stringResource(R.string.quote_step_title),
49-
color = ReedTheme.colors.contentPrimary,
50-
style = ReedTheme.typography.heading1Bold,
51-
)
52-
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing10))
53-
Text(
54-
text = stringResource(R.string.quote_step_page_label),
55-
color = ReedTheme.colors.contentPrimary,
56-
style = ReedTheme.typography.body1Medium,
57-
)
58-
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing2))
59-
ReedRecordTextField(
60-
recordState = state.recordPageState,
61-
recordHintRes = R.string.quote_step_page_hint,
62-
inputTransformation = digitOnlyInputTransformation,
63-
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
64-
lineLimits = TextFieldLineLimits.SingleLine,
65-
isError = state.isPageError,
66-
errorMessage = stringResource(R.string.quote_step_page_input_error),
67-
onClear = {
68-
state.eventSink(RecordRegisterUiEvent.OnClearClick)
69-
},
70-
onNext = {
71-
focusManager.moveFocus(FocusDirection.Down)
72-
},
73-
modifier = Modifier
74-
.fillMaxWidth()
75-
.height(50.dp),
76-
)
77-
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing8))
78-
Text(
79-
text = stringResource(R.string.quote_step_sentence_label),
80-
color = ReedTheme.colors.contentPrimary,
81-
style = ReedTheme.typography.body1Medium,
82-
)
83-
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing2))
84-
ReedRecordTextField(
85-
recordState = state.recordSentenceState,
86-
recordHintRes = R.string.quote_step_sentence_hint,
87-
modifier = Modifier
88-
.fillMaxWidth()
89-
.height(140.dp),
90-
)
91-
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing3))
92-
ReedButton(
93-
onClick = {
94-
state.eventSink(RecordRegisterUiEvent.OnSentenceScanButtonClick)
95-
},
96-
colorStyle = ReedButtonColorStyle.STROKE,
97-
sizeStyle = smallRoundedButtonStyle,
98-
modifier = Modifier.align(Alignment.End),
99-
text = stringResource(R.string.quote_step_scan_sentence),
100-
leadingIcon = {
101-
Icon(
102-
imageVector = ImageVector.vectorResource(com.ninecraft.booket.core.designsystem.R.drawable.ic_maximize),
103-
contentDescription = "Scan Icon",
53+
item {
54+
Text(
55+
text = stringResource(R.string.quote_step_title),
56+
color = ReedTheme.colors.contentPrimary,
57+
style = ReedTheme.typography.heading1Bold,
58+
)
59+
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing10))
60+
Text(
61+
text = stringResource(R.string.quote_step_page_label),
62+
color = ReedTheme.colors.contentPrimary,
63+
style = ReedTheme.typography.body1Medium,
64+
)
65+
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing2))
66+
ReedRecordTextField(
67+
recordState = state.recordPageState,
68+
recordHintRes = R.string.quote_step_page_hint,
69+
inputTransformation = digitOnlyInputTransformation,
70+
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
71+
lineLimits = TextFieldLineLimits.SingleLine,
72+
isError = state.isPageError,
73+
errorMessage = stringResource(R.string.quote_step_page_input_error),
74+
onClear = {
75+
state.eventSink(RecordRegisterUiEvent.OnClearClick)
76+
},
77+
onNext = {
78+
focusManager.moveFocus(FocusDirection.Down)
79+
},
80+
modifier = Modifier
81+
.fillMaxWidth()
82+
.height(50.dp),
83+
)
84+
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing8))
85+
Text(
86+
text = stringResource(R.string.quote_step_sentence_label),
87+
color = ReedTheme.colors.contentPrimary,
88+
style = ReedTheme.typography.body1Medium,
89+
)
90+
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing2))
91+
ReedRecordTextField(
92+
recordState = state.recordSentenceState,
93+
recordHintRes = R.string.quote_step_sentence_hint,
94+
modifier = Modifier
95+
.fillMaxWidth()
96+
.height(140.dp),
97+
)
98+
Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing3))
99+
Row(
100+
modifier = Modifier.fillMaxWidth(),
101+
horizontalArrangement = Arrangement.End,
102+
) {
103+
ReedButton(
104+
onClick = {
105+
state.eventSink(RecordRegisterUiEvent.OnSentenceScanButtonClick)
106+
},
107+
colorStyle = ReedButtonColorStyle.STROKE,
108+
sizeStyle = smallRoundedButtonStyle,
109+
text = stringResource(R.string.quote_step_scan_sentence),
110+
leadingIcon = {
111+
Icon(
112+
imageVector = ImageVector.vectorResource(designR.drawable.ic_maximize),
113+
contentDescription = "Scan Icon",
114+
)
115+
},
104116
)
105-
},
106-
)
117+
}
118+
}
107119
}
108120
}
109121

0 commit comments

Comments
 (0)