Reputation: 3565
If you use the whatsapp, you notice that you can do a long click on any message to select it. Then to select more messages, a normal click would suffice. Also at the top of the app, certain options become visible like copy, paste, share etc. On touching the back key, the selections are no longer highlighted.
It is very similar to the behaviour of selecting text in any android app, which happens automatically and does not require any kind of coding. Researching on this, I have been led to believe i need to use some combination of CheckedTextViews, selectors, onItemClickListeners etc. to achieve this behaviour.
So before i do attempt to implement this, I would like to ask if this kind of functionality is already available in the android framework?
Upvotes: 0
Views: 2389
Reputation: 1006964
Researching on this, I have been led to believe i need to use some combination of CheckedTextViews, selectors, onItemClickListeners etc. to achieve this behaviour.
That depends upon your implementation.
I would like to ask if this kind of functionality is already available in the android framework?
Well, that depends upon your precise definition of "this kind of functionality".
Generally speaking, what you are seeing is a contextual action bar (a.k.a., action mode). Here are a series of apps demonstrating the use of a contextual action bar, including one that supports using a long-press on a row to initiate the action mode.
Upvotes: 1