重新排序列表喜欢在媒体播放器的播放列表 [英] Reordering Lists like playlists in the media player

查看:233
本文介绍了重新排序列表喜欢在媒体播放器的播放列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用从SQLCursor一个ListView中显示的项目列表。在SQL表包括(以及其它事情)一个_id字段和一个顺序字段。我用命令字段中的列表进行排序,然后才会慢慢到ListView。

我需要的是像MediaPlayer的一个小部件已经在播放列表视图。它可以让你单击该图标,在播放列表中拖动该项目,并把它变成一个新的秩序。有了这种能力,我可以再获取新订单和新订单更新SQL表。不过,我没有任何运气找到任何线索,帮我补充一点的功能到我的程序。

现在的问题是我是否可以使用现有的功能来帮助我,或者我需要手动程序移动事件,而这种直到我得到几乎相同的功能。

解决方案
  

不过,我没有任何运气   找到任何线索,帮我补充一点,   功能到我的程序。

如果你想从音乐应用程序(其中,顺便说一句,是不是叫MediaPlayer的)的功能,的去看看它的源$ C ​​$ C 。下面是答案这一点上你的具体类(一个计算器问题 TouchInterceptor ),使拖和下降。

  

现在的问题是我是否可以使用   现有的功能来帮我,还是我   需要手动编程移动事件   而这样的,直到我得到几乎相同的   功能。

如果你正在寻找一个小部件内置拖和下降,有没有在SDK中。

I have a list of items that are displayed using a ListView from a SQLCursor. The SQL table includes(as well as other things) a _id field and an order field. I use the order field to sort the list before it gets to the ListView.

What I need is a widget like the MediaPlayer has in its playlist view. It allows you to click the icon and drag the item in the playlist around and put it into a new order. With that ability I can then retrieve the new order and update the SQL table with the new order. However, I am not having any luck finding any clues to help me add that functionality into my program.

The question is whether I can use existing functions to help me, or do I need to manually program motion events and such until I get nearly the same functionality.

解决方案

However, I am not having any luck finding any clues to help me add that functionality into my program.

If you want the functionality from the Music application (which, by the way, is not named "MediaPlayer"), go look at its source code. Here is a StackOverflow question with answers that point you to the specific class (TouchInterceptor) that enables the drag-and-drop.

The question is whether I can use existing functions to help me, or do I need to manually program motion events and such until I get nearly the same functionality.

If you are looking for a widget with built-in drag-and-drop, there is none in the SDK.

这篇关于重新排序列表喜欢在媒体播放器的播放列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆