11

I'm trying to use the drag/drop functionality from this fine project: https://github.com/bauerca/drag-sort-listview/

First, I've added the library using the instructions on GitHub.

Second, I'm trying to use the XML declaration. This is my main.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:dslv="http://schemas.android.com/apk/res/com.mobeta.android.dslv"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <include layout="@layout/header"/>

    <com.mobeta.android.dslv.DragSortListView
        android:id="@+id/list"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:divider="#D9D9D9"
        android:dividerHeight="2dp"
        android:listSelector="@drawable/list_selector"
        dslv:drag_enabled="true"
        dslv:drag_scroll_start="0.33"
        dslv:drag_start_mode="onDown"/>
</LinearLayout>

But, Eclipse is throwing this error: No resource identifier found for attribute 'drag_enabled' in package 'com.mobeta.android.dslv'; similarly for 'drag_scroll_start' and 'drag_start_mode'.

I'd like to understand on a more general level what I'm doing wrong here. And if anyone can give me specific help for using this library, I'd appreciate that as well.

boo-urns
  • 10,136
  • 26
  • 71
  • 107
  • 1
    Should work, nevertheless, Try copying [this](https://github.com/bauerca/drag-sort-listview/blob/master/library/res/values/dslv_attrs.xml) file to your `/res/values`. – S.D. Jan 27 '13 at 06:22
  • Have added all the XML attributes listed in the github ? – GrIsHu Jan 27 '13 at 06:27

1 Answers1

24

Since you are refering the attributes fro your library instead of giving the full path of the library give "res-auto" please see the change

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:dslv="http://schemas.android.com/apk/res-auto"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="vertical" >

<include layout="@layout/header"/>

<com.mobeta.android.dslv.DragSortListView
    android:id="@+id/list"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:divider="#D9D9D9"
    android:dividerHeight="2dp"
    android:listSelector="@drawable/list_selector"
    dslv:drag_enabled="true"
    dslv:drag_scroll_start="0.33"
    dslv:drag_start_mode="onDown"/>

for reference

Community
  • 1
  • 1
Swati
  • 1,179
  • 9
  • 28