I'm trying to implement this dynamicListView from DevBytes inside a ListFragment.
source: http://developer.android.com/shareables/devbytes/ListViewDraggingAnimation.zip
I'm doing this by creating a simple layout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mainLayout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<com.example.android.listviewdragginganimation.DynamicListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
and inflating this layout in my ListFragment
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
inflater.inflate(R.layout.simple_list_layout, container);
return super.onCreateView(inflater, container, savedInstanceState);
}
The DynamicListView seems to have initialized correctly (it's init(Context) function is run). But it's just working as if it was just a normal ListView. i.e. items are all displayed and I can scroll up and down, but the DynamicListViews onItemLongClickListener never gets called.
Is there anything else that needs to be done to use a custom ListView in a ListFragment?
onItemLongClickListenerin yourfragment