Skip to content

Commit 0e33487

Browse files
authored
Merge pull request #281 from android/input
Add the structure of the screen to Wear input snippet
2 parents 37f5da8 + a5736c1 commit 0e33487

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

wear/src/main/java/com/example/wear/snippets/voiceinput/VoiceInputScreen.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,23 +77,28 @@ fun VoiceInputScreen() {
7777
}
7878
}
7979

80-
// [START_EXCLUDE android_wear_voice_input]
8180
val scrollState = rememberScrollState()
8281

8382
ScreenScaffold(scrollState = scrollState) {
83+
//rest of implementation here
84+
// [START_EXCLUDE]
8485
val padding = ScalingLazyColumnDefaults.padding(
8586
first = ItemType.Text,
8687
last = ItemType.Chip
8788
)()
89+
// [END_EXCLUDE]
8890
Column(
91+
//rest of implementation here
92+
// [START_EXCLUDE]
8993
modifier = Modifier
9094
.fillMaxSize()
9195
.verticalScroll(scrollState)
9296
.rotaryWithScroll(scrollState)
9397
.padding(padding),
9498
verticalArrangement = Arrangement.Center
9599
) {
96-
// [END_EXCLUDE android_wear_voice_input]
100+
// [END_EXCLUDE]
101+
97102
// Create an intent that can start the Speech Recognizer activity
98103
val voiceIntent: Intent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH).apply {
99104
putExtra(
@@ -114,9 +119,7 @@ fun VoiceInputScreen() {
114119
label = stringResource(R.string.voice_input_label),
115120
secondaryLabel = textForVoiceInput
116121
)
117-
// [START_EXCLUDE android_wear_voice_input]
118122
}
119123
}
120-
// [END_EXCLUDE android_wear_voice_input]
121124
// [END android_wear_voice_input]
122125
}

0 commit comments

Comments
 (0)