Description
All animated views call invalidate() inside onDraw(), causing continuous redrawing and high CPU usage.
Current Problem
@Override
protected void onDraw(Canvas canvas) {
// ... drawing code
invalidate(); // Called every frame!
}
Solution
Replace with ValueAnimator or Choreographer for proper frame-based animation.
Affected Components
- ParticlesView
- ParticleProgressBar
- PulseButton
Benefits
- Lower CPU usage
- Better battery life
- Smoother animations
- Ability to pause/resume
Description
All animated views call
invalidate()insideonDraw(), causing continuous redrawing and high CPU usage.Current Problem
Solution
Replace with
ValueAnimatororChoreographerfor proper frame-based animation.Affected Components
Benefits