You are reading a single comment by @pranjal and its replies. Click here to read the full conversation.
  • 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


    5 Attachments

    • Cycling (1).jpeg
    • Jogging (1).jpeg
    • Walking (1).jpeg
    • Screenshot 2022-06-19 152404.jpg
    • Screenshot 2022-06-28 152949.jpg
About

Avatar for pranjal @pranjal started