Add drop-in UI support for Feedback Agent#7956
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new Navigation UI module that provides a drop-in “voice feedback” button + dialog UI backed by the existing FeedbackAgentSession / ASR state flow, wires it into the Drop-In dependency graph, and adds an examples app entry to demonstrate usage.
Changes:
- Introduces
libnavui-voicefeedback(resources, views, dialog, and a UI component orchestrating the flow). - Adds Drop-In installer support for optional MapView screenshot capture during feedback posting.
- Exposes
FeedbackAgentSession.getRegisteredInstance()and adds a new examples activity + menu entry.
Reviewed changes
Copilot reviewed 94 out of 94 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| settings.gradle | Includes the new :libnavui-voicefeedback module. |
| libnavui-voicefeedback/src/main/res/values/styles.xml | Adds styles for the button and dialog text. |
| libnavui-voicefeedback/src/main/res/values/strings.xml | Adds default voice feedback UI strings. |
| libnavui-voicefeedback/src/main/res/values/dimens.xml | Adds layout dimensions for button/dialog. |
| libnavui-voicefeedback/src/main/res/values/colors.xml | Adds color resources for voice feedback UI. |
| libnavui-voicefeedback/src/main/res/values/attrs.xml | Declares custom styling attributes for the button. |
| libnavui-voicefeedback/src/main/res/values-zh-rTW/strings.xml | Adds Traditional Chinese (TW) strings. |
| libnavui-voicefeedback/src/main/res/values-zh-rHK/strings.xml | Adds Chinese (HK) strings. |
| libnavui-voicefeedback/src/main/res/values-zh-rCN/strings.xml | Adds Simplified Chinese (CN) strings. |
| libnavui-voicefeedback/src/main/res/values-vi/strings.xml | Adds Vietnamese strings. |
| libnavui-voicefeedback/src/main/res/values-uk/strings.xml | Adds Ukrainian strings. |
| libnavui-voicefeedback/src/main/res/values-tr/strings.xml | Adds Turkish strings. |
| libnavui-voicefeedback/src/main/res/values-th/strings.xml | Adds Thai strings. |
| libnavui-voicefeedback/src/main/res/values-sw600dp-land/dimens.xml | Adds tablet/landscape dimension overrides. |
| libnavui-voicefeedback/src/main/res/values-sv/strings.xml | Adds Swedish strings. |
| libnavui-voicefeedback/src/main/res/values-sr/strings.xml | Adds Serbian strings. |
| libnavui-voicefeedback/src/main/res/values-sq/strings.xml | Adds Albanian strings. |
| libnavui-voicefeedback/src/main/res/values-sl/strings.xml | Adds Slovenian strings. |
| libnavui-voicefeedback/src/main/res/values-sk/strings.xml | Adds Slovak strings. |
| libnavui-voicefeedback/src/main/res/values-ru/strings.xml | Adds Russian strings. |
| libnavui-voicefeedback/src/main/res/values-ro/strings.xml | Adds Romanian strings. |
| libnavui-voicefeedback/src/main/res/values-pt/strings.xml | Adds Portuguese strings. |
| libnavui-voicefeedback/src/main/res/values-pt-rBR/strings.xml | Adds Portuguese (Brazil) strings. |
| libnavui-voicefeedback/src/main/res/values-pl/strings.xml | Adds Polish strings. |
| libnavui-voicefeedback/src/main/res/values-no-rNO/strings.xml | Adds Norwegian (NO) strings. |
| libnavui-voicefeedback/src/main/res/values-nl/strings.xml | Adds Dutch strings. |
| libnavui-voicefeedback/src/main/res/values-nl-rNL/strings.xml | Adds Dutch (NL) strings. |
| libnavui-voicefeedback/src/main/res/values-nl-rBE/strings.xml | Adds Dutch (BE) strings. |
| libnavui-voicefeedback/src/main/res/values-nb/strings.xml | Adds Norwegian Bokmål strings. |
| libnavui-voicefeedback/src/main/res/values-ms/strings.xml | Adds Malay strings. |
| libnavui-voicefeedback/src/main/res/values-lv/strings.xml | Adds Latvian strings. |
| libnavui-voicefeedback/src/main/res/values-lt/strings.xml | Adds Lithuanian strings. |
| libnavui-voicefeedback/src/main/res/values-ko/strings.xml | Adds Korean strings. |
| libnavui-voicefeedback/src/main/res/values-ja/strings.xml | Adds Japanese strings. |
| libnavui-voicefeedback/src/main/res/values-ja-rJP/strings.xml | Adds Japanese (JP) strings. |
| libnavui-voicefeedback/src/main/res/values-iw/strings.xml | Adds Hebrew strings. |
| libnavui-voicefeedback/src/main/res/values-it/strings.xml | Adds Italian strings. |
| libnavui-voicefeedback/src/main/res/values-is/strings.xml | Adds Icelandic strings. |
| libnavui-voicefeedback/src/main/res/values-in/strings.xml | Adds Indonesian strings. |
| libnavui-voicefeedback/src/main/res/values-hu/strings.xml | Adds Hungarian strings. |
| libnavui-voicefeedback/src/main/res/values-hr/strings.xml | Adds Croatian strings. |
| libnavui-voicefeedback/src/main/res/values-fr/strings.xml | Adds French strings. |
| libnavui-voicefeedback/src/main/res/values-fr-rCA/strings.xml | Adds French (Canada) strings. |
| libnavui-voicefeedback/src/main/res/values-fi/strings.xml | Adds Finnish strings. |
| libnavui-voicefeedback/src/main/res/values-et/strings.xml | Adds Estonian strings. |
| libnavui-voicefeedback/src/main/res/values-es/strings.xml | Adds Spanish strings. |
| libnavui-voicefeedback/src/main/res/values-es-rMX/strings.xml | Adds Spanish (Mexico) strings. |
| libnavui-voicefeedback/src/main/res/values-es-rES/strings.xml | Adds Spanish (Spain) strings. |
| libnavui-voicefeedback/src/main/res/values-en-rUS/strings.xml | Adds English (US) strings. |
| libnavui-voicefeedback/src/main/res/values-en-rSG/strings.xml | Adds English (Singapore) strings (currently inconsistent). |
| libnavui-voicefeedback/src/main/res/values-en-rIN/strings.xml | Adds English (India) strings (currently not English). |
| libnavui-voicefeedback/src/main/res/values-en-rGB/strings.xml | Adds English (UK) strings. |
| libnavui-voicefeedback/src/main/res/values-en-rAU/strings.xml | Adds English (AU) strings. |
| libnavui-voicefeedback/src/main/res/values-el/strings.xml | Adds Greek strings. |
| libnavui-voicefeedback/src/main/res/values-de/strings.xml | Adds German strings. |
| libnavui-voicefeedback/src/main/res/values-da/strings.xml | Adds Danish strings. |
| libnavui-voicefeedback/src/main/res/values-cs/strings.xml | Adds Czech strings. |
| libnavui-voicefeedback/src/main/res/values-bs-rBA/strings.xml | Adds Bosnian strings. |
| libnavui-voicefeedback/src/main/res/values-bg/strings.xml | Adds Bulgarian strings. |
| libnavui-voicefeedback/src/main/res/values-ar/strings.xml | Adds Arabic strings. |
| libnavui-voicefeedback/src/main/res/layout/mapbox_voice_feedback_dialog_layout.xml | Adds the dialog layout for ASR status + result/error states. |
| libnavui-voicefeedback/src/main/res/layout/mapbox_voice_feedback_button_layout.xml | Adds the button layout (icon-only). |
| libnavui-voicefeedback/src/main/res/drawable/mapbox_ic_voice_feedback.xml | Adds the voice feedback icon vector. |
| libnavui-voicefeedback/src/main/res/drawable/mapbox_ic_spinner_icon.xml | Adds spinner vector for processing state. |
| libnavui-voicefeedback/src/main/res/drawable/mapbox_ic_spinner_anim.xml | Adds animated-vector wrapper for spinner. |
| libnavui-voicefeedback/src/main/res/drawable/mapbox_ic_ok_sign.xml | Adds success icon vector. |
| libnavui-voicefeedback/src/main/res/drawable/mapbox_ic_mic.xml | Adds mic vector used for pulsing animation. |
| libnavui-voicefeedback/src/main/res/drawable/mapbox_ic_mic_pulsing.xml | Adds animated-vector wrapper for mic pulse. |
| libnavui-voicefeedback/src/main/res/drawable/mapbox_ic_error.xml | Adds error icon vector. |
| libnavui-voicefeedback/src/main/res/drawable/mapbox_ic_cancel.xml | Adds close/cancel icon vector. |
| libnavui-voicefeedback/src/main/res/drawable/mapbox_bg_voice_feedback_dialog.xml | Adds dialog background shape. |
| libnavui-voicefeedback/src/main/res/drawable/mapbox_bg_close_button_circle.xml | Adds close button background shape. |
| libnavui-voicefeedback/src/main/res/animator/pulse_circle_animation.xml | Adds pulse animation for mic icon. |
| libnavui-voicefeedback/src/main/res/animator/mapbox_spinner_rotation.xml | Adds rotation animator for spinner. |
| libnavui-voicefeedback/src/main/res/animator/mapbox_spinner_path.xml | Adds trimPath animator for spinner. |
| libnavui-voicefeedback/src/main/java/com/mapbox/navigation/ui/voicefeedback/view/MapboxVoiceFeedbackDialog.kt | Adds the dialog fragment that renders ASR state. |
| libnavui-voicefeedback/src/main/java/com/mapbox/navigation/ui/voicefeedback/view/MapboxVoiceFeedbackButton.kt | Adds a stylable custom view for the voice feedback button. |
| libnavui-voicefeedback/src/main/java/com/mapbox/navigation/ui/voicefeedback/internal/VoiceFeedbackComponent.kt | Adds the UIComponent that wires button ↔ session ↔ dialog ↔ telemetry posting. |
| libnavui-voicefeedback/src/main/java/com/mapbox/navigation/ui/voicefeedback/ComponentInstaller.kt | Adds a public installer extension for the voice feedback button component. |
| libnavui-voicefeedback/src/main/AndroidManifest.xml | Adds a manifest stub for the new library module. |
| libnavui-voicefeedback/proguard-rules.pro | Adds ProGuard rules placeholder for the module. |
| libnavui-voicefeedback/gradle.properties | Adds publishing metadata for the new artifact. |
| libnavui-voicefeedback/build.gradle | Adds Gradle configuration and dependencies for the new module. |
| libnavui-voicefeedback/.gitignore | Adds module-specific gitignore entries. |
| libnavui-dropin/src/main/java/com/mapbox/navigation/dropin/voicefeedback/VoiceFeedbackScreenshotComponentInstaller.kt | Adds Drop-In installer that optionally captures MapView screenshots. |
| libnavui-dropin/build.gradle | Exposes libnavui-voicefeedback through Drop-In. |
| libnavigation-voicefeedback/src/main/java/com/mapbox/navigation/voicefeedback/FeedbackAgentSession.kt | Adds getRegisteredInstance() to retrieve/register a singleton observer instance. |
| libnavigation-android/build.gradle | Re-exports libnavui-voicefeedback from the umbrella artifact. |
| gradle/publish.gradle | Registers the new artifact name mapping for publishing. |
| examples/src/main/res/values/strings.xml | Adds example list strings for voice feedback sample. |
| examples/src/main/res/layout/layout_activity_voice_feedback.xml | Adds the sample activity layout. |
| examples/src/main/java/com/mapbox/navigation/examples/voicefeedback/MapboxVoiceFeedbackActivity.kt | Adds a sample activity demonstrating the voice feedback UI API. |
| examples/src/main/java/com/mapbox/navigation/examples/MainActivity.kt | Adds the new sample entry to the examples list. |
| examples/src/main/AndroidManifest.xml | Registers the new example activity. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <path | ||
| android:name="red_circle" | ||
| android:fillColor="#BE3B30" | ||
| android:pathData="M20,0A20,20 0 1,1 20,40A20,20 0 1,1 20,0" /> | ||
| </group> |
| @@ -0,0 +1,5 @@ | |||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#09AA74" android:viewportHeight="960" android:viewportWidth="960" android:width="24dp"> | |||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
| android:height="@dimen/mapbox_voice_feedback_close_icon_size" | ||
| android:width="@dimen/mapbox_voice_feedback_close_icon_size" | ||
| android:tint="#FFFFFF" | ||
| android:viewportHeight="960" | ||
| android:viewportWidth="960"> |
| override fun onAttached(mapboxNavigation: MapboxNavigation) { | ||
| super.onAttached(mapboxNavigation) | ||
| this.mapboxNavigation = mapboxNavigation | ||
| session.onAttached(mapboxNavigation) | ||
| session.connect() | ||
|
|
||
| coroutineScope.launch { | ||
| mapboxNavigation | ||
| .flowLocationMatcherResult() | ||
| .collect { locationMatcherResult = it } | ||
| } | ||
|
|
||
| coroutineScope.launch { | ||
| session.asrState.collect { state -> | ||
| if (state is ASRState.Result) { | ||
| postFeedback(state) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| coroutineScope.launch { | ||
| isDialogVisible.collectLatest { visible -> | ||
| if (visible) { | ||
| showDialog() | ||
| } else { | ||
| dismissDialog() | ||
| } | ||
| } | ||
| } | ||
|
|
||
| button.setOnClickListener { onButtonClicked() } | ||
| } |
| isDialogVisible.value = true | ||
| } | ||
|
|
||
| private fun showDialog() { |
There was a problem hiding this comment.
How is it supposed to work in terms of lifecycle of android components? When dialog is shown and then configuration change happens, will the dialog recreated by the system be reattached to the component? Does this component survive configuration change at all? Did you test scenario when configuration change happens while dialog is shown?
screen-20260609-182012.mp4