Avatar for pranjal

pranjal

Member since May 2022 • Last active Jul 2022
  • 7 conversations
  • 12 comments

Most recent activity

  • in Bangle.js
    Avatar for pranjal

    Hey @Ganblejs!
    Thank you for the reply. I played around with my code a bit and eventually, SetUI works pretty well!

    • 2 comments
    • 354 views
  • in Bangle.js
    Avatar for pranjal

    Hello!
    I am trying to develop an app with multiple screen faces. I wish to implement something similar to the Bangle JS app loader, where we can scroll through a menu of options and once we click some option, it leads me to some particular app. In my case, it would lead me to some screen.

    I majorly wish to implement the following things:
    1)My app should have a menu as the loader does.
    2)It should have an option for going back to some main screen

    I fail to understand how they link the various apps in the app launcher. I went through the launcher's GIT repository [https://github.com/espruino/BangleApps/b­lob/master/apps/launch/app.js] but can't seem to understand how this links all the apps on the device. Could someone kindly give me a hint and nudge me in the right direction so that I can work on my app.

    Thank you!

  • in Bangle.js
    Avatar for pranjal

    Hey @Ganblejs,
    Thank you for your response!
    I realized my error, basically, I draw these walking, jogging, and cycling icons by converting SVG files to Bangle JS. Earlier, I was declaring those in the individual sub-activity screens, so I changed that and I am defining them publicly now.

    I had one small doubt though, is there a way in which I could implement a back button as well?
    Let's say I am going on the walking screen and I select the timer button and that leads me to the timer. Is there a way I could return to the walking screen by clicking some button?
    I read about the [https://banglejs.com/reference#l_Bangle_­setUI] back functionality in the documentation, but once remove the event listener, it doesn't allow me to go back to my previous screen. Is there some way I could implement the back functionality as well?

  • in Bangle.js
    Avatar for pranjal

    Hello,
    I am trying to make an app with multiple clock faces and implement functionalities using touch.
    I am uploading the images in this post for your reference.
    I just wish to implement a simple activity; the image with all the activities would lead me to an individual activity when I touch the screen, and then one more tap should lead me to the timer.
    I tried implementing it by putting the code for the timer in the if-else condition. For the simplicity of understanding, I am not posting the entire code here but am replacing them with function names.

    function selectOnTouch(n, event) { 
    if(event.y<60){ walking();}
    else if(event.y>=60 && event.y<120){jogging();}
    else{cycling();}
    

    If I make another function of touch inside some function, like Walking, it gives me a Low Memory error.
    For Eg,

    function selectOnTouch(n, event) { 
    if(event.y<60){ walking(){function selectOnTouchTimer(n, event1) {timer();};}
    else if(event.y>=60 && event.y<120){jogging();}
    else{cycling();}
    

    Could someone point out the mistake/suggest to me how I should change my code? Is there another way I could implement this ?

    Thank you in Advance!
    Pranjal

  • in Bangle.js
    Avatar for pranjal

    @Ganblejs It works exactly as I want it to work. Thank you very much, I have been stuck on this for days and it finally works!!

  • in Bangle.js
    Avatar for pranjal

    I wanted to implement touch individually for these features. I posted this on the forum and they suggested I implement it in this manner.

    Bangle.on('touch', function(n,event) { 
    if(event.y<60){
    walking_subactivity();
    }  
    else if(event.y>=60 && event.y<120){
    jogging_subactivity();
      }
    else
      {
    cycling_subactivity();
      }
    });
    

    The issue now is that once I am on the working screen, if I click on the middle portion of the touch screen it takes me to the jogging screen. My main issue is that once I choose the walking option, the screen should remain there even if I click at some other part of the screen and do not jump to the jogging and cycling screen.

    I have written the function names in the if-else condition in order to make the code a bit more readable for the sake of this doubt.

    Thank you in advance.

Actions