2. Charlie Tsai@Android Study Group
cha122977@gmail.com
Individual App Developer &
System Software Engineer@NVIDIA
Today’s source code
https://github.com/chatea/AnimatorDemo
3. Agenda
• Animation vs Animator
• Concepts and usages of animator
• Class overview
• Features of Animator
• Demo and Live Coding
4. Animation vs Animator
• Animation:
For View only
xml supported
Modify(animate) the fixed attributes of View
• Animator:
For everything
xml supported
Modify(animate) any value you gave
6. What does Animator do?
• Give you a calculated value depends on the time
• It uses Equation (數學方程式) to calculate the value
7. Linear Case
TimeStart
Duration:10sstart value = 0
end value =100
get value at t = 2s
Value = (100 - 0) * (2/10) = 20
get value at t = 8s
Value = (100 - 0) * (8/10) = 80
f(s) = A * s
8. Abilities of Animator
• Support customized calculation function
• Support modifying class member
(By ObjectAnimator)
14. Advanced features
• Multiple Values in same Animator
• ObjectAnimator
• TimeAnimator
• defined by XML
• TypeEvaluator
• PathIntepolator
Demo 6
Demo 8
Demo 7