Two questions regarding swipe left and right

I'm working on adding more 'pages' to a widget I'm working on using swipe left and right. In the simulator, swiping left brings me the new 'page' (ie, layout with its own code to interact with) and swiping right brings me back to the make 'page' (layout). Pressing ESC while on the second page brings me back to the main page and pressing ESC again exit the widget. This is working great. However, on my Venu, swiping right or pressing ESC while on the second page exits the widget. Is there a way to make the watch behave like the simulator?

Second question is, can swipe left and right be implemented on devices without a touch screen?

Thanks.

  • I think my problem is mentioned here. I was (well, still am until I fix it) 'hacking' the main view and delegate for the other pages. It was an easy way but looks like it was too easy lol.

    forums.garmin.com/.../swipe-stop-to-work-on-some-devices

  • Instead of using onSwipe(), you may want to use onNextPage() and onPreviousPage() this works with both touch and non-touch device (up/down button or up/down swipe).

    If your widget is started from a glance, that should work (see System.getDeviceSettings().isGlanceModeEnabled;)

    if you aren't started from a glance, you can push a second view and use that for the up/down events.

    The sim should work like the watch.  Not the watch should work like the sim, IMHO

  • Thanks. My watch Venu, doesn't support glance. What do you mean by push a second view? I'm also using up/down/left/right, not just up/down. The left/right swipes move between views and up/down swipes scroll through the text displayed in those views (there is too much text to display on just one screen) like such:

    This is the main screen:

    One swipe left brings this:

    Swiping up brings this:

    Up/Down moves between the text on those views and left/right move between the different views (main, charge, climate and drive). Can I do the same with buttons?

    Thanks for you help. I've seen your name here helping people like me forever. Much appreciated Slight smile

    Edit: Forgot to add, the four buttons are already used to select the item on that quarter of the screen on the main screen (onMenu, onSelect, onNextPage and onPreviousPage).

    Edit. thinking about your reply, if by pushing a second view you mean from the main view, push a view with its own behavior delegate to display the dara, yeah, that's what I'm doing now. Each page has its own view and delegate and I'm using 'invoke' (in the onBack function) to pass to the main view which view the swipe left is trying to access.