-
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
Allow custom camera app to be specified in a question #5738
Conversation
39f8a70
to
cd7e146
Compare
cd7e146
to
330c8ae
Compare
@seadowg will consider @lindsay-stevens's points at XLSForm/pyxform#651 (comment) when doing review. @grzesiek2010 and I still feel like it's the right way to go. |
@lognaturel @grzesiek2010 I don't actually think it makes sense for me to jump into XLSForm/XForm design discussion here if you're both already convinced we're going in the right direction - I think I'm hitting my context switching limit. If there's still some doubt that'd be helpful for me to weight in on though, let me know and I can dive in. For the moment, I'll remove myself as a reviewer and you can add me back on if this is ready to go. |
I think it's ready for review. We decided to stick to what we agreed on before and changes to pyxform will be merged soon. |
@grzesiek2010 Would it be possible to include an example XLSForm (and XForm seeing as the pyxform changes won't have released yet) in the PR description. Would make reviewing/testing a lot easier. |
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.
Yes, I forgot to add it. |
collect_app/src/main/java/org/odk/collect/android/formentry/media/PromptAutoplayer.java
Outdated
Show resolved
Hide resolved
collect_app/src/main/java/org/odk/collect/android/widgets/AnnotateWidget.java
Outdated
Show resolved
Hide resolved
collect_app/src/test/java/org/odk/collect/android/widgets/AnnotateWidgetTest.java
Show resolved
Hide resolved
330c8ae
to
15e2829
Compare
You can file issues like that separately after merging this pull request. It might be on our side but it also might be a bug in that external camera app. This is not directly related to letting users start particular camera apps. |
In Image and Annotate widget with "Choose image" when there's a wrong package or the external app isn't installed there's a toast on tapping "Take picture" but it's possible to add a photo via "Choose Image" button. I'm not sure what's the expected - "Choose Image" should be enabled or disabled? |
This is expected we were thinking about hiding that button entirely and only allowing users to take new pictures but if that's users want they can mix it with the |
Now i see that Android 13 (Google Pixel 6a) is using app called Pixel Camera (it is built-in app), probably it is not available on Redmi 10 |
This indicates that either the app is not installed or the package name is incorrect. But in this case the toast should be displayed in both cases. If the default camera app is started it might mean there is no package name specified at all. Are you sure that the question has it? |
It doesn't matter what the default camera app is. If you have a question with a package name if it's incorrect the built-in camera app should not be started and there should be a toast in both cases. Maybe you have two different forms? |
We've got the correct Package name in that case and we're using exactly the same form. |
That's ok
it shouldn't matter... you have a question with |
I checked package name using the app that You suggested and it turned out that it was actually the default app on Google Pixel. So to sum up: On Android 13 device the app with the com.google.android.GoogleCamera package name was already installed that's why it was available and on Android 10 device the app with the same package was not installed that's why we've seen the error toast. |
c1a5070
to
f2529e3
Compare
Triggering that action I set a flag that indicates it should be for image capturing. If there are apps that do not respect it that's not our fault. |
Tested with Success! Verified on device with Android 8.1, 10 Verified cases:
|
Tested with Success! Verified on device with Android 12, 13 |
Closes #5621
What has been done to verify that this works as intended?
I've tested the changes manually and added automated tests.
Why is this the best possible solution? Were any other approaches considered?
We have discussed other options (see in the issue) but decided that the issue should be fixed in this particular way.
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?
As described in the issue this should allow specifying custom camera apps in image/annotate widgets. We need to test carefully those two widgets and verify edge cases like:
Do we need any specific form for testing your changes? If so, please attach one.
I've used:
image_questions.xlsx
image_questions.xml.txt
Does this change require updates to documentation? If so, please file an issue here and include the link below.
Yes getodk/docs#1652
Before submitting this PR, please make sure you have:
./gradlew checkAll
and confirmed all checks still pass OR confirm CircleCI build passes and run./gradlew connectedDebugAndroidTest
locally.