How to support multi pages in a widget just like the native widget Training Status does

Hi, 

I am making a widget with multi-pages. Now my getInitialView is like below

function getInitialView(){
    var lastSelectedIndex = $.globalCode.loadStorage("LAST_PAGE_INDEX");
    var multiQrViewDelegate = new MultiQrViewDelegate(
        codeUrls,
        codeUrls.size(),
        lastSelectedIndex
      );
    return [multiQrViewDelegate.createScreenPickerView(),multiQrViewDelegate];
}   

The delegate implements onNextPage and onPreviousPage defined by BehaviorDelegate.
However, if I press up/down button when it was launched on a real device, the page will be next or previous system widget rather than the view as expected.
I saw the preisntalled Training Status widget, which is my goal.
Some facts in my mind now.
1. Training Status and other  pre-installed apps are writen in native code. So third party apps cannot implement that. (Probably not)
2. In SDK 4.x and later, widgets are compiled to super apps. I am also aware of the absense of widgets in GDVC2022(actually since 2020). If my app is launching on a SDK4.x, it will look like what I am expecting
  • Things are different if the app is started from a glance or not  If not started from a glance, up/down moves through the widget loop and not through the widget's screens.,

    You can push a second view and have it's delegate handle the up/down, but then there is no way to exit your widget from the second view. (You can't pop the views to exit or use exit() to do this.

    isGlanceModeEnabled can be used to see how the app was started to see if you need the second view.

    Remember, native stuff isn't written in CIQ and can do things differently

  • JIM, thanks for your suggestion. I got.it.