Product Introduction
- Overview: ChromaDial is an open-source Kotlin library for creating customizable dial components in Jetpack Compose, Android's modern UI toolkit.
- Value: Simplifies complex dial implementation with declarative APIs while enabling pixel-perfect customization for unique app experiences.
Main Features
- Degree-Based Control: Intuitive 0°-360° coordinate system starting from 12 o'clock position with clockwise progression. Supports fractional degrees for precision control.
- Custom Angular Ranges: Configure non-standard dial arcs using
startDegreesandsweepDegreesparameters (e.g., 225° start with 270° sweep). - Multi-Revolution Tracking: Automatically visualizes values beyond 360° through concentric ring indicators when
sweepDegreesexceeds full rotation. - Interval Snapping: Implement discrete value steps with
intervalparameter (e.g., 30° increments) featuring auto-generated tick marks and magnetic thumb snapping. - Optimized Callbacks: Separate
onDegreeChanged(real-time updates) andonDegreeChangeFinished(final commit) for efficient resource handling during user interactions.
Problems Solved
- Challenge: Native Jetpack Compose lacks dedicated dial components, forcing developers to build complex gesture/rendering logic from scratch.
- Audience: Android engineers creating media players, measurement tools, settings panels, and creative apps requiring circular input controls.
- Scenario: Audio engineers building equalizer apps need precise frequency adjustment dials with custom ranges and tactile feedback.
Unique Advantages
- Vs Competitors: Outperforms generic slider libraries with native Compose integration, circular gesture detection, and automatic multi-rotation visualization.
- Innovation: Patent-pending ring indicator system for values >360° and declarative API that mirrors Compose's state-driven philosophy.
Frequently Asked Questions (FAQ)
How to add ChromaDial to an Android project? Add dependency:
implementation("com.sinasamaki:chroma-dial:1.0.0-Alpha4")in your module's build.gradle file.How to prevent performance issues during dial rotation? Use
onDegreeChangeFinishedcallback for heavy operations (like disk I/O) instead ofonDegreeChangedwhich fires continuously.Can I create dials with non-circular ranges? Yes, configure partial arcs via
startDegrees(e.g., 90°) andsweepDegrees(e.g., 180°) for semi-circular controls.Does ChromaDial support Material Design 3 theming? Yes, it automatically inherits your app's MaterialTheme colors and can be customized via composable parameters.