From a5736c15ed1639437a8a6e180af39f45a000e11c Mon Sep 17 00:00:00 2001 From: Chiara Chiappini Date: Fri, 14 Jun 2024 17:00:49 +0100 Subject: [PATCH] add the structure of the screen --- .../wear/snippets/voiceinput/VoiceInputScreen.kt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/wear/src/main/java/com/example/wear/snippets/voiceinput/VoiceInputScreen.kt b/wear/src/main/java/com/example/wear/snippets/voiceinput/VoiceInputScreen.kt index 36e3e19b..4109b95e 100644 --- a/wear/src/main/java/com/example/wear/snippets/voiceinput/VoiceInputScreen.kt +++ b/wear/src/main/java/com/example/wear/snippets/voiceinput/VoiceInputScreen.kt @@ -77,15 +77,19 @@ fun VoiceInputScreen() { } } - // [START_EXCLUDE android_wear_voice_input] val scrollState = rememberScrollState() ScreenScaffold(scrollState = scrollState) { + //rest of implementation here + // [START_EXCLUDE] val padding = ScalingLazyColumnDefaults.padding( first = ItemType.Text, last = ItemType.Chip )() + // [END_EXCLUDE] Column( + //rest of implementation here + // [START_EXCLUDE] modifier = Modifier .fillMaxSize() .verticalScroll(scrollState) @@ -93,7 +97,8 @@ fun VoiceInputScreen() { .padding(padding), verticalArrangement = Arrangement.Center ) { - // [END_EXCLUDE android_wear_voice_input] + // [END_EXCLUDE] + // Create an intent that can start the Speech Recognizer activity val voiceIntent: Intent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH).apply { putExtra( @@ -114,9 +119,7 @@ fun VoiceInputScreen() { label = stringResource(R.string.voice_input_label), secondaryLabel = textForVoiceInput ) - // [START_EXCLUDE android_wear_voice_input] } } - // [END_EXCLUDE android_wear_voice_input] // [END android_wear_voice_input] }