How to properly use Picker?

I started using the Picker today - or at least tried to.

So far, I’ve run into two issues I haven’t been able to solve. I’ve tested both in the simulator and on a real device, and the problems occur in both environments.

  1. Scrolling behaves oddly
    I'm testing with three items. The Picker initially requests item 0 from the factory, but then the up/down behavior seems reversed.
  • Pressing up cycles through index 1, then 2, then wraps back to 0.
  • Pressing down jumps from 0 directly to 2, then to 1, and back to 0.
    It feels like the direction handling is flipped.
  1. Screen isn't fully cleared
    I created a custom class derived from Picker, implemented onUpdate, and cleared the Dc there — following the SDK example. I also override the Drawable of the picker elements and clear the Dc in that context too, since otherwise new elements just render on top of the old ones.

Despite this, parts of the underlying view still remain visible. Below is a screenshot showing the view before launching the Picker, followed by how it looks once the Picker is shown.

Any ideas or recommendations on how to resolve these issues?
Thanks in advance!

Top Replies

All Replies

  • In the simulator, the confirm icon appears to the right of the Drawable showing the current picker value. The Dc used has the same dimensions as the one the value Drawable is drawn onto. When I pass in a custom :confirm Drawable to the Picker, it displays correctly in the simulator as well.

    However, on the actual watch, the confirm icon doesn’t show at all - neither the default one nor my custom Drawable passed via :confirm.

  • In the end, I decided to implement a custom Picker. I needed a framework for other custom views anyway, and this approach allowed me to add features that aren't possible with the built-in Garmin Picker.

    The Picker supports two different layouts: one for button-based devices and another for touch-based devices. On button-based devices, input hints can still be triggered by touch. The position of these input hints is defined by a constant, which can be overridden for devices with non-standard button layouts.

    The only thing still missing is support for rectangular Garmin Edge devices - but I’ll get to that today.