slidetoact
slidetoact copied to clipboard
How to add drawable to button
I want set drawable background instead of color to button ( app:inner_color="@color/colorPrimary")
Hey @blabz-rahulmandalkar Do you have some mocks or some screenshots of what you want to implement?
The real problem with what you're asking is that the background get resized during the animation. I'm not so sure of what you would love to do with a drawable: crop it? resize it?
Furthermore the inner_color
would still be needed since it has several effects. From the README.md file:
Use the inner_color attribute to control the color of the inner circular button, the color of the tick icon and the color of the text. If not set, this attribute defaults to colorBackground from your theme.
I want to apply gradient color to inner circular button from drawable resource like below
Wrap SlideToActView
in a FrameLayout
and set your background drawable to your gradient colour. Add a margin of 1dp to SlideToActView
, with outer_color
as #FFFFFF
Yeah that's a bit hacky but it should more or less work. I could eventually implement this feature if someone else is interested in this.
I am interested too! You can allow to change the hole button icon? Not only the inside icon.
@IreneTrullen I could allow to change the inside icon and maybe the gradient as well. Having a generic drawable for the bobble would be really hard to implement from the animation point of view. Do you have something in mind?
So, maybe can you allow to change the width and height of the icon inside the booble?
@cortinico How to set the background of the arrow icon to gradient as the @blabz-rahulmandalkar mentioned before?
@cortinico How to set the background of the arrow icon to gradient as the @blabz-rahulmandalkar mentioned before?
Currently is not possible. I'm happy to review a PR if you're willing to develop this feature 🙏
Hi all, how about this?? Any update?? I need the innerColor could be drawble
Thanks for your input @samk17cmutpm
I'm happy to review a PR if you're willing to develop this feature 🙏
This is still valid. I might have some time in the near future but I can't promise anything at this point.