Skip to content

Fix progress bar misaligned on photo task#3671

Open
andreia-ferreira wants to merge 3 commits intomasterfrom
andreia/fix-photo-task-progress-bar
Open

Fix progress bar misaligned on photo task#3671
andreia-ferreira wants to merge 3 commits intomasterfrom
andreia/fix-photo-task-progress-bar

Conversation

@andreia-ferreira
Copy link
Copy Markdown
Collaborator

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

while testing the latest master to prepare for a new release @jo-spek found that the progress bar was misaligned. This seems to happen after taking a picture in the photo task and it's because, when going back to the app, the fragment collects the latest value from footerVerticalPosition and applies it immediately. However, the system window insets are not yet fully re-dispatched after resuming the Activity, which means the top system bar inset may temporarily be reported as 0. This causes the calculated footer position to be incorrect.

In order to fix this, the windowInsets from the MainViewModel is now also being combined with footerVerticalPosition before applying the final position. This ensures that every time the insets or footer position change, the progress bar updates accordingly.
As an extra precaution, TaskScreen was updated to store the Y position as a Float instead of relying on LayoutCoordinates, since its reused reference may not trigger updates in compose

Before

Screen_recording_20260414_110920.webm

After

Screen_recording_20260414_110803.webm

@shobhitagarwal1612 PTAL?

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 14, 2026

Codecov Report

❌ Patch coverage is 55.55556% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.34%. Comparing base (5185403) to head (e0a88d8).

Files with missing lines Patch % Lines
...ndroid/ui/datacollection/DataCollectionFragment.kt 33.33% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3671      +/-   ##
============================================
- Coverage     67.40%   67.34%   -0.06%     
+ Complexity     1608     1607       -1     
============================================
  Files           365      365              
  Lines          9182     9182              
  Branches       1171     1171              
============================================
- Hits           6189     6184       -5     
- Misses         2341     2347       +6     
+ Partials        652      651       -1     
Files with missing lines Coverage Δ
...form/android/ui/datacollection/tasks/TaskScreen.kt 93.54% <100.00%> (-0.21%) ⬇️
...ndroid/ui/datacollection/DataCollectionFragment.kt 78.82% <33.33%> (-5.71%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant