如何实现Android 4.0的像刷卡解雇功能ListView中? [英] How to implement Android 4.0 like swipe to dismiss functionality in ListView?

查看:130
本文介绍了如何实现Android 4.0的像刷卡解雇功能ListView中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个应用程序中,我想实现刷卡到解雇功能在ListView - 类似于我们在安卓4.0的通知栏,最近应用程序列表或浏览器标签页看到的。我想运行在运行Android 2.2+设备的应用程序。参见下图。我也想改变的项目是刷卡外卖的透明度 - 就像在ICS

I'm working on an app in which I would like to implement swipe-to-dismiss functionality in the ListView - similar to what we see in Android 4.0's notification bar, recent apps list or browser tabs. I want to run the app on the devices running Android 2.2+. See the following image. I also want to change the transparency of the item being swiped-away - just like in ICS.

我查了ICS网络浏览器的源<一href="http://grep$c$c.com/file/repository.grep$c$c.com/java/ext/com.google.android/android-apps/4.0.1_r1/com/android/browser/TabScrollView.java?av=f">http://grep$c$c.com/file/repository.grep$c$c.com/java/ext/com.google.android/android-apps/4.0.1_r1/com/android/browser/TabScrollView.java?av=f但无法弄清楚哪一个类是特别负责实现此功能。

I checked the source of the ICS web browser on http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/4.0.1_r1/com/android/browser/TabScrollView.java?av=f but couldn't figure out which class is particularly responsible for implementing this functionality.

任何人都可以点我朝着正确的方向吗?我们能做到这一点采用Android兼容库?请告诉我。非常感谢。

Can anyone point me in the right direction here? Can we do this using Android Compatibility Library? Please let me know. Many thanks.

推荐答案

我知道这是一个相当古老的问题,但任何人仍在寻找这一点,你可以看看罗马Nurik的图书馆在这里:的 https://github.com/romannurik/Android-SwipeToDismiss

I know this is quite an old question, but for anyone still searching for this, you can have a look at Roman Nurik's library here: https://github.com/romannurik/Android-SwipeToDismiss

这说明如何创建列表视图所需要的行为,以及正常的看法。

This shows how to create the required behavior for list-view as well as for normal views.

这篇关于如何实现Android 4.0的像刷卡解雇功能ListView中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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