question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suggestion: Make it possible to add a brush track colour to ProgressIndicatorSegment

See original GitHub issue

This is just a suggestion. Please feel free to close this if you don’t agree 😃

In the current API for the SegmentedProgressIndicator and the SquareSegmentedProgressIndicator composables, the track segments has to be defined as follows

public data class ProgressIndicatorSegment(
    val weight: Float,
    val indicatorColor: Color,
    val trackColor: Color? = null,
    val inProgressTrackColor: Color? = null
)

I was thinking it could be cool to provide an alternative to this where the indicator colour can be a brush like this:

public data class ProgressIndicatorSegment(
    val weight: Float,
    val indicatorColor: Brush,
    val trackColor: Color? = null,
    val inProgressTrackColor: Color? = null
)

in addition to the API that already is. Maybe it could be an overriding function or something?

This would make it easy to add a gradient on each of the segments making the “increasing progress” effect independent of the segments themself. With a change like this, it would be easy to make something like this

Screenshot 2022-12-04 at 03 46 51

Even though you only have 3 segments defined.

What do you think? 😃

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
yschimkecommented, Dec 6, 2022

Maybe have the current form as a secondary constructor, but change the field to a Brush. SolidColor seems to be the Brush you want.

1reaction
garanjcommented, Dec 5, 2022

Sounds great!👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Odin Asbjørnsen oas004 - GitHub
Suggestion : Make it possible to add a brush track colour to ProgressIndicatorSegment. This is just a suggestion. Please feel free to close...
Read more >
HIDDEN Tricks for Photoshop Brushes and Brush Tools
In this video, I show you hidden, pro-level tips and tricks to use with Photoshop's brushes and the Brush Tool, including the best...
Read more >
Brush Tools - Photopea
Brush tools are all tools, which use a "brush track". You usually draw strokes on some layer and a brush tool edits pixels...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found