Double Click Android

Asked

Viewed 1,543 times

1

I’m developing an app that has a list in a RecyclerView and the idea is that the person chooses one or more products from that list and changes color to show that it is selected, but in case the person chooses wrong, it gives a double click. I was able to make it work using one setOnClickListener in viewHolder, then when I select some product it changes color. I tried calling too setOnLongClickListener even works, I tested with two different races, but it is not so easy to use, if you have how to configure to change the Long Click time can be an option as well. If someone has an example of how to implement the onClick function in another class, or if there is already a class I can use. Any information may be useful. Obligatory

  • You can explain it better. I don’t understand why you want the double click. Usually the first click selects, if you have made a mistake click again and de-selects.

  • Yes, you understood right. So it is also a good option, as I check if it was clicked to not select, I do it with setOnClickListener same?

  • Depends on how you’re doing to select.

1 answer

1


Double click is not part of the mobile universe, only of desktop with use of mouse, users are not used to it in the applications, it is a bad decision of UX to use this approach in mobile.

One of the best ways is like the image below.

inserir a descrição da imagem aqui

To enable multi selection the user uses the long press and with one tap selects or cancels the selection of items from the list, Open the Gmail app and check how it works, most of the app work this way.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.