Skip to content
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

Strange stroke behavior #11

Open
achatina opened this issue Oct 13, 2020 · 2 comments
Open

Strange stroke behavior #11

achatina opened this issue Oct 13, 2020 · 2 comments

Comments

@achatina
Copy link

achatina commented Oct 13, 2020

Very strange showing on Android of a stroke with corners. Take a look on top right and bottom right corners
This is code:

val bgFormInputError = DrawableBuilder()
        .cornerRadius(16)
        .solidColor(bgColor)
        .strokeColor(strokeBgColor)
        .strokeWidth(2)
        .build()

изображение

@achatina
Copy link
Author

The problem was in padding. The stroke also needs padding for view. Now it fixes by setting padding on view.
Anyway, Drawable like GradientDrawable has setPadding() method. Maybe while building it, you can call it and pass the stroke width, so it will be handled by library. Not sure about this, but might help

@achatina
Copy link
Author

Still meet with different bugs, like on the screen, for stroke. With a background in XML, everything works fine. But with drawable crated by this library - sometimes stroke cropped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant