File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
android/SherpaOnnxTtsEngine/app/src/main/java/com/k2fsa/sherpa/onnx/tts/engine Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,9 @@ import androidx.compose.foundation.layout.fillMaxSize
2222import androidx.compose.foundation.layout.fillMaxWidth
2323import androidx.compose.foundation.layout.padding
2424import androidx.compose.foundation.layout.wrapContentHeight
25+ import androidx.compose.foundation.rememberScrollState
2526import androidx.compose.foundation.text.KeyboardOptions
27+ import androidx.compose.foundation.verticalScroll
2628import androidx.compose.material3.Button
2729import androidx.compose.material3.ExperimentalMaterial3Api
2830import androidx.compose.material3.MaterialTheme
@@ -109,6 +111,7 @@ class MainActivity : ComponentActivity() {
109111 var rtfText by remember {
110112 mutableStateOf(" " )
111113 }
114+ val scrollState = rememberScrollState(0 )
112115
113116 val numSpeakers = TtsEngine .tts!! .numSpeakers()
114117 if (numSpeakers > 1 ) {
@@ -142,9 +145,11 @@ class MainActivity : ComponentActivity() {
142145 value = testText,
143146 onValueChange = { testText = it },
144147 label = { Text (" Please input your text here" ) },
148+ maxLines = 10 ,
145149 modifier = Modifier
146150 .fillMaxWidth()
147151 .padding(bottom = 16 .dp)
152+ .verticalScroll(scrollState)
148153 .wrapContentHeight(),
149154 singleLine = false ,
150155 )
You can’t perform that action at this time.
0 commit comments