如何使用Viewpager实现ListView动画?

时间:2013-12-20 17:48:00

标签: android android-listview android-viewpager swipe-gesture

我是Android开发的菜鸟,我在尝试实现ListView animations library时遇到了麻烦。我在常规视图上实现此库的功能没有问题。但是,似乎用于listview项目的滑动手势正被viewpager拦截,这导致库无用。我尝试过使用NonswipableViewPager类无济于事。我之前看过这个库在viewpager中使用,所以我知道它可以完成。非常感谢任何帮助。

CODE:

public Object instantiateItem(View collection, int position) {

            LayoutInflater inflater = (LayoutInflater) collection.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);

            int resId = 0;
            switch (position) {
            case 0:
                    ...

                    locations_listview = (ListView)view.findViewById(R.id.listView1);
                    locations_listview.setOnItemClickListener(Child_Locations_Activity.this);
                    setContextualUndoAdapter();

                    ...
 }


private void setContextualUndoAdapter() {
        ContextualUndoAdapter adapter = new ContextualUndoAdapter(location_adapter = new Child_Locations_ListAdapeter(Child_Locations_Activity.this, location_data), R.layout.layout_undo_row, R.id.undo_row_undobutton);
        adapter.setAbsListView(locations_listview);
        locations_listview.setAdapter(adapter);
        adapter.setDeleteItemCallback(Child_Locations_Activity.this);
    }

0 个答案:

没有答案