Page 1 of 1

[Done] Switchmobile only works when you tap on it, not when you slide

Posted: Tue Feb 25, 2025 6:21 pm
by grapa
If you slide the switch, as example on WebView left or in Android app left or right, it generates no MobileEvents().
It works only when you tap direct on it. Maybe it is working as expected. I dont know. But then, it is difficult to get the actual real state of the SwitchMobile()

Code: Select all

  If ContainerMobile(#PB_Any, #PB_Mobile_Page, "padding:16px")
    SwitchMobile(0)
    Debug "Enabling the switch..."
    SetMobileState(0, #True)
    CloseMobileContainer()
  EndIf
  Procedure MobileEvents()
    Select EventMobile()
      Case 0
        Debug "Switch state: " + GetMobileState(0)
    EndSelect
  EndProcedure
  BindEvent(#PB_Event_Mobile, @MobileEvents())

Re: Switchmobile only works when you tap on it, not when you slide

Posted: Wed Feb 26, 2025 11:58 am
by Caronte3D
Yes, the events needs a better detection, by example, we can't detect long tap and many times the user of mobile apps do long tap (by mistake) instead of only tap and then, the operation fails (logically).

Re: Switchmobile only works when you tap on it, not when you slide

Posted: Tue Mar 04, 2025 10:30 am
by Fred
@Caronte3D you seem to have some info about what to improve for the MobileUI, don't hesitate to build a TODO list and post it somewhere so I can pick some.

Re: Switchmobile only works when you tap on it, not when you slide

Posted: Tue Mar 04, 2025 1:11 pm
by Caronte3D
Thanks by your interest.
I find Onsen's UI to be too limited. I would love to have a better library like shoelace.style, but I understand it's not a trivial task to change it now.
Anyway I opened a new thread on the forum to add things to a ToDo.

Re: [Done] Switchmobile only works when you tap on it, not when you slide

Posted: Mon Jun 02, 2025 8:26 am
by Fred
Fixed.