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

GDr*_*oid 9 android listview options swipe

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

图书馆网址:

https://github.com/47deg/android-swipelistview

完整的承诺工作范例:

https://play.google.com/store/apps/details?id=com.fortysevendeg.android.swipelistview

问题:

每次我尝试在我的活动列表视图中实现swipelistview时,我都会遇到新问题.最后,我尝试将编译和分发的JAR(https://oss.sonatype.org/content/groups/public/com/fortysevendeg/android/swipelistview/1.0-SNAPSHOT/)包含到我的项目中并实施它; 它正在正确编译但是当我试图在设备上运行它或avd时,它崩溃了SwipeListViewTouchListener的异常ClassNotFoundException以及更多......

我正在使用的工具?

Android Studio

我需要的?

我会(以及更多开发人员寻找相同的解决方案)非常感谢,如果有人可以提供使用此库的非常基本的示例...

  • 无需提供完全可行的应用程序
  • 用于列表视图项目的前视图和后视图的演示代码在左右滑动时可以正常工作
  • 无需实现库的所有设置

这个问题的动机是了解如何将47degree swipelistview库连接到您的应用程序并使其正常工作.正在使用它的程序员应该能够从API文档中找到它.

任何有关这方面的帮助都非常有用,因为我正在开发一个我希望实现此类功能的小型应用程序.

GDr*_*oid 16

最后,我设法在我自己的应用程序中集成了47degree Android-SwipeListView.

奇迹般有效.感谢47degree写了这么棒的代码.

解:

什么不起作用!!?

将jAR作为依赖项和attrs.xml包含在res/values中,或者作为项目中的lib依赖项目引用swipelistview库不起作用.

什么有用!!?

您的应用程序包中包含以下类.还要将这些类中的包名更正为包名.

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

在您的应用程序res/values文件夹中包含以下xml.

  • 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"
   />
Run Code Online (Sandbox Code Playgroud)

您可以使用与SwipeListView github站点上的示例中显示的活动代码相同的活动代码.

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

您需要更正上面代码中的一些导入.