-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 hidden-answer
appearance for barcode questions
#5870
Conversation
no-answer
appearance for barcode questions
@@ -69,6 +69,7 @@ object Appearances { | |||
const val NEW_FRONT = "new-front" | |||
const val NEW = "new" | |||
const val FRONT = "front" | |||
const val NO_ANSWER = "no-answer" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no answer
sounds confusing to me. The goal is to still keep it but not display so I think something like hidden-answer
, protected-answer
, secret-answer
could be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah @lognaturel weren't sure how we felt about it when talked yesterday. hidden-answer
is so much better thanks!
widgetValueChanged(); | ||
} | ||
|
||
private void updateVisibility() { | ||
if (hasAppearance(getFormEntryPrompt(), Appearances.NO_ANSWER)) { | ||
binding.barcodeAnswerText.setVisibility(GONE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to display *******
for example so that it's clear the answer is still there but protected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is intended for use with another question on the same screen (in a field-list) displaying the data so I don't think we'd need that. The goal here was to reduce the noise, not protect the scanned data. I think the responsibility to make it clear that the answer is scanned would be moved to the form designer here (as they're opting in to hide the answer). Good to get @lognaturel's thoughts as well!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok I thought that the appearance could be used for having protected/secret questions too but there should be a separate one for cases like that and then displaying *******
would make sense.
In the case described on the forum, it's better to display nothing, We should make sure this is clear in the documentation that the new appearance is for hiding questions but not making them protected.
widgetValueChanged(); | ||
} | ||
|
||
private void updateVisibility() { | ||
if (hasAppearance(getFormEntryPrompt(), Appearances.NO_ANSWER)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do not display the answer in the widget we should not display it in the hierarchy view as well I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I feel like it's ok to leave the data in the hierarchy right now as we can improve this later if people need it to hide there as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah especially if it's just for hiding questions not making them protected it's not that important.
collect_app/src/test/java/org/odk/collect/android/widgets/BarcodeWidgetTest.java
Outdated
Show resolved
Hide resolved
collect_app/src/test/java/org/odk/collect/android/widgets/BarcodeWidgetTest.java
Show resolved
Hide resolved
collect_app/src/test/java/org/odk/collect/android/widgets/BarcodeWidgetTest.java
Show resolved
Hide resolved
no-answer
appearance for barcode questionshidden-answer
appearance for barcode questions
Thanks for the naming improvement, @grzesiek2010! The behavior matches my understanding of the requirements. Let's get it in beta! |
@seadowg can you please update the forum thread with the new proposed appearance name to reduce confusion? |
@seadowg We have a few questions to the PR (what should be tested) and how the new appearance should work:
|
It should only work for
Good catch. We discussed that earlier here and decided that's ok.
I don't think that specific use case needs to be tested, but it'd definitely be nice to try it out in a field-list. |
Tested with Success! Verified on a device with Android 10 Verified cases:
|
Tested with Success! Verified on a device with Android 13 |
As discussed at https://forum.getodk.org/t/addition-of-minimal-or-no-answer-appearance-for-question-types-that-launch-an-external-selector/41151/3.
This adds support for a new
hidden-answer
appearance forbarcode
questions. If present, barcode contents will never be shown under the "Scan Barcode"/"Replace Barcode" button. It might be that we want to add some indication that the barcode has been scanned (other than the button changing to "Replace Barcode"). For the moment, the intention is for it to be used with anote
on the same screen to display a formatted version of the barcode contents.Why is this the best possible solution? Were any other approaches considered?
New tests and verified manually.
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?
Should just add the new appearance. It'd be good to check that the barcode still behaves correctly without the appearance. Other than, not much has been touched.
Do we need any specific form for testing your changes? If so, please attach one.
Any form with
barcode
(and the new appearance).Does this change require updates to documentation? If so, please file an issue here and include the link below.
getodk/docs#1723
Before submitting this PR, please make sure you have:
./gradlew connectedAndroidTest
(or./gradlew testLab
) and confirmed all checks still pass