Fixed updating the list of questions with audio widgets #5961
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #5955
Closes #5956
Why is this the best possible solution? Were any other approaches considered?
If there are multiple audio widgets on one page they all receive updates (recording status) if one of them is working. Those updates just pass null values so this doesn't change their state. If it's such a null value we shouldn't call the
WidgetValueChangedListener
because then it causes problems like the ones I have fixed in this pull request.BTW. I'm not sure if other (not active) audio widgets should receive such null values as states (it might be redundant) but there is a test for that scenario so I didn't feel confident enough to change this behavior.
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
We can focus on testing audio widgets here. The problem seemed to be visible only when more than one audio widget was used in a field-list but let's test simple cases with just one widget too.
Do we need any specific form for testing your changes? If so, please attach one.
No.
Does this change require updates to documentation? If so, please file an issue here and include the link below.
No.
Before submitting this PR, please make sure you have:
./gradlew connectedAndroidTest
(or./gradlew testLab
) and confirmed all checks still pass