Add buttons on ODK-collect app topbar

Hi, we are developing an app derivating the ODK-collect app, thank guys for
the work you are doing with the splendid ODK world.

We need to add custom buttons on the app topbar, near the actual ODK
collect icons on the right.

The button should add a value to a survey variable everytime is pressed,
and another shold interrupt the current survey and close the survey.

Which would be the best way to do this kind of modification? There are
external library that permit to achieve this aim?

Thank you very much
Angelo

This could be tricky to do.

ODK Collect is based upon the concept of having a single active prompt
(data field).

When the prompt loses focus, the value in the display widget is saved into
that data field. And any fields or calculations or relevant conditions that
depend upon that value would be re-evaluated with this new value.

If I understand you correctly, the button would be always present,
regardless of what screen / prompt is being displayed.

In this case, you would probably want to modify ODKView

And when you do the update, you probably need to consider how you want the
focus and save/update to work w.r.t. whatever current screen / prompt is
being displayed. There may be many subtle interactions with the field you
are currently displaying -- e.g., what if the value you've incremented
suddenly causes the screen you are displaying to become no longer relevant
/ visible? i.e., there are many interactions that you need to ensure that
form designers never try to utilize, as they won't work correctly.

There are no external libraries for this.

As for the special button to close ODK Collect, perhaps what you want is to
change the behavior of the 'back' action to not display the Save Changes /
Ignore Changes menu, but to always instead default to taking the Save
Changes action? I.e., no added button, just a redefinition of the back
action behavior? In either case, the action you would want is probably one
of those.

··· On Thu, Jan 8, 2015 at 12:37 PM, Angelo Lazzari wrote:

Hi, we are developing an app derivating the ODK-collect app, thank guys
for the work you are doing with the splendid ODK world.

We need to add custom buttons on the app topbar, near the actual ODK
collect icons on the right.

The button should add a value to a survey variable everytime is pressed,
and another shold interrupt the current survey and close the survey.

Which would be the best way to do this kind of modification? There are
external library that permit to achieve this aim?

Thank you very much
Angelo

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Hi Mitch, thank you very much for the answer.

As you wrote i want the buttons stay always visible on the top bar.
For the incremental button it won't display anything it will just increase
a variable, but you're right: the active survey question will lose the
focus, so, i will check what will happen.

For the other button, the solution you understand could be another
possibility to abort the active survey, but i was thinking about to save
the current survey value valued till the abort event.

So, thought as you said it could be tricky i will try to code something,
even just to confirm your thoughts.

Again, thanks for your time
Angelo

··· Il giorno Thu Jan 08 2015 at 23:25:47 Mitch Sundt ha scritto:

This could be tricky to do.

ODK Collect is based upon the concept of having a single active prompt
(data field).

When the prompt loses focus, the value in the display widget is saved into
that data field. And any fields or calculations or relevant conditions that
depend upon that value would be re-evaluated with this new value.

If I understand you correctly, the button would be always present,
regardless of what screen / prompt is being displayed.

In this case, you would probably want to modify ODKView

And when you do the update, you probably need to consider how you want the
focus and save/update to work w.r.t. whatever current screen / prompt is
being displayed. There may be many subtle interactions with the field you
are currently displaying -- e.g., what if the value you've incremented
suddenly causes the screen you are displaying to become no longer relevant
/ visible? i.e., there are many interactions that you need to ensure that
form designers never try to utilize, as they won't work correctly.

There are no external libraries for this.

As for the special button to close ODK Collect, perhaps what you want is
to change the behavior of the 'back' action to not display the Save Changes
/ Ignore Changes menu, but to always instead default to taking the Save
Changes action? I.e., no added button, just a redefinition of the back
action behavior? In either case, the action you would want is probably one
of those.

On Thu, Jan 8, 2015 at 12:37 PM, Angelo Lazzari lazzari.angelo@gmail.com wrote:

Hi, we are developing an app derivating the ODK-collect app, thank guys
for the work you are doing with the splendid ODK world.

We need to add custom buttons on the app topbar, near the actual ODK
collect icons on the right.

The button should add a value to a survey variable everytime is pressed,
and another shold interrupt the current survey and close the survey.

Which would be the best way to do this kind of modification? There are
external library that permit to achieve this aim?

Thank you very much
Angelo

--

You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

--
You received this message because you are subscribed to a topic in the
Google Groups "ODK Developers" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/opendatakit-developers/t9pvVwUQN8w/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.