Trying to apply the MVP pattern. There is an activation, there is a button in it, with a long (3 seconds) pressing the button, a certain action should occur.

Question:

Where to handle long press? Those. count these 3s.

  1. In the activism itself. Hang the listener and count down 3 seconds. If 3 seconds have passed - send the event to the presenter that the button is pressed. (I tend to this)
  2. In the presenter. Pass the event ACTION_DOWN & ACTION_UP to the presenter and count 3 seconds in it.
  • one
    and what the standard onLongClickListener does not suit? - plesser
  • @plesser and then how can you specify how many seconds are needed for the click to work? - researcher
  • There it is impossible, but you just need a long press as I understand it. And by the time the farm will be ... - plesser
  • @plesser not really. I indicated that you need a long press for 3 seconds. Not 2, not 5) - researcher

0