Hi,
I'd like to implement an overlay for my widget, which is displayed only for a second. I thought the best way to do this is create a new layer, and then set its visibility to false with a timer:
function drawOverlay( dc as Dc ) { _drawLayer = new WatchUi.Layer({}); addLayer( _drawLayer ); var layerDc = _drawLayer.getDc(); // draw layer content here var timer = new Timer.Timer(); timer.start( method(:hidePageIndicator), 1000, false ); } function hidePageIndicator() as Void { _drawLayer.setVisible( false ); WatchUi.requestUpdate(); }
What I noticed is that setVisible() alone does not hide the layer. I have to request an update, or otherwise the change in visibility is only taking affect when onUpdate() is called the next time for another reason.
Is there a more efficient way to implement this, particularly without having to request an update and redraw also the main layer? My whole point of using a layer was to not having to do that.