Skip to content

Implement QR code scanner to join surveys#3711

Open
andreia-ferreira wants to merge 12 commits intomasterfrom
andreia/3639/qr-code-reader
Open

Implement QR code scanner to join surveys#3711
andreia-ferreira wants to merge 12 commits intomasterfrom
andreia/3639/qr-code-reader

Conversation

@andreia-ferreira
Copy link
Copy Markdown
Collaborator

@andreia-ferreira andreia-ferreira commented Apr 29, 2026

Fixes #3639

This PR introduces a QR code reader in the survey selector screen so the user can join unlisted surveys more easily:

MicrosoftTeams-video.mp4

ML Kit was used even though technically we could re-use the ZXing library for reading QR codes. However, that would require a custom implementation, while ML Kit ships its own scanner UI as a Play Services module, so we don't have to build/maintain a camera Activity or handle camera permissions ourselves at runtime

The error handling in the survey selector was polished: errors from survey listing, activation, and QR scanning now route through a single ShowError with a ErrorType with the different variants, mapped consistently in the fragment to the right popup string

@shobhitagarwal1612 PTAL?

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 68.81720% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.06%. Comparing base (1fe9e57) to head (d93ea17).

Files with missing lines Patch % Lines
.../android/ui/surveyselector/SurveySelectorScreen.kt 48.78% 21 Missing ⚠️
...ndroid/ui/surveyselector/SurveySelectorFragment.kt 28.57% 3 Missing and 2 partials ⚠️
...droid/ui/surveyselector/SurveySelectorViewModel.kt 85.00% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3711      +/-   ##
============================================
+ Coverage     68.02%   68.06%   +0.04%     
- Complexity     1582     1592      +10     
============================================
  Files           362      365       +3     
  Lines          9284     9366      +82     
  Branches       1199     1207       +8     
============================================
+ Hits           6315     6375      +60     
- Misses         2313     2329      +16     
- Partials        656      662       +6     
Files with missing lines Coverage Δ
.../groundplatform/android/system/GmsQrCodeScanner.kt 100.00% <100.00%> (ø)
...m/android/ui/surveyselector/SurveySelectorEvent.kt 100.00% <100.00%> (ø)
...g/groundplatform/domain/util/SurveyQrCodeParser.kt 100.00% <100.00%> (ø)
...droid/ui/surveyselector/SurveySelectorViewModel.kt 82.53% <85.00%> (+7.53%) ⬆️
...ndroid/ui/surveyselector/SurveySelectorFragment.kt 76.00% <28.57%> (-9.72%) ⬇️
.../android/ui/surveyselector/SurveySelectorScreen.kt 65.21% <48.78%> (-25.11%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@andreia-ferreira andreia-ferreira marked this pull request as ready for review May 5, 2026 13:09
@auto-assign auto-assign Bot requested a review from shobhitagarwal1612 May 5, 2026 13:09
@shobhitagarwal1612
Copy link
Copy Markdown
Member

Should this show a confirmation dialog with survey details before activating the survey?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Survey QR code reader right in the App

2 participants