DataField onTap()

Did any of you try to configure an InputDelegate with Data Field ?
I am able to make it work using the simulator, but it does not work if I copy the .prg on my vivoactive3 music.

To troubleshoot, I have added simple System.println() statement. I can see onTap() is never called on the watch, but is called using the Simulator...
  • I am using CIQ 3.0.3 with Eclipse 4.8.0.
  • I'm almost certain that this is not something that is supposed to work with wearables, even the ones that support touch like the vva3/m. I see that an issue has been filed, so maybe that will change.
  • Travis.ConnectIQ on a related note, are there any plans to ever support any kind of user interaction for data fields? I understand that there really aren't enough buttons on watches to have direct interaction, but it would be great if datafields could hook into the context-sensitive menu and provide settings and/or alternate views. (I realize this opens up a whole cans of worms, especially with memory usage).

    It would allow devs to create data field apps which can do things that aren't possible today, like scrolling through all laps in an activity or dynamically changing app settings. Currently if you want any kind of custom interaction within an activity, you have go and implement a full device app.
  • I know. This was a topic that I discussed with a few people at the Developer's Conference back in April, and I think it is a great idea.

    I don't know how difficult it would be from the device side, but it would be really nice if a data field could have a delegate that implemented onMenu(). If the user pressed/held the menu button while in activity mode, the system menu would appear, and then at the bottom we could show a menu item for ConnectIQ data fields that provided a delegate. When the menu item for a data field was selected, we'd just call onMenu() for the delegate for that app and load up the menu.

  • Travis.ConnectIQ thanks for sharing! It's good to hear that the topic is under discussion.
  • BTW, based on the following link, onTap() should work.
    https://developer.garmin.com/connect-iq/programmers-guide/user-interface/
    [h=3]Data Field[/h] On Devices with touch screen support, an input delegate can be used to accept input. Only the onTap() behavior is supported and will be triggered when the user touches a point inside the data field when it is active on the screen. The behavior delegate should be the second element of the array that is returned from getInitialView as with other app types.

    // This data field accepts touch input class DataFieldApp extends App.AppBase { // Data field view with associated behavior delegate function getInitialView() { return [ new DataFieldView(), new DataFieldDelegate() ]; } } class DataFieldDelegate extends Ui.InputDelegate { // Handle touch events function onTap(evt) { // Process the touch event } }
  • Like I said.. *almost* certain. :)
  • Okay. We determined that this is both a bug in our documentation and in our simulator. This should not work in datafields on wearable devices. Sorry about the confusion. We have plans to update the docs and the simulator to reflect the device behavior. Thank you for the report!

    -Coleman
  • Thanks Coleman. It would have been a nice feature. Hopefully, this is something you can add in future releases...
  • Hello FlowState. I found usefull your app builder as my Fenix5 didnt count my laps at my small 10 meters pool. I have switched automat lap counter, switched off gps and using openwater swim app. Im using lap button each 20meters and swimming 20 times. After that I had to go to my activity on the phone and change distance from 0 to 400 meters.
    I found usefull today to see at least how many laps I did by your appbuilder. Is there possibility with every lap to write into distance +20 meters and final activity will record my 20x20=400meter distance and not zero as now?
    I appreciate your help and answer.