Comments (2)
参考下这个:
/**
-
Adapter适配器,为Item添加动画
* -
@author fangc
*/
public abstract class BaseAnimAdapter extends BaseAdapter {
private int lastPosition = -1;@OverRide
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
setAnimation(holder.itemView, position);
}private void setAnimation(View viewToAnimate, int position) {
if (position > lastPosition) {
Animation animation = AnimationUtils.loadAnimation(viewToAnimate.getContext(), R.anim.item_slide_bottom_up);
viewToAnimate.startAnimation(animation);
lastPosition = position;
}
}@OverRide
public void onViewDetachedFromWindow(RecyclerView.ViewHolder holder) {
super.onViewDetachedFromWindow(holder);
holder.itemView.clearAnimation();
}
from jiandan.
动画功能已完成,多谢@fangchao3652 指导
from jiandan.
Related Issues (14)
- 第一次进入且无网络时闪退 HOT 1
- 阅读文章时通过ViewPager切换使用FragmentStatePagerAdapter会比较好一些 HOT 1
- “小视频”模块数据貌似加载不出来,加载失败,估计是不是换了接口?
- 评论列表优化 HOT 1
- 图片缩放 HOT 2
- 文章,图片都行,为什么小视频显示加载失败 HOT 1
- 为什么我使用这个项目,小电影和无聊图都是没有显示数据的呢? HOT 1
- 刚才看了下源码,发现小电影和无聊图等没有办法显示的原因是 HOT 1
- 新鲜事大小图模式切换没有立即显示
- 数据加载失败
- 请问还在维护吗?有没兴趣搞个小程序版?
- How to solves this problem?
- 更新material-dialogs到0.7.3.1到最新才编译好 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jiandan.