If it's in JavaScript then it sounds like a bug. Can you extract a test 
case and file an issue?

On Tuesday, February 23, 2021 at 11:27:59 AM UTC+2 P5music wrote:

> I am talking about are handled in javascript
> indeed I explicitly wrote about callbacks.
> (the longpress listener also is not called, it is in Java just for testing 
> purposes as a fallback but it is not useful because it is not called 
> either) 
>
> This is the problem:
> The first event should be "mousedown"
> and it is in the simulator, whatever kind of click type the user does, 
> i.e. click or longpress.
> The second event should be "mouseup"
> and it is in the simuator, whatever kind of click type the user does, i.e. 
> click or longpress, just the difference is timing.
> The Javascript callbacks work and a suitable part of the code is called 
> for each of the above mentioned events.
> (It is not a simulator bug, it works as it should)
> So In case of click those events are fired correctly both in simulator and 
> also in the Android device.
>
> Instead
> in case of long press on the real Android device only click is handled 
> correctly and I see the correct sequence of mouse events,
> but with long press those events are not fired, like they are gobbled down.
> So both the down event and the up event are not handled, they do not 
> trigger the callbacks, they are not fired ore they are gobbled.
>
> It seems that the WebView has a timer itself and decides whether to fire 
> the first event according to the timing of the second.
>
> Regards
>
> Il giorno martedì 23 febbraio 2021 alle 04:04:20 UTC+1 Shai Almog ha 
> scritto:
>
>> That sounds like a bug in the simulator not on the device. If you click 
>> in the browser component the event should be delivered there. Not to 
>> Codename One. You need to intercept it in JavaScript.
>>
>> On Monday, February 22, 2021 at 10:22:12 AM UTC+2 P5music wrote:
>>
>>> The click is on the iFrames inside the HTML, so it is on the BC.
>>> It works on the simulator:
>>> click and long-press gestures are handled with a timer and comparing the 
>>> timestamps.
>>> The issue is that 
>>> when I long-press on the BC when the app runs on the real Android device,
>>> even the first mouse event (mousedown) is not fired,
>>> it is like the BC has a timer itself and does not fire the mousedown 
>>> event if the mouseup event is too far in time,
>>> while in the simulator the mousedown event is issued every time, 
>>> regardless of the timing of the subsequent mouseup event.
>>>
>>> Regards
>>>
>>> Il giorno lunedì 22 febbraio 2021 alle 03:29:37 UTC+1 Shai Almog ha 
>>> scritto:
>>>
>>>> Are you long clicking on the browser component or somewhere else? It's 
>>>> unclear from the question.  Do you have a screenshot of the place you're 
>>>> clicking on?
>>>>
>>>> On Sunday, February 21, 2021 at 1:17:56 PM UTC+2 P5music wrote:
>>>>
>>>>> P5music
>>>>> 12:16 (ora) 
>>>>> a CodenameOne Discussions
>>>>> I am testing my CodenameApp on a real Android device.
>>>>> The main screen has a table layout with a container on the left.
>>>>> The container has a container inside, that has a BrowserComponent 
>>>>> inside in BorderLayout.CENTER.
>>>>> The issue is not about layout.
>>>>>
>>>>> I have some callbacks for the BC that on the simulator handle 
>>>>> mouseup/down on the iFrames in the HTML.
>>>>> That callback work also for handing long-press on the same HTML 
>>>>> elements.
>>>>> Everything is fine. If I add a LongPressListener it gets not called 
>>>>> but it is not needed at all.
>>>>>
>>>>> When using the app on the real Android device the clicks are handled 
>>>>> as in the simulator
>>>>> while
>>>>> the long press is not.
>>>>> I debugged and it seems that the events are not fired at all.
>>>>> I mean,
>>>>> a click is mousedown and mouseup within a short time range.
>>>>> a longpress is the same where the mouseup event is after 500ms. The 
>>>>> app uses a timer.
>>>>>
>>>>> But the initial mousedown event itself is not called, and also the 
>>>>> LongPressListener is not called.
>>>>>
>>>>> So what is happening? This is very important because the long-press is 
>>>>> for displaying a pop-up  menu. But only clicks work.
>>>>> Thanks in advance
>>>>>
>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/1c04c075-c7c8-4f6b-8e7f-1ceb97dfbb1en%40googlegroups.com.

Reply via email to