11package com.ninecraft.booket.feature.record.step
22
33import 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
56import androidx.compose.foundation.layout.Spacer
7+ import androidx.compose.foundation.layout.fillMaxSize
68import androidx.compose.foundation.layout.fillMaxWidth
79import androidx.compose.foundation.layout.height
10+ import androidx.compose.foundation.layout.imePadding
811import androidx.compose.foundation.layout.padding
12+ import androidx.compose.foundation.lazy.LazyColumn
913import androidx.compose.foundation.text.KeyboardOptions
1014import androidx.compose.foundation.text.input.TextFieldLineLimits
1115import androidx.compose.material3.Icon
1216import androidx.compose.material3.Text
1317import androidx.compose.runtime.Composable
14- import androidx.compose.ui.Alignment
1518import androidx.compose.ui.Modifier
1619import androidx.compose.ui.focus.FocusDirection
1720import androidx.compose.ui.graphics.vector.ImageVector
@@ -31,6 +34,7 @@ import com.ninecraft.booket.core.designsystem.theme.White
3134import com.ninecraft.booket.feature.record.R
3235import com.ninecraft.booket.feature.record.register.RecordRegisterUiEvent
3336import com.ninecraft.booket.feature.record.register.RecordRegisterUiState
37+ import com.ninecraft.booket.core.designsystem.R as designR
3438
3539@Composable
3640internal 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