当前位置:网站首页>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 ......
边栏推荐
- 22. Generate parentheses
- MySQL circulates multiple values foreach, XML writing method
- 如何让灯具智能化,单火、零火智能开关怎么选!
- 27. Remove elements
- Wxparse parsing iframe playing video
- Vins fusion GPS fusion part
- 49. grouping of acronyms
- Zed2 running vins-mono preliminary test
- Activity start process record
- Dongmingzhu said that "Gree mobile phones are no worse than apple". Where is the confidence?
猜你喜欢

Combien de courant le câblage des PCB peut - il supporter?

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

Zed2 camera calibration -- binocular, IMU, joint calibration

Maximum number of points on the line ----- hash table solution

袋鼠云数栈基于CBO在Spark SQL优化上的探索

Restoration of binary tree -- number restoration

Recommend a free intranet penetration open source software that can be used in the local wechat official account under test

Analyze while doing experiments -ndk article -jni uses registernatives for explicit method registration

JVM tuning V: JVM tuning tools and tuning practice

Preliminary test of running vins-fusion with zed2 binocular camera
随机推荐
Intercept file extension
22、生成括号
How to apply for free idea with official documents
getBackgroundAudioManager控制音乐播放(类名的动态绑定)
Bit operation marks multiple switches with one parameter
NDK learning notes (I)
GAMES101作业7-Path Tracing实现过程&代码详细解读
截取文件扩展名
工具类ObjectUtil常用的方法
Multithreading tutorial (XXVIII) unsafe class
27. Remove elements
Sealem finance builds Web3 decentralized financial platform infrastructure
深度学习分布式训练
WinForm (I) introduction to WinForm and use of basic controls
Section I: classification and classification of urban roads
35. search insertion position
Multi threading tutorial (XXIV) cas+volatile
Dongmingzhu said that "Gree mobile phones are no worse than apple". Where is the confidence?
NVIDIA SMI has failed because it could't communicate with the NVIDIA driver
MySQL circulates multiple values foreach, XML writing method