开发者

Touch two items on ListView

A have a listview that sends elements to another listview. I'd like to let users touch two items of this list at the same time, and have both of this items sent to do other listview. I know how to pass the items through the listviews i just don't know how to han开发者_C百科dle clicking two items at the same time.

Also, when a set an onItemClickListener the android only invokes the method when the user remove the finger from the screen, is it possible to have this method called the exact time the finger touches the screen?

Thanks very much!


ListView.setChoiceMode(2) sets it to multiple choice. It does this with a checkbox for each item.

I'm not sure of an event that fires on touch as opposed to touch-off. Why do you need this handler?


Unfortunately, this is a limitation of Android before 3.x.

In 3.x, you can specify fragments which have their own listeners and everything else, so you could get two actions from two different views.

I think to implement this, you may have to do a bit of a hack involving multitouch and keeping track of where individual items are on the screen within the listview with View.getX() and view.getY().

In short, I don't think you can do this with onClickListeners, but you might be able to hack something together with GestureListeners using multitouch and explicitly keeping track of where items are on the list.

Perhaps you could have the users swipe over in order to select the items? You could even animate it to make them feel like they're "throwing" the data to the next screen!

Hope this helps!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜