-
Notifications
You must be signed in to change notification settings - Fork 22
Fix deprecated ProgressView for Android #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Vasil Blanco-Nunev.
|
Why -8.dp? This does change the appearance of the progress indicator, like the bottommost one in your screenshot where the "Before" indicator has a visible gap, and the "After" one doesn't. Also, if you are just trying to get rid of a deprecation warning, could we just use this constructor instead: https://developer.android.com/reference/com/google/android/material/progressindicator/LinearProgressIndicator#LinearProgressIndicator(android.content.Context,%20android.util.AttributeSet) |
Looking at the ProgresView page I could see that the way progress indicator looked like is different. I added -8.dp so it over laps the progress with the background, otherwise you still see a bit of a gap even with 0, maybe It could be reduced to 4. Also, it's not about the deprecation warning. It's also the dot at the end, which |
@@ -95,7 +95,13 @@ public struct ProgressView : View { | |||
if value == nil || total == nil { | |||
LinearProgressIndicator(modifier: modifier, color: color) | |||
} else { | |||
LinearProgressIndicator(progress: Float(value! / total!), modifier: modifier, color: color) | |||
LinearProgressIndicator( | |||
progress: { Float(value! / total!) }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the deprecated API fix. I'd like to leave everything else as using default values (i.e. just exclude the gapSize and drawStopIndicator parameters) for the normal Compose look. We can eventually add custom modifiers to change the Material view, as we've done for other components.
And could you also make the fix for CircularProgressIndicator?
608db8e
to
9d31f76
Compare
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Vasil Blanco-Nunev.
|
There seems to be a deprecated use of Android's
LinearProgressIndicator
. I did a fix to look same as it did before for when there is a value. Let me know if I should update to include same change for when the progress is indeterminate.Thank you for contributing to the Skip project! Please use this space to describe your change and add any labels (bug, enhancement, documentation, etc.) to help categorize your contribution.
Skip Pull Request Checklist:
swift test