[Interest] Standardized StackView navigation
Jason H
jhihn at gmx.com
Mon Jan 18 18:23:03 CET 2016
What are your thoughts with extending StackView (maybe a derived class called 'ScreenStack' or 'ActivityStack')
I've done a number of mobile-paradigm based apps, and seem to be convergently evolving the same pattern.
main.qml {
ScreenStack {}
Screen1 {}
Screen2 {}
Screen3 {}
Screen4 {}
}
Screen.qml {
visible: false
// lifecycle
signal created();
signal entered();
signal exited();
signal destroyed();
// navigation
signal next();
signal back();
}
ScreenX.qml {
Screen {
}
}
Which is similar to android, minus the pause/resume. ( http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle )
I figure it would be cool to have a 'ScreenView' that would properly instrument the lifecycle, and potentially the navigation.
Currently, I implement entered/exited with onVisibleChanged, destroyed is not implemented, and created is Component.onCompleted.
I also have used this to implement dynamic workflows. To avoid Apple app store restrictions, a JSON object was retrieved from the server which contained the names of QML files, which existed locally in the application, with a trivial decision tree to decide the next screen. In this case, each screen was dynamically created.
Thoughts?
More information about the Interest
mailing list