DragSortListView
================
# NOTICE: No longer maintained.
I do not have much time to devote to this project so I am
dropping support for the time being. Sorry everybody!
News
----
**April 2, 2013**: Hey all. If you want to send a pull request,
please read the [Contributing](https://github.com/bauerca/drag-sort-listview#contributing) section first. Thanks!
**Feb. 9, 2013**: Version 0.6.0. Consolidated remove modes to
`click_remove` and `fling_remove`. No more fling remove while
dragging; fling anywhere on item to remove it.
[Leszek Mzyk](https://github.com/imbryk) is a bona fide code-slanger.
**Jan. 10, 2013**: Version 0.5.0 is released. Supports ListView
multi-choice and single-choice modes thanks to the hard work of
[Mattias Flodin](https://github.com/mattiasflodin)! Awesome-sauce.
Check out the new demos.
**Nov. 23, 2012**: Hmmm, what's this? → [Gittip](https://www.gittip.com/bauerca) :)
**Nov. 17, 2012**: [Drag-Sort Demos](https://play.google.com/store/apps/details?id=com.mobeta.android.demodslv)
app in Google Play Store!
**Nov. 15, 2012**: Smooth operation! Drops and removals are animated.
Also, DragSortController now provides a convenience
click-to-remove feature (see [XML attrs](https://github.com/bauerca/drag-sort-listview#xml-layout-declaration)
and [RemoveListener](https://github.com/bauerca/drag-sort-listview#dragsortlistviewremovelistener)
sections).
**Nov. 11, 2012**: Mavenized.
Thanks to [Andreas Schildbach (Goonie)](https://github.com/Goonie)!
**Oct. 30, 2012**: DragSortCursorAdapter class helps you reorder
a Cursor-backed ListAdapter. Look at ResourceDragSortCursorAdapter
and SimpleDragSortCursorAdapter as well in [the API](
http://bauerca.github.com/drag-sort-listview).
**Oct. 19, 2012**: Public API documentation is up at
http://bauerca.github.com/drag-sort-listview.
**Oct. 19, 2012**: Refactoring rampage. Backward compatibility is slightly
broken. New features make it worthwhile :) and include: total floating
View customization, total control over drag start/stop,
and a helper class implementing common patterns (long-press to drag,
fling-to-remove, etc.). Thanks to
[Dan Hulme (orac)](https://github.com/orac)
for getting all this rolling!
Check out the extensively updated demos and usage section below.
**Sept. 26, 2012**: Drag-sorting is now animated! (optional, of course)
Items slide around underneath the floating (dragged) View.
Overview
--------
DragSortListView (DSLV) is an extension of the Android ListView that enables
drag-and-drop reordering of list items. It is a ~~major overhaul~~ complete
rewrite of
the [TouchInterceptor](https://github.com/android/platform_packages_apps_music/blob/master/src/com/android/music/TouchInterceptor.java) (TI)
meant to give drag-sorting a polished feel. Some key features are:
1. Clean drag and drop (no visual glitches; I hope!)
2. Intuitive and smooth scrolling while dragging.
3. Support for heterogeneous item heights.
4. Public `startDrag()` and `stopDrag()` methods.
5. Public interface for customizing the floating View.
DragSortListView is useful for all kinds of prioritized lists:
favorites, playlists, checklists, etc. Would love to hear about
your use case or app by email.
I hope you find it useful; and please, help me improve the thing!
Widget usage
------------
Three major elements define the drag-sort process. Roughly, in
order of importance, they are:
1. **Data reordering**. Drag-sorts reorder the data
underlying your list. Since DSLV
cannot know how you organize your data, the reordering must be
performed by you using the provided Listener interfaces.
2. **Drag start/stop**. Drags are started and stopped by
calling `startDrag()` and
`stopDrag()` on your DSLV instance; but some help that is.
The convenience class, DragSortController, provides all kinds of
boiler-plate for common start/stop/remove drag patterns.
3. **Floating View**. The floating View appearance and behavior is
controlled by an
implementation of the FloatViewManager interface. With this, you
can display any View you like as the floating View, and update its
appearance/location on every touch event. The DragSortController
helper class also implements this interface for convenience.
Number 1 is essential. As mentioned above, 2 and 3 can
be handled by the DragSortController helper class. Keep reading,
then head to the
demo and start studying some examples.
### XML layout declaration
DragSortListView can be declared in an XML layout file just like
the ListView. Several example layout files are
[provided in the demo](https://github.com/bauerca/drag-sort-listview/blob/master/demo/res/layout/).
The available attributes (in addition to the usual
ListView attributes) are given below. Read each bullet as
* `<xml attr>`: (`<datatype>`, `<default value>`) `<description>`.
#### XML attributes
* `collapsed_height`: (dimension, 1px) Height of placeholder at original
drag position. Cannot be zero.
* `drag_scroll_start`: (float, 0.3) Start of drag-scroll regions
(defined by a
fraction of the total DSLV height; i.e. between 0 and 1).
* `max_drag_scroll_speed`: (float, 0.5) Maximum drag-scroll speed for
default linear drag-scroll profile. Units of pixels/millisecond.
* `float_alpha`: (float, 1.0) Transparency of floating View. Value from
0 to 1 where 1 is opaque.
* `slide_shuffle_speed`: (float, 0.7) Speed of shuffle animations
underneath floating View. A value
of 0 means a shuffle animation is always in progress, whereas a value
of 1 means items snap from position to position without animation.
* `drop_animation_duration`: (int, 150) Drop animation smoothly centers
the floating View over the drop slot before destroying it. Duration
in milliseconds.
* `remove_animation_duration`: (int, 150) Remove animation smoothly
collapses the empty slot when an item is removed. Duration
in milliseconds.
* `track_drag_sort`: (bool, false) Debugging option; explained below.
* `use_default_controller`: (bool, true) Have DSLV create a
DragSortController instance and pass the following xml attributes
to it. If you set this to false, ignore the following attributes.
* `float_background_color`: (color, BLACK) Set the background
color of the floating View when using the default
DragSortController. Floating View in this case is a snapshot of
the list item to be dragged.
* `drag_handle_id`: (id, 0) Android resource id that points to a
child View of a list item (or the root View of the list item
layout). This identifies the "drag handle," or the View within a
list item that must
be touched to start a drag-sort of that item.
Required if drags are to be enabled using the default
DragSortController.
* `sort_enabled`: (bool, true) Enable sorting of dragged item (disabling
is useful when you only want item removal).
* `drag_start_mode`: (enum, "onDown") Sets the gesture for starting
a drag.
+ "onDown": Drag starts when finger touches down
on the drag handle.
+ "onDrag": Drag starts when finger touches down on drag handle
and then drags (allows item clicks and long clicks).
+ "onLongPress": Drag starts on drag handle long press (allows
item clicks).
* `remove_enabled`: (bool, false) Enable dragged item removal by one
of the `remove_mode` options below.
* `remove_mode`: (enum, "flingRight") Sets the gesture for removing the
dragged item.
+ "clickRemove": Click on item child View with id `click_remove_id`.
+ "flingRemove": Fling horizontal anywhere on item.
* `click_remove_id`: (id, 0) Android resource id that points to a
child View of a list item. When `remove_mode="clickRemove"` and
`remove_enabled="true"`, a click on this child View removes the
containing item. This attr is used by DragSortController.
* `fling_handle_id`: (id, 0) Android resource id that points to a
child View of a list item. When `remove_mode="flingRemove"` and
`remove_enabled="true"`, a fling that originates on this child
View removes the containing item. This attr is used
没有合适的资源?快使用搜索试试~ 我知道了~
Android应用源码之drag-sort-listview-master.zip项目安卓应用源码下载
共89个文件
xml:39个
java:24个
png:8个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 166 浏览量
2022-03-08
00:45:40
上传
评论
收藏 725KB ZIP 举报
温馨提示
Android应用源码之drag-sort-listview-master.zip项目安卓应用源码下载Android应用源码之drag-sort-listview-master.zip项目安卓应用源码下载 1.适合学生毕业设计研究参考 2.适合个人学习研究参考 3.适合公司开发项目技术参考
资源推荐
资源详情
资源评论
收起资源包目录
Android应用源码之drag-sort-listview-master.zip (89个子文件)
Android应用源码之drag-sort-listview-master
Android应用源码之drag-sort-listview-master
drag-sort-listview-master
pom.xml 3KB
tools
demo-sign-align.sh 396B
doc-dslv.sh 613B
dslv.py 7KB
pkg-dslv.sh 358B
library
pom.xml 3KB
res
values
dslv_attrs.xml 1KB
proguard-project.txt 781B
ant.properties 698B
build.xml 3KB
src
com
mobeta
android
dslv
DragSortItemView.java 3KB
ResourceDragSortCursorAdapter.java 5KB
DragSortController.java 15KB
SimpleFloatViewManager.java 3KB
DragSortCursorAdapter.java 7KB
DragSortItemViewCheckable.java 2KB
SimpleDragSortCursorAdapter.java 17KB
DragSortListView.java 98KB
.gitignore 254B
project.properties 583B
AndroidManifest.xml 304B
libs
android-support-v4.jar 341KB
.gitignore 254B
CHANGELOG.md 758B
demo
pom.xml 2KB
res
drawable-ldpi
dslv_launcher.png 1KB
menu
mode_menu.xml 584B
drawable-hdpi
drag.9.png 935B
delete_x.png 3KB
dslv_launcher.png 2KB
drawable-xhdpi
dslv_launcher.png 2KB
drawable
bg_handle_section2_selector.xml 363B
drag.9.png 640B
section_div.xml 344B
bg_handle_section1_selector.xml 363B
bg_handle_section2.xml 232B
bg_handle.xml 228B
bg_handle_section1.xml 228B
values
colors.xml 362B
strings.xml 10KB
ids.xml 149B
dimens.xml 157B
drawable-mdpi
drag.9.png 640B
dslv_launcher.png 1KB
layout
sections_main.xml 468B
list_item_handle_left.xml 745B
hetero_main.xml 934B
warp_main.xml 971B
section_div.xml 286B
list_item_radio.xml 890B
list_item_bg_handle.xml 402B
header_footer.xml 336B
jazz_artist_list_item.xml 1KB
checkable_main.xml 810B
bg_handle_main.xml 287B
dslv_fragment_main.xml 697B
launcher.xml 220B
test_bed_main.xml 293B
list_item_handle_right.xml 745B
cursor_main.xml 773B
launcher_item.xml 734B
list_item_checkable.xml 1KB
list_item_click_remove.xml 962B
list_item_no_handle.xml 294B
proguard-project.txt 781B
ant.properties 697B
build.xml 3KB
src
com
mobeta
android
demodslv
ArbItemSizeDSLV.java 3KB
SingleChoiceListView.java 2KB
TestBedDSLV.java 5KB
BGHandle.java 336B
CheckableLinearLayout.java 875B
DSLVFragmentBGHandle.java 2KB
DSLVFragment.java 6KB
WarpDSLV.java 2KB
EnablesDialog.java 2KB
DSLVFragmentClicks.java 2KB
Launcher.java 3KB
CursorDSLV.java 2KB
Sections.java 8KB
RemoveModeDialog.java 2KB
MultipleChoiceListView.java 2KB
DragInitModeDialog.java 2KB
.gitignore 231B
project.properties 603B
app-description.txt 1KB
AndroidManifest.xml 2KB
libs
android-support-v4.jar 341KB
README.md 19KB
共 89 条
- 1
资源评论
yxkfw
- 粉丝: 82
- 资源: 2万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功