Skip to content

Commit

Permalink
Merge pull request #281 from android/input
Browse files Browse the repository at this point in the history
Add the structure of the screen to Wear input snippet
  • Loading branch information
kul3r4 authored Jun 17, 2024
2 parents 37f5da8 + a5736c1 commit 0e33487
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,28 @@ 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)
.rotaryWithScroll(scrollState)
.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(
Expand All @@ -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]
}

0 comments on commit 0e33487

Please sign in to comment.