@@ -85,114 +85,119 @@ internal fun RecordEditUi(
8585
8686@Composable
8787private fun ColumnScope.RecordEditContent (state : RecordEditUiState ) {
88- BookItem (
89- imageUrl = state.recordInfo.bookCoverImageUrl,
90- bookTitle = state.recordInfo.bookTitle,
91- author = state.recordInfo.author,
92- publisher = state.recordInfo.bookPublisher,
93- )
94- Spacer (modifier = Modifier .height(ReedTheme .spacing.spacing2))
95- HorizontalDivider (
96- modifier = Modifier .fillMaxWidth(),
97- thickness = ReedTheme .border.border1,
98- color = ReedTheme .colors.dividerSm,
99- )
10088 Column (
10189 modifier = Modifier
10290 .weight(1f )
103- .padding(horizontal = ReedTheme .spacing.spacing5)
10491 .verticalScroll(rememberScrollState()),
10592 ) {
106- Spacer (modifier = Modifier .height(ReedTheme .spacing.spacing6))
107- Text (
108- text = stringResource(R .string.edit_record_page_label),
109- color = ReedTheme .colors.contentPrimary,
110- style = ReedTheme .typography.body1Medium,
111- )
112- Spacer (modifier = Modifier .height(ReedTheme .spacing.spacing2))
113- ReedRecordTextField (
114- recordState = state.recordPageState,
115- recordHintRes = R .string.edit_record_page_hint,
116- inputTransformation = digitOnlyInputTransformation,
117- keyboardOptions = KeyboardOptions (keyboardType = KeyboardType .Number ),
118- lineLimits = TextFieldLineLimits .SingleLine ,
119- isError = state.isPageError,
120- errorMessage = stringResource(R .string.edit_record_page_input_error),
121- onClear = {
122- state.eventSink(RecordEditUiEvent .OnClearClick )
123- },
124- modifier = Modifier
125- .fillMaxWidth()
126- .height(50 .dp),
127- )
128- Spacer (modifier = Modifier .height(ReedTheme .spacing.spacing8))
129- Text (
130- text = stringResource(R .string.edit_record_quote_label),
131- color = ReedTheme .colors.contentPrimary,
132- style = ReedTheme .typography.body1Medium,
93+ BookItem (
94+ imageUrl = state.recordInfo.bookCoverImageUrl,
95+ bookTitle = state.recordInfo.bookTitle,
96+ author = state.recordInfo.author,
97+ publisher = state.recordInfo.bookPublisher,
13398 )
13499 Spacer (modifier = Modifier .height(ReedTheme .spacing.spacing2))
135- ReedRecordTextField (
136- recordState = state.recordQuoteState,
137- recordHintRes = R .string.edit_record_quote_hint,
138- modifier = Modifier
139- .fillMaxWidth()
140- .height(140 .dp),
141- keyboardOptions = KeyboardOptions (
142- keyboardType = KeyboardType .Text ,
143- imeAction = ImeAction .Default ,
144- ),
145- )
146- Spacer (modifier = Modifier .height(ReedTheme .spacing.spacing8))
147- Text (
148- text = stringResource(R .string.edit_record_impression_label),
149- color = ReedTheme .colors.contentPrimary,
150- style = ReedTheme .typography.body1Medium,
100+ HorizontalDivider (
101+ modifier = Modifier .fillMaxWidth(),
102+ thickness = ReedTheme .border.border1,
103+ color = ReedTheme .colors.dividerSm,
151104 )
152- Spacer (modifier = Modifier .height(ReedTheme .spacing.spacing2))
153- ReedRecordTextField (
154- recordState = state.recordImpressionState,
155- recordHintRes = R .string.edit_record_impression_hint,
105+ Spacer (modifier = Modifier .height(ReedTheme .spacing.spacing6))
106+ Column (
156107 modifier = Modifier
157108 .fillMaxWidth()
158- .height(140 .dp),
159- keyboardOptions = KeyboardOptions (
160- keyboardType = KeyboardType .Text ,
161- imeAction = ImeAction .Default ,
162- ),
163- )
164- Spacer (modifier = Modifier .height(ReedTheme .spacing.spacing8))
165- Row (
166- modifier = Modifier .fillMaxWidth(),
167- verticalAlignment = Alignment .CenterVertically ,
109+ .padding(horizontal = ReedTheme .spacing.spacing5),
168110 ) {
169111 Text (
170- text = stringResource(R .string.edit_record_emotion_label ),
112+ text = stringResource(R .string.edit_record_page_label ),
171113 color = ReedTheme .colors.contentPrimary,
172114 style = ReedTheme .typography.body1Medium,
173115 )
174- Spacer (modifier = Modifier .weight(1f ))
175- Row (
176- modifier = Modifier .clickable {
177- state.eventSink(RecordEditUiEvent .OnEmotionEditClick )
116+ Spacer (modifier = Modifier .height(ReedTheme .spacing.spacing2))
117+ ReedRecordTextField (
118+ recordState = state.recordPageState,
119+ recordHintRes = R .string.edit_record_page_hint,
120+ inputTransformation = digitOnlyInputTransformation,
121+ keyboardOptions = KeyboardOptions (keyboardType = KeyboardType .Number ),
122+ lineLimits = TextFieldLineLimits .SingleLine ,
123+ isError = state.isPageError,
124+ errorMessage = stringResource(R .string.edit_record_page_input_error),
125+ onClear = {
126+ state.eventSink(RecordEditUiEvent .OnClearClick )
178127 },
128+ modifier = Modifier
129+ .fillMaxWidth()
130+ .height(50 .dp),
131+ )
132+ Spacer (modifier = Modifier .height(ReedTheme .spacing.spacing8))
133+ Text (
134+ text = stringResource(R .string.edit_record_quote_label),
135+ color = ReedTheme .colors.contentPrimary,
136+ style = ReedTheme .typography.body1Medium,
137+ )
138+ Spacer (modifier = Modifier .height(ReedTheme .spacing.spacing2))
139+ ReedRecordTextField (
140+ recordState = state.recordQuoteState,
141+ recordHintRes = R .string.edit_record_quote_hint,
142+ modifier = Modifier
143+ .fillMaxWidth()
144+ .height(140 .dp),
145+ keyboardOptions = KeyboardOptions (
146+ keyboardType = KeyboardType .Text ,
147+ imeAction = ImeAction .Default ,
148+ ),
149+ )
150+ Spacer (modifier = Modifier .height(ReedTheme .spacing.spacing8))
151+ Text (
152+ text = stringResource(R .string.edit_record_impression_label),
153+ color = ReedTheme .colors.contentPrimary,
154+ style = ReedTheme .typography.body1Medium,
155+ )
156+ Spacer (modifier = Modifier .height(ReedTheme .spacing.spacing2))
157+ ReedRecordTextField (
158+ recordState = state.recordImpressionState,
159+ recordHintRes = R .string.edit_record_impression_hint,
160+ modifier = Modifier
161+ .fillMaxWidth()
162+ .height(140 .dp),
163+ keyboardOptions = KeyboardOptions (
164+ keyboardType = KeyboardType .Text ,
165+ imeAction = ImeAction .Default ,
166+ ),
167+ )
168+ Spacer (modifier = Modifier .height(ReedTheme .spacing.spacing8))
169+ Row (
170+ modifier = Modifier .fillMaxWidth(),
171+ verticalAlignment = Alignment .CenterVertically ,
179172 ) {
180- val emotion = state.recordInfo.emotionTags.firstOrNull() ? : " "
181-
182173 Text (
183- text = emotion ,
184- color = ReedTheme .colors.contentSecondary ,
174+ text = stringResource( R .string.edit_record_emotion_label) ,
175+ color = ReedTheme .colors.contentPrimary ,
185176 style = ReedTheme .typography.body1Medium,
186177 )
187- Spacer (modifier = Modifier .width(ReedTheme .spacing.spacing1))
188- Icon (
189- imageVector = ImageVector .vectorResource(designR.drawable.ic_chevron_right),
190- contentDescription = " Chevron Right Icon" ,
191- tint = ReedTheme .colors.contentSecondary,
192- )
178+ Spacer (modifier = Modifier .weight(1f ))
179+ Row (
180+ modifier = Modifier .clickable {
181+ state.eventSink(RecordEditUiEvent .OnEmotionEditClick )
182+ },
183+ ) {
184+ val emotion = state.recordInfo.emotionTags.firstOrNull() ? : " "
185+
186+ Text (
187+ text = emotion,
188+ color = ReedTheme .colors.contentSecondary,
189+ style = ReedTheme .typography.body1Medium,
190+ )
191+ Spacer (modifier = Modifier .width(ReedTheme .spacing.spacing1))
192+ Icon (
193+ imageVector = ImageVector .vectorResource(designR.drawable.ic_chevron_right),
194+ contentDescription = " Chevron Right Icon" ,
195+ tint = ReedTheme .colors.contentSecondary,
196+ )
197+ }
193198 }
199+ Spacer (modifier = Modifier .height(ReedTheme .spacing.spacing16))
194200 }
195- Spacer (modifier = Modifier .height(ReedTheme .spacing.spacing16))
196201 }
197202 ReedButton (
198203 onClick = {
0 commit comments