Conversation
|
This looks neat! Thanks for sharing! If this is going to get added it might make sense to have this as a stylable attribute as well as a programatic API. Also, perhaps we would want to make the color configurable instead of always using grey? Lets see what @danh32 thinks :) |
| private final RectF contentRect = new RectF(); | ||
| private float clipAmount = 1f; | ||
| private RectF clippedRect = new RectF(); | ||
| public boolean clipOnScrub; |
There was a problem hiding this comment.
We'd likely want this to a public API instead of something that can be directly set on the view.
|
I'd love to better understand the use case here; it feels a little awkward to leave the graph in the last scrubbed state (part green, part grey) after the scrub bar is gone. Where did you find yourself wanting this behavior? |
|
Yeah I also wan't sure what to do when finishing scrubbing. I though to use a `keepClipAfterScrub but it was getting too convoluted and too many parameters for a relatively small feature. |
|
Similarly to #54, I think this is a bit too specific for Spark 1.0. I also agree with @naturalwarren on the public boolean needing a bit of polish. |
|
Yeah I agree, this is kinda specific. It would also need a better name |
This is something we needed for our project, if you want to add it to the original codebase here it is!
The change allows to clip the spark-line horizontally and draws a grey line under it.
The gif sums it up pretty well.
public void setClipAmount(float amount)to set a value between 0 and 1. If value is 1 clipping gets automatically disabled. (Passed value get clipped between 0 and 1)There's also a
public boolean clipOnScrubto automatically use it when scrubbing.