What's a clean way to transition control from a WatchUi.Confirmation to the next view?
I want my app to show
- EntryView to enter data. Once the user is done, they hit a "save" affordance.
- EntryView shows a WatchUi.Confirmation to confirm the data is correct.
- Once the user hits "Confirm" in the Confirmation, I want to show a progress view that uploads the data.
but the ConfirmationDelegate.onResponse() doesn't seem to be able to call WatchUi.pushView() or WatchUi.switchToView() - neither call changes the current View.
After my user has entered data, I want to hit a "submit" control and show them a confirmation:
class EntryView extends WatchUi.View {
// Triggered by the user telling us to save.
public function onConfirmSave() as Void {
var value = self.getValueAsString();
var dialog = new WatchUi.Confirmation(Lang.format("Save $1$?", [value]));
WatchUi.pushView(
dialog,
new SaveConfirmationDelegate(self),
WatchUi.SLIDE_RIGHT
);
System.println("Done onConfirmSave");
}
In my ConfirmationDelegate, I'm trying to switch or pop:
function onResponse(response) {
// ...
var progressBar = new WatchUi.ProgressBar(
"Uploading...",
null
);
WatchUi.pushView(
progressBar,
null, // We only supply a delegate if we want to support back. We don't.
WatchUi.SLIDE_DOWN
);
// WatchUi.switchToView(progressBar, null, WatchUi.SLIDE_UP);
Neither results in the progress view being shown. I've tried returning both `true` and `false` from the onResponse().
What's the right way to switch to the new View?
I've been able to hack around this behavaviour by adding a flag in my EntryView that states we're done. Then, in EntryView.onShow() I call WatchUi.switchView() which seems to work. But that's really ugly. And the simulator shows a flicker of the EntryView being displayed before the next view is drawn.