collect
collect copied to clipboard
Rework performing actions in a form view that can't be triggered immediately after creating a question view
Problem description
We keep having problems with performing some actions after creating question views like:
- displaying a keyboard for text widgets https://github.com/getodk/collect/pull/5843/files#diff-c2ee7ae36f7c566b42448bec3d149e4f128d0e941e5450d5ad3f64aa37692613R12
- scrolling to a question with an invalid answer (if there are multiple questions on one page) https://github.com/getodk/collect/blob/master/collect_app/src/main/java/org/odk/collect/android/formentry/ODKView.java#L623
- playing videos automatically https://github.com/getodk/collect/blob/master/collect_app/src/main/java/org/odk/collect/android/formentry/ODKView.java#L248
In all those cases we have implemented workarounds by delaying them slightly (~100ms). Although it works it doesn't seem to be a reliable code.
It looks like we try to perform all those actions too early (after creating question views). Maybe we need a new method that would be called when the view and activity are ready.