Android property-animation 占CPU偏高
来源:互联网 发布:快速抢票软件 编辑:程序博客网 时间:2024/06/11 16:46
//Kotlin codeclass MainActivity : AppCompatActivity() { val TAG: String = "MAINACTIVITY" override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) hello.setText("hahaha") //property-animatioin val set = AnimatorInflater.loadAnimator(this, R.animator.property_animator) if(set is AnimatorSet){ set.setTarget(hello) set.start() } //View-animation image.setBackgroundResource(R.drawable.rocket) val ra = image.background if(ra is AnimationDrawable)ra.start() image2.startAnimation(AnimationUtils.loadAnimation(this, R.anim.hyperspace_jump)) Log.d(TAG, "onCreate") }}
<!-- property_animator.xml --><set android:ordering="together" xmlns:android="http://schemas.android.com/apk/res/android" > <objectAnimator android:propertyName="textColor" android:valueFrom="#f00" android:valueTo="#fff" android:duration="3000" android:repeatCount="-1" android:repeatMode="reverse" /> <objectAnimator android:propertyName="textSize" android:valueFrom="14sp" android:valueTo="20sp" android:duration="3000" android:repeatMode="reverse" android:repeatCount="-1" android:valueType="floatType" /></set>
在使用Property-animation时候,用Android profiler检测如图
不使用的时候
阅读全文
0 0
- Android property-animation 占CPU偏高
- Android -animation-Property Animation
- Android Property Animation动画
- Android Property Animation动画
- Android中的Property Animation
- Android Property Animation
- Android Property Animation示例
- Android Property Animation动画
- Android Property Animation
- Android Property Animation
- android动画-Property Animation
- Android:Property Animation
- android-Property Animation
- android Property Animation
- android Property Animation 2
- Android Property Animation
- Android Property Animation动画
- Android--Property Animation介绍
- 接口自动化测试框架
- n 阶贝塞尔曲线计算公式实现
- NOI那些神奇的错
- Docker安装——Ubuntu16.04
- 图的总结
- Android property-animation 占CPU偏高
- mysql 日期时间函数
- Mac 办公软件安装
- 近似算法与K-center问题的解释不清楚笔记
- 【算法题】选择排序
- linux网络设备应用与驱动编程学习3——lpc3250以太网控制器
- Android实现高德地图定位详细流程
- 理解Java中String的“==”方法和“equals”方法的机制
- FL2440WiFi学习之rt3070无线网卡动态获取IP上网