实施47degree的Andr​​oid swipelistview为swipping安卓ListViewItem的 [英] Implementing 47degree android-swipelistview for swipping android ListViewItem

查看:136
本文介绍了实施47degree的Andr​​oid swipelistview为swipping安卓ListViewItem的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

其实我的目标是在Android中实现一个ListViewItem的刷卡。我已经尝试过了,计算器有几个例子,它可以使你的ListViewSwipe。例子。

Actually my goal is to implement a ListViewItem Swipe in android. I have tried it and stackoverflow has several examples which can make your ListViewSwipe. Examples.

简单轻扫手势活动教程?

<一个href="http://stackoverflow.com/questions/12858635/show-button-in-a-list-view-on-swiping-one-item-from-that-list">Show在列表视图按钮上刷卡从列表一个项目

的一点是有每个人都得到c没有人解释发生的事情$ C $。

然后我问问题,它<一个href="http://stackoverflow.com/questions/16017988/android-list-view-right-left-swipes-like-call-logs">Android列表视图右/左挥笔如呼叫记录的上@CommonsWare已回答SwipeListView库,有一个畅通,然后接受的答案。接受的回答也是精的工作我presently使用而已。

Then I asked question for it Android list view Right / Left swipes like call logs on which @CommonsWare have answered with SwipeListView library which has a smooth flow then the accepted answer. The accepted answer is also working fine I am presently using that only.

这是libraray <一href="http://www.androidviews.net/2013/03/swipelistview/">http://www.androidviews.net/2013/03/swipelistview/ 它将为您提供的ListView像这样

This is the libraray http://www.androidviews.net/2013/03/swipelistview/ Which provides you listview like this

我曾尝试更多然后50次运行提供了GitHub上这里<一个示例应用程序href="https://github.com/47deg/android-swipelistview-sample">https://github.com/47deg/android-swipelistview-sample但每次我面对的新问题。 presently这是未来的例外是

I have tried more then 50 times to run the sample application provided on github here https://github.com/47deg/android-swipelistview-sample But everytime I am facing new problems. Presently the exception which is coming is

05-22 15:35:19.392: E/AndroidRuntime(980): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.fortysevendeg.android.swipelistview.SwipeListView" on path: /data/app/com.fortysevendeg.android.swipelistview-2.apk

我不知道发生了什么我已经检查了构建路径,库中还包括问了这么多的人在计算器聊天,但没有得到任何帮助。

I don't know what is happening I have checked the buildpath, libraries are also included asked so many people on stackoverflow chat But haven't got any help.

其实在互联网上没有其实施单一教程,我都问到这么多的人民。所以,我想知道,如果有人使用了这个库,请写一个合适的答案如何使用preporly因此,与我未来其他读者也可以以效益出来。

Actually on internet there is not a single tutorial for its implementation I have asked to so many peoples. So I want to know if someone have used this library please write an appropriate answer How to use it preporly So with me other future readers can also take the benefit out of it.

或者有其他库执行来实现这种功能。

Or is there any other library to perform to implement this kind of functionality.

作为@CommonsWare建议。我写了一封电子邮件,笔者还写一个教程使用它。

推荐答案

最后,我已经成功地An​​droid的SwipeListView文库47Degrees集成到自己的应用程序。

工程就像一个魅力。感谢47Degrees写这样一个奇妙的code。

Works like a charm. Thanks to 47Degrees for writing such a wonderful piece of code.

解决方法:

什么不行?!

What doesn't work?!

包括JAR的依赖和attrs.xml在RES /值或引用SwipeListView库在您的项目不起作用一个lib依赖。

Including JAR as dependency and attrs.xml in res/values OR referencing the SwipeListView library as a lib dependency in your project does not work.

什么工作?!

What works?!

在你的应用程序包包括以下类。请务必更正包名在这些类的包名称

Include following classes in your application package. Be sure to correct the package names in these classes to your package name

  • 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所显示的<一个你可以用相同的href="https://github.com/47deg/android-swipelistview/blob/3a62153e08d9199c48958df345e42872ae4c070e/swipelistview-samples/demo/src/com/fortysevendeg/android/swipelistview/sample/activities/SwipeListViewExampleActivity.java"相对=nofollow>例如在SwipeListView github的网站。

Activity code you can use same as displayed in the example on SwipeListView github site.

您需要更正从code以上部分进口。此外,你需要有 NineOldAndroids由杰克沃顿商学院列为项目一个lib依赖

You will need to correct some imports from the code above. In addition, you'll need to have NineOldAndroids by Jake Wharton included as a lib dependency in your project.

这篇关于实施47degree的Andr​​oid swipelistview为swipping安卓ListViewItem的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆