Complete
over 5 years ago

WERETECH-8515, VVA4-4657

This is fixed as of the 4.50 firmware release for vivoactive 4.

latest fw update on VA4 killed behaviorDelegate

My app NASA PoD was working just fine on a number of devices and in the simulator.  I just updated my VA4 firmware (4.00, GPS 2.7) and the widget no longer scrolls within the text display using behaviorDelegate.  I tried a few things and it still does not work on the actual device.

class TextViewDelegate extends Ui.BehaviorDelegate {
    var isTouchScreen;

    function initialize() {
        BehaviorDelegate.initialize();
        isTouchScreen=Sys.getDeviceSettings().isTouchScreen;
        isTouchScreen=false; //override in attempt to fix VA4 bug
    }

    function onBack() {
        //Sys.println("onBack");
        Ui.popView(Ui.SLIDE_IMMEDIATE);
        return true;
    }

    function onNextMode() {
        //Sys.println("nextMode");
        return onNextPage();
    }
    
    function onNextPage() { // scroll down
        //Sys.println("next");
        if(!isTouchScreen) { 
            scroll(:UP);
            return true;
        }
        return false;
    }

    function onPreviousMode() {
        return onPreviousPage();
    }

    function onPreviousPage() { //scroll up
        //Sys.println("prev");
        if(!isTouchScreen) {
            scroll(:DOWN);
            return true;
        }
        return false;
    }

    function onSwipe(evt) {
        var dir=evt.getDirection();
        //Sys.println("swipe: "+dir);
        if(dir == Ui.SWIPE_UP) {
            scroll(:UP); 
            return true;
        }
        if(dir == Ui.SWIPE_DOWN) {
            scroll(:DOWN);
            return true;
        }
        return false;
    }

    function onHold(evt) {
        var coor = evt.getCoordinates();
        //Sys.println("onHold"+coor[0]+", "+coor[1]);
        return false;
    }
}

Parents
  • I've made the following workaround for my 2 widgets:

    - use onSelect() to do what is supposed to be in onNextPage()

    - use onMenu() to do what is supposed to be in onSelect()

    - sacrifice whatever is in onMenu()

    - sacrifice onPreviousPage() function

    Both my widgets do not have onMenu() so user can still use tap to go to the next page, long press the lower right button (menu) to select items. When the end of page is reached it wraps around to the first page. 

    Use the following code to determine if it's running on VA4 to enable the workaround.

     

    var dev = Sys.getDeviceSettings();
    var isVA4 = false;
    if (dev.partNumber.equals("006-B3224-00") || dev.partNumber.equals("006-B3225-00")) {
        isVA4 = true;
    }
     

Comment
  • I've made the following workaround for my 2 widgets:

    - use onSelect() to do what is supposed to be in onNextPage()

    - use onMenu() to do what is supposed to be in onSelect()

    - sacrifice whatever is in onMenu()

    - sacrifice onPreviousPage() function

    Both my widgets do not have onMenu() so user can still use tap to go to the next page, long press the lower right button (menu) to select items. When the end of page is reached it wraps around to the first page. 

    Use the following code to determine if it's running on VA4 to enable the workaround.

     

    var dev = Sys.getDeviceSettings();
    var isVA4 = false;
    if (dev.partNumber.equals("006-B3224-00") || dev.partNumber.equals("006-B3225-00")) {
        isVA4 = true;
    }
     

Children