当前位置:网站首页>Adapter the problem of executing only one animation in multiple frames
Adapter the problem of executing only one animation in multiple frames
2022-06-11 05:34:00 【Cockroach bully BBQ】
AnimationDrawable frameAnim=(AnimationDrawable)mContext.getResources().getDrawable(R.drawable.yellow_red_rent); finalHolder1.cardBg.setBackgroundDrawable(frameAnim); frameAnim.start(); AnimationDrawable frameAnim2=(AnimationDrawable)mContext.getResources().getDrawable(R.drawable.yellow_red_dian); finalHolder1.r_light.setBackgroundDrawable(frameAnim2); frameAnim2.start();
The above code is written in the card list adapter , Only found frameAnim2 Yes ,frameAnim Don't execute , Anyway, I didn't see its animation effect , Later, I tried to write in the child thread :
new Thread(new Runnable() {
@Override
public void run() {
AnimationDrawable frameAnim=(AnimationDrawable)mContext.getResources().getDrawable(R.drawable.yellow_red_rent);
finalHolder1.cardBg.setBackgroundDrawable(frameAnim);// If you do not animate this frame xml resources , Because dragging real-time uses image resources , Drag a card and then click the corresponding like / Annoying button , Type conversion error will be reported !
frameAnim.start();
AnimationDrawable frameAnim2=(AnimationDrawable)mContext.getResources().getDrawable(R.drawable.yellow_red_dian);
finalHolder1.r_light.setBackgroundDrawable(frameAnim2);// If you do not animate this frame xml resources , Because dragging real-time uses image resources , Drag a card and then click the corresponding like / Annoying button , Type conversion error will be reported !
frameAnim2.start();
}
}).start();As a result, both frames of animation are executed , Without rhyme or reason ......
边栏推荐
- How much current can PCB wiring carry
- Tencent X5 kernel initialization failed tbsreaderview not support by:***
- PCB走线到底能承载多大电流
- Section II: structural composition characteristics of asphalt pavement (1) structural composition
- Multithreading tutorial (XXVI) field updater and atomic accumulator
- 袋鼠云数栈基于CBO在Spark SQL优化上的探索
- 推荐一款免费的内网穿透开源软件,可以在测试本地开发微信公众号使用
- Maximum number of points on the line ----- hash table solution
- Combing route - Compaction Technology
- 智能门锁为什么会这么火,米家和智汀的智能门锁怎么样呢?
猜你喜欢

Exploration of kangaroo cloud data stack on spark SQL optimization based on CBO

es-ik 安装报错

袋鼠雲數棧基於CBO在Spark SQL優化上的探索

How to make lamps intelligent? How to choose single fire and zero fire intelligent switches!

lower_ Personal understanding of bound function

Wechat applet uploads the data obtained from database 1 to database 2

Analyzing while experimenting - memory leakage caused by non static inner classes

在未来,机器人或 AI 还有多久才能具备人类的创造力?

Multithreading tutorial (XXI) double checked locking problem

Why is the smart door lock so popular? What about the smart door locks of MI family and zhiting?
随机推荐
22. Generate parentheses
Games101 job 7-path tracing implementation process & detailed interpretation of code
KD-Tree and LSH
2021-04-19
Opencv learning path (2-5) -- Deep parsing imwrite function
创建酷炫的 CollectionViewCell 转换动画
BERT知识蒸馏
NDK learning notes (IV) functions, classes and exceptions of swig
Analyze while doing experiments -ndk article -jni uses registernatives for explicit method registration
Linked list de duplication
SwiftUI: Navigation all know
Zed2 running vins-mono preliminary test
Why is the smart door lock so popular? What about the smart door locks of MI family and zhiting?
Combing route - Compaction Technology
【项目篇- 附件佐证材料放什么?(十八种两千字总结)】创新创业竞赛项目计划书、挑战杯创业计划竞赛佐证材料
Preliminary understanding of DFS and BFS
Opencv learning path (2-2) -- Deep parsing namedwindow function
Section II: structural composition characteristics of asphalt pavement (1) structural composition
Opencv learning path (2-1) -- Deep parsing imread function
Carrier coordinate system inertial coordinate system world coordinate system