Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kineticscroll] Sometimes missing red back button, especially w/o widgets #3389

Closed
thyttan opened this issue Apr 29, 2024 · 1 comment · Fixed by #3392
Closed

[kineticscroll] Sometimes missing red back button, especially w/o widgets #3389

thyttan opened this issue Apr 29, 2024 · 1 comment · Fixed by #3392
Assignees
Labels
area-boot Bangle2 Related to Bangle.js 2 state-started type-bug Something isn't working

Comments

@thyttan
Copy link
Collaborator

thyttan commented Apr 29, 2024

Affected hardware version

Bangle 2

Your firmware version

2v21.107

The bug

@halemmerich

The red back button will sometimes be missing when using kineticscroll, especially when no widgets are loaded or shown.

This problem seems similar to #2168 so I reused/updated the debug code I made there, see below. Maybe the fix Gordon did there can be applied here as well.

/*
Test code for trying menu system with/without widget field present.

Use Web IDE and upload to ram.

Test 1:
1. Make sure to use the builtin scroller, uninstalling `kineticscroll` or similar.
2. upload this script to ram.
3. notice the red back button is present.
4. end test

Test 2:
1. Install `kineticscroll`
2. upload this script to ram.
3. notice the widget field and red back button is missing.
4. enter submenu and notice there is now a double heading.
5. exit submenu by pressing in the top left corner where the red back button would have been.
6. end test

Test 3:
1. Have `kineticscroll` installed.
2. Uncomment //Bangle.loadWidgets() down below.
3. Upload to ram.
4. notice the red back button is present.
5. end test

Test 4:
1. Have `kineticscroll` installed.
2. Uncomment //Bangle.loadWidgets() as well as //require("widget_utils").hide(); down below.
3. upload this script to ram.
4. enter submenu and notice there is now a double heading.
5. exit submenu by pressing in the top left corner where the red back button would have been.
6. end test


*/

print("\n\nBefore code is run:");
print(Bangle.appRect);

var mainMenu = {
  "" : {title : "Main menu",
        back : ()=>{
          print("\n\nBefore calling E.showMenu():");
          print(Bangle.appRect);
          E.showMenu();
          print("After calling E.showMenu():");
          print(Bangle.appRect);
        }
       },
  "1 Submenu" : ()=>{
    print("\n\nBefore calling E.showMenu(subMenu):");
    print(Bangle.appRect);
    E.showMenu(subMenu);
    print("After calling E.showMenu(subMenu):");
    print(Bangle.appRect);
  },
  "2 appRect" : ()=>{
    print("\nOn main menu:");
    print(Bangle.appRect);
  },
  "3" : ()=>{},
  "4" : ()=>{},
  "5" : ()=>{},
  "6" : ()=>{},
  "7" : ()=>{},
  "8" : ()=>{},
};

var subMenu = {
  "" : {title : "Submenu",
        back : ()=>{
          print("\n\nBefore calling E.showMenu(mainMenu):");
          print(Bangle.appRect);
          E.showMenu(mainMenu);
          print("After calling E.showMenu(mainMenu):");
          print(Bangle.appRect);
        }
       },
  "1" : ()=>{},
  "2 appRect" : ()=>{
    print("\n\nOn submenu:");
    print(Bangle.appRect);
  },
  "3" : ()=>{},
  "4" : ()=>{},
  "5" : ()=>{},
  "6" : ()=>{},
  "7" : ()=>{},
  "8" : ()=>{},
};

//Bangle.loadWidgets();
//require("widget_utils").hide();

E.showMenu(mainMenu);

I also wondered if it's just that some of the newest code from the standard scroller wasn't included in kineticscroll?

Installed apps

messageicons (0.07)
messagegui (0.79)
widmessages (0.06)
messages (0.62)
widmsggrid (0.06)
notify (0.13)
health (0.30)
widminbate (0.05)
podadrem (0.10)
spotrem (0.11)
android (0.34)
lightswitch (0.10)
widanclk (0.03)
backswipe (0.03)
torch (0.11)
calculator (0.07)
widbthide (0.01)
smpltmr (0.09)
clkinfostopw (0.03)
runplus (0.24)
dtlaunch (0.25)
quicklaunch (0.15)
widalarm (0.02)
alarm (0.47)
recorder (0.43)
bthrm (0.19)
fastload (0.06)
fastreset (0.03)
agenda (0.15)
edgeclk (0.03)
setting (0.71)
boot (0.60)
mysetup (0.02)
clockbg (0.02)
analogquadclk (0.02)
kbmulti (0.09)
sched (0.26)
clock_info (0.11)
msgwakefup (0.01)
ctrlpad (0.01)
chargent (0.07)
widChargingStatus (0.03)
kineticscroll (0.03)

@halemmerich
Copy link
Collaborator

I can reproduce on 2v21. The description of the fix seems to match the current code of kineticscroll since it gets the appRect while defining the new scroller function so definitely before calling setUI. Will have a look at that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-boot Bangle2 Related to Bangle.js 2 state-started type-bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants