AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Android Custom Drawing Canvas

skill-prasad-vennam-awesome-android-ai-agent-skills-android-custom-drawing-canvas · by prasad-vennam

Use when creating custom UI components, charts, shaders, or hardware-accelerated drawing in Android with Jetpack Compose Canvas.

No reviews yet
0 installs
8 views
0.0% view→install

Install

$ agentstack add skill-prasad-vennam-awesome-android-ai-agent-skills-android-custom-drawing-canvas

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-prasad-vennam-awesome-android-ai-agent-skills-android-custom-drawing-canvas)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
4mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Android Custom Drawing Canvas? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Android Custom Drawing & Canvas ✏️🎨

Advanced strategies for high-performance, pixel-level custom UI components, data visualization, and creative graphics in Jetpack Compose.

⚡ When to Use

  • Custom Charts: Drawing pie, bar, or line charts with precise control.
  • Complex UI Elements: Building circular progress bars or custom sliders.
  • Graphic Effects: Applying shaders (AGSL), gradients, or masks.
  • Dynamic Graphics: Hand-drawn signatures or interactive shapes.
  • Particle Systems: Drawing lightweight, dynamic visual effects.

🏗️ Drawing with Canvas

  • Rule: Use Modifier.drawBehind { ... } or Canvas(modifier = ...) { ... }.
  • Coordinate System: (0,0) is TOP-LEFT.
  • Draw Scope: Access built-in methods like drawRect, drawCircle, drawPath.

1. Drawing a Circular Progress Bar

Canvas(modifier = Modifier.size(100.dp)) {
    val strokeWidth = 8.dp.toPx()
    drawArc(
        color = Color.LightGray,
        startAngle = 0f,
        sweepAngle = 360f,
        useCenter = false,
        style = Stroke(width = strokeWidth)
    )
    drawArc(
        color = Color.Blue,
        startAngle = -90f,
        sweepAngle = progress * 360f,
        useCenter = false,
        style = Stroke(width = strokeWidth, cap = StrokeCap.Round)
    )
}

2. The Path API

  • Use for complex shapes (Stars, Polygons, Waves).
  • Use Path() and methods like moveTo, lineTo, cubicTo.
  • Rule: Reuse the Path object if possible to avoid allocations in the drawing loop.

🚀 Performance & Tips

  • [ ] Avoid Object Allocation: Never create Paint, Path, or Brush objects inside drawBehind. Create them with remember outside.
  • [ ] Use graphicsLayer: Move drawing into a separate layer for better hardware acceleration and cacheability.
  • [ ] Pixel Conversion: Use toPx() carefully within the DrawScope. Keep dimensions consistent.
  • [ ] AGSL Shaders: For Android 13+, use RuntimeShader for professional-grade effects (Blur, Wave, Noise).

📐 Chart Design Best Practices

  • Labels: Don't draw complex text with drawText if you can use Text composables with Layout.
  • Interactivity: Use detectDragGestures or detectTapGestures to make your custom drawings interactive.
  • Smoothness: Use animateFloatAsState to animate chart values during transitions.

🧪 Testing and Verification

  • Screenshot Testing: ALWAYS use screenshot tests for custom Canvas components to catch pixel-level regressions.
  • Layout Inspector: Verify that your Canvas component isn't causing excessive recompositions.
  • Hardware Profile: Ensure the "GPU rendering" bar doesn't cross the threshold during complex animations.

📜 Checklist for Canvas Components

  • [ ] Accessibility: Does the canvas component have a clearAndSetSemantics entry with a proper description?
  • [ ] Theming: Does the drawing use MaterialTheme.colorScheme colors?
  • [ ] Density Independence: Does it look correct on both low and high-density screens?
  • [ ] Performance: Are expensive path calculations cached?

🔗 Related Resources

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.