anastr / SpeedView

Dynamic Speedometer and Gauge for Android. amazing, powerful, and multi shape :zap:
Apache License 2.0
1.28k stars 321 forks source link

Allowing positioning of speed text anywhere inside the gauge (in addition to predefined positions) #236

Closed techyourchance closed 1 year ago

techyourchance commented 1 year ago

Changed Position enum to be sealed class and added CUSTOM subtype. This change should be source-code backwards compatible, but, probably, won't be binary compatible.

anastr commented 1 year ago

Sealed classes are Kotlins specifics and cannot be saved in the SavedViewHolder. This feature is supported in the Compose version of this library.

techyourchance commented 1 year ago

Compose is great, but I'm sure that many projects who use this lib haven't migrated to Compose yet. I don't know what SavedViewHolder is, but I'm sure that a suitable solution can be found. For example, initially, I considered adding this sealed class in addition to the original Enum, which would keep the code fully backwards-compatible. Theoretically, we could even create a scheme that would be serializable from Java. If you're interested, I can spend a bit more time on this PR.