@@ -39,6 +39,7 @@ import androidx.compose.ui.Modifier
3939import androidx.compose.ui.graphics.Color
4040import androidx.compose.ui.res.painterResource
4141import androidx.compose.ui.res.stringResource
42+ import androidx.compose.ui.unit.Dp
4243import androidx.compose.ui.unit.dp
4344import com.nextcloud.client.assistant.AssistantViewModel
4445import com.nextcloud.client.assistant.model.AssistantScreenState
@@ -76,6 +77,7 @@ fun TranslationScreen(selectedTaskType: TaskTypeData?, viewModel: AssistantViewM
7677 .padding(top = 32 .dp),
7778 floatingActionButton = {
7879 FloatingActionButton (onClick = {
80+ // TODO:
7981 val originLang = sourceState.language
8082 val targetLang = targetState.language
8183 if (originLang != null && targetLang != null ) {
@@ -93,6 +95,7 @@ fun TranslationScreen(selectedTaskType: TaskTypeData?, viewModel: AssistantViewM
9395 hintId = R .string.translation_screen_hint_source,
9496 state = sourceState,
9597 availableLanguages = languages?.originLanguages ? : emptyList(),
98+ maxDp = 120 .dp,
9699 onStateChange = { sourceState = it }
97100 )
98101 }
@@ -111,6 +114,7 @@ fun TranslationScreen(selectedTaskType: TaskTypeData?, viewModel: AssistantViewM
111114 hintId = R .string.translation_screen_hint_target,
112115 state = targetState,
113116 availableLanguages = languages?.targetLanguages ? : emptyList(),
117+ maxDp = Dp .Unspecified ,
114118 onStateChange = { targetState = it }
115119 )
116120 }
@@ -124,6 +128,7 @@ private fun TranslationSection(
124128 hintId : Int ,
125129 state : TranslationSideState ,
126130 availableLanguages : List <TranslationLanguage >,
131+ maxDp : Dp ,
127132 onStateChange : (TranslationSideState ) -> Unit
128133) {
129134 Row (
@@ -171,7 +176,7 @@ private fun TranslationSection(
171176 onValueChange = { onStateChange(state.copy(text = it)) },
172177 modifier = Modifier
173178 .fillMaxWidth()
174- .heightIn(min = 120 .dp, max = 240 .dp ),
179+ .heightIn(min = 120 .dp, max = maxDp ),
175180 placeholder = {
176181 Text (text = stringResource(hintId), style = MaterialTheme .typography.headlineSmall)
177182 },
0 commit comments