DragNDropList alternatives and similar packages
Based on the "ListView/ScrollView Widget" category.
Alternatively, view DragNDropList alternatives based on common mentions on social networks and blogs.
-
Android-ObservableScrollView
Android library to observe scroll events on scrollable views. -
StickyListHeaders
An android library for section headers that stick to the top -
Pull-to-Refresh.Rentals-Android
Phoenix Pull-to-Refresh -
SwipeMenuListView
[DEPRECATED] A swipe menu for ListView. -
pinned-section-listview
Easy to use ListView with pinned sections for Android. -
android-pulltorefresh
DEPRECATED This project aims to provide a reusable pull to refresh widget for Android. -
Android-SlideExpandableListView
A better ExpandableListView, with animated expandable views for each list item -
PullZoomView
An Android custom ListView and ScrollView with pull to zoom-in. -
XListView-Android
ListView supports pull refresh and pull up to load more feature. -
CommonPullToRefresh
Android widget with pull to refresh for all the views,and support loadMore for ListView , RecyclerView, GridView and SwipeRefreshLayout. -
Android-HorizontalListView
HorizontalListView is an Android ListView widget which scrolls in a horizontal manner (in contrast with the SDK-provided ListView which scrolls vertically). -
ListBuddies
Android library to achieve in an easy way, the behaviour of the home page in the Expedia app, with a pair of auto-scroll circular parallax ListViews. -
StickyScrollViewItems
A small android library for tagging views inside a ScrollView as "sticky" making them stick to the top of the scroll container until a new sticky view comes and takes it's place -
HorizontalVariableListView
Horizontal list view for Android which allows variable items widths -
PinnedHeaderListView
A ListView with pinned section headers for Android -
PullToRefresh-ListView
A generic, customizable, open source Android ListView implementation that has 'Pull to Refresh' functionality. -
StikkyHeader
This is a very simple library for Android that allows you to stick an header to a scrollable view and easily apply animation to it -
ParallaxScroll
Parallax ScrollView and ListView for Android -
PagedHeadListView
Android boosted ListView supporting paginated header with a new material page indicator. -
ParallaxListView
A Android ListView Demo with a parallax effect header like Path. -
FlabbyListView
Android library to display a ListView whose cells are not rigid but flabby and react to ListView scroll. -
android-pulltorefresh-and-loadmore
android custom listview,with interaction pattern load more and pull to refresh to load data dinamically -
LinearListView
Android library that allows you to bind a LinearLayout with a ListAdapter. -
ListviewFilter
Awesome Listview filter functionality in Android. -
quickscroll
[Development stopped in 2014. Unfinished and not stable - not recommended to use.] Bringing extended scrolling features to Android's native ListView and ExpandableListView. -
FloatingGroupExpandableListView
An open source Android library that provides a floating group view at the top of the ExpandableListView -
PinterestListView
Pinterest style ListView for Android -
Android-Tiling-ScrollView
A tiling scrollview to display large picture (similar to iOS "CATiledLayer") -
android-accordion-view
Simple ListView based Android AccordionView -
QuickReturn
Android ListView that implements the QuickReturn UI pattern. Written from scratch with focus on performance.
Appwrite - The open-source backend cloud platform
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of DragNDropList or a related project?
README
DragNDropListView
DragNDropListView is a direct replacement for the stock Android ListView. If you know how to use ListView, you already know how to use DragNDropListView. All you have to do is replace ListView and SimpleCursorAdapter/SimpleAdapter with DragNDropListView and its adapters.
Usage
DragNDropListView is an Android Library project. If you use Eclipse do the following.
- Clone
git clone git://github.com/terlici/DragNDropList.git
- Import it in Eclipse
- Add DragNDropList as a library to your Android project
Layout
A common layout for list view is the following:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ListView
android:id="@id/android:list"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</LinearLayout>
Just replace ListView
with com.terlici.dragndroplist.DragNDropListView
:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.terlici.dragndroplist.DragNDropListView
android:id="@id/android:list"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</LinearLayout>
Row Layout
In DragNDropListView each item has a drag handler, which the users touch to drag the item around.
Here is a common layout for each row. It contains an image of a star and some text. The user can reorder the items by touching the star of an item and dragging it around.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="80px"
android:orientation="horizontal"
android:gravity="center_vertical"
>
<ImageView
android:id="@+id/handler"
android:layout_width="60px"
android:layout_height="60px"
android:src="@android:drawable/btn_star_big_on"
android:layout_marginLeft="8px"
/>
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
Loading DragNDropListView
This is the usual way to load a ListView:
ListView list = (ListView)findViewById(android.R.id.list);
SimpleCursorAdapter adapter = new SimpleCursorAdapter(context,
R.layout.row,
cursor,
new String[]{"text"},
new int[]{R.id.text},
0);
list.setListAdapter(adapter);
When using DragNDropListView just replace ListView
with DragNDropListView
,
SimpleCursorAdapter
with DragNDropCursorAdapter
and set the id of the drag
handler as the last parameter of the adapter. In the row layout above this will
be R.id.handler
. Last, instead of setListAdapter
use setDragNDropAdapter
.
DragNDropListView list = (DragNDropListView)findViewById(android.R.id.list);
DragNDropCursorAdapter adapter = new DragNDropCursorAdapter(context,
R.layout.row,
cursor,
new String[]{"text"},
new int[]{R.id.text},
R.id.handler);
list.setDragNDropAdapter(adapter);
You are done! As you see there is very little to change to your existing code.
Events
DragNDropListView provides an event listener for drag and drop.
list.setOnItemDragNDropListener(...)
The interface for this listener is:
public interface OnItemDragNDropListener {
// Called when the item begins dragging.
public void onItemDrag(DragNDropListView parent, View view, int position, long id);
// Called after the item is dropped in place
public void onItemDrop(DragNDropListView parent, View view, int startPosition, int endPosition, long id);
}
This event is useful when storing the reordered items.
Adapters
DragNDropList comes with two adapters. The first one is DragNDropCursorAdapter
which is a direct replacement for SimpleCursorAdapter
. The second is DragNDropSimpleAdapter
which is a replacement for SimpleAdapter
.
Apps that use DragNDropList
DragNDropList was originally created for our apps Tasks and Tasks Pro. Download one of them to see it in action.
If other apps use it, please let us know and we will include them here.
Contribution
If you want to contribute, there are two more projects. DragNDropListApp implements a basic demo of the DragNDropList. DragNDropListAppTest runs tests on the DragNDropListApp and contains all the tests for the DragNDropList.
If you want to contribute, please fork also those two projects and add your tests to DragNDropListAppTest.
License
DragNDropList
's code uses the Apache license, see our LICENSE
file.
*Note that all licence references and agreements mentioned in the DragNDropList README section above
are relevant to that project's source code only.