Skip to content

Fix animation performance (replace continuous invalidate) #7

Description

@OneXeor

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestphase-2Performance & Stability

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions