No announcement yet.

DataField onTap()

  • Time
  • Show
Clear All
new posts

  • 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...

  • #2
    I am using CIQ 3.0.3 with Eclipse 4.8.0.


    • #3
      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.
      Last edited by Travis.ConnectIQ; 10-12-2018, 11:30 PM.


      • #4
        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.


        • #5
          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.


          • #6
            Travis.ConnectIQ thanks for sharing! It's good to hear that the topic is under discussion.


            • #7
              BTW, based on the following link, onTap() should work.
              Data Field

              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 } }


              • #8
                Like I said.. *almost* certain.