Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the structure of the screen to Wear input snippet #281

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]
}