且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

需要帮助来实现47degree Android的SwipeListView

更新时间:2023-11-25 17:22:10

最后,我成功地在自己的应用程序中集成47degree Android的SwipeListView。

工程就像一个魅力。由于47degree写这样一个奇妙的code。

Works like a charm. Thanks 47degree to write such a wonderful piece of code.

解决方法:

什么是不工作!?

What is not working!!?

包括JAR的依赖和attrs.xml在RES /值或引用的swipelistview库中的项目的lib依赖项目是行不通的。

Including JAR as dependency and attrs.xml in res/values OR referencing to the swipelistview library as lib dependency project in your project is not working.

什么工作!!?

What works!!?

包括以下类别为您的应用程序包同时正确的包中这些类的包名的名字

  • SwipeListView.java
  • SwipeListViewListener.java
  • SwipeListViewListenerBase.java
  • SwipeListViewTouchListener.java

包含下列XML到你的应用RES /值的文件夹。

  • attrs.xml

现在,您可以定义和使用SwipeListView如下:

<au.com.your.package.SwipeListView
        xmlns:swipe="http://schemas.android.com/apk/res-auto"
        android:id="@+id/swipe_listview"
        android:listSelector="#00000000"
        android:layout_width="match_parent"
        android:layout_height="match_parent"        
        swipe:swipeFrontView="@+id/front"
        swipe:swipeBackView="@+id/back"
        swipe:swipeActionLeft="reveal"
        swipe:swipeActionRight="choice"
        swipe:swipeMode="both"
        swipe:swipeCloseAllItemsWhenMoveList="true"
        swipe:swipeOpenOnLongPress="true"
        swipe:swipeAnimationTime="100"
        swipe:swipeOffsetLeft="50dp"
        swipe:swipeDrawableChecked="@drawable/item_selected"
        swipe:swipeDrawableUnchecked="@drawable/item_unselected"
   />

活动code为显示在SwipeListView github上的网站上的例子中,你可以使用相同的。

https://github.com/47deg/android-swipelistview-sample/blob/master/src/main/java/com/fortysevendeg/android/swipelistview/sample/activities/SwipeListViewExampleActivity.java

您需要纠正上面从code部分进口。

You will need to correct some imports from the code above.