facebook

iOS App (Requires Double Tap on Push Buttons Sometimes)

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #335049 Reply

    mreade
    Member

    Support,

    I recently packaged an iOS app and i have this installed on my iPhone 5. After installing the app, I have noticed that there are times when i need to “double-tap” the push buttons to perform the command, or to clear the fields.

    Any thoughts why this might be so?

    Thanks

    mreade

    #335107 Reply

    @mreade,

    Is a web app or native app?
    Could you try build a simple example and check if this behavior is the same?
    Could be that maybe your device is not recognizing when you tap it?

    #335115 Reply

    mreade
    Member

    Hello Octavio,

    It was built as a Native App. If I recall, it was doing the same when I was testing it through the Test Center as well as after installing the ipa setup file.

    mreade

    #335116 Reply

    WaylandDavis
    Member

    Hi.

    This may be the “delay” of 300 microseconds that iOS puts in their “clicks.” I was running into what I thought was a need to double click, but instead it was a delay. I fixed it with the “TAP” from jquery.mobile.js.

    Used that mobile file and here’s the event I added in the phoneui.documentReadyHandler = function() area:

    $(“m1-SPC-btn20pct”).tap(function(event)
    {
    if(cordovaready == true) {
    navigator.notification.vibrate(1000); // this just vibrates when btn pushed
    }
    event.preventDefault(); // turns off the old 300 ms delay.
    });

    #335117 Reply

    mreade
    Member

    Thanks Octavio,

    So, just so I completely understand your last post.

    Do I use exactly the same code snippet you have provided? Do I need to change anything?

    Do I need to add any javascript commands to the push buttons? Or, just add the code snippet to the phoneui.documentReadyHandler = function() area?

    Thanks in advance.

    mreade

    #335140 Reply

    WaylandDavis
    Member

    I’m not Octavio – I’m wildwex…anyway.

    You need to use the code for each button or other element you intend to Tap.

    $(“Your-button-name-here“).tap(function(event)
    {
    if(cordovaready == true) {
    navigator.notification.vibrate(1000); // this just vibrates when btn pushed
    }

    event.preventDefault(); // turns off the old 300 ms delay.
    });

    Hope it helps.

    wildwex

    #335142 Reply

    mreade
    Member

    Thanks for the reply.

    Although I cannot see the yellow text too good, i can copy and paste it to see what you have typed.

    Many thanks,

    mreade

    #335388 Reply

    mreade
    Member

    Wildwex,

    I have a “Clear” “Calculate” “Email” push button on several forms. The Clear button on call forms is ID: push1, The Calculate button on call forms is ID: push2, and the Email button on all forms is ID: push3

    Will I need to create 1 snippet of code for each of the 3 push buttons, for each form?

    In other words,

    Form1 = 3 push buttons, 3 separate snippets of code
    Form2 = 3 push buttons, 3 separate snippets of code
    Etc.

    Or, can i prepare 3 snippets of call (1 for each push button) that will apply to all “push1” buttons on all forms, etc.

    I have 25 forms x 3 push buttons on each form for a total of 75 push buttons

    25 forms have 1 push button called “push1”
    25 forms have 1 push button called “push2”
    25 forms have 1 push button called “push3”

    I am just trying to explain this with as much detail as possible to make sure i get this right. So bare with me….

    Form1:

    $(“m1-Form1-push1”).tap(function(event)
    $(“m1-Form1-push2”).tap(function(event)
    $(“m1-Form1-push3”).tap(function(event)

    Form2:

    $(“m1-Form2-push1”).tap(function(event)
    $(“m1-Form2-push2”).tap(function(event)
    $(“m1-Form2-push3”).tap(function(event)

    Form3:

    $(“m1-Form3-push1”).tap(function(event)
    $(“m1-Form3-push2”).tap(function(event)
    $(“m1-Form3-push3”).tap(function(event)

    Form4, Form5, etc.

    Etc…………..

    I am wondering if it is possible for the MobiOne developers to built a new property into the Push Button Widget so users could set time event if/when required?

    Thanks in advance

    mreade

    #335394 Reply

    WaylandDavis
    Member

    Hi,

    I’m still a little new to jQuery and Javascript, but here is a snippet I use to handle multiple buttons in another app:

    elem = document.body.getElementsByTagName(‘*’);
    for(c=0;c<elem.length;c++)
    {
    elem[c].css(“z-index”, “0”); // This sets all Z positions to 0.
    elem[c].css(“position”, “fixed”); // Keeps things from moving around.
    $(elem[c]).tap(function(event) // Fix “click” to be a tap to get rid of 300 ms delay.
    {
    if(cordovaready == true) {
    navigator.notification.vibrate(1000); // Vibrate when user select items for feedback.
    }
    event.preventDefault(); // Prevents the normal click actions, i.e. delay.
    });

    }

    I’m thinking there may be a jQuery wildcard using $(“[id^=m1-Form]”) that you can use and iterate through all the buttons in the entire document.

    #335396 Reply

    mreade
    Member

    Thanks Wildwex, you are certainly much more advanced that me at this point! 🙂

    Maybe we can get Support to chime in on this?

    Support???

    Thanks

    mreade

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: iOS App (Requires Double Tap on Push Buttons Sometimes)

You must be logged in to post in the forum log in