cortinico / slidetoact

A simple 'Slide to Unlock' Material widget for Android, written in Kotlin 📱🎨🦄
MIT License
1.19k stars 161 forks source link

Change Icon Color and drawable icons request #42

Open EricBatlle opened 5 years ago

EricBatlle commented 5 years ago

I was thinking that could be useful to let users choose icon style.

We only need one parameter to override the line 87 on SlideToActView:

/** Outer color used by the slider (primary) */
    var outerColor: Int = 0
        set(value) {
            field = value
            mOuterPaint.color = value
            mDrawableArrow.setTint(value)  ->> This line should to be removed or at least have some other public function to modify it
            invalidate()
        }

I'll also use this issue to ask for a way to use icon's which are images, not drawable vectors, just drawables. Could be this possible? Thanks! :D

cortinico commented 5 years ago

Hey @ls29322

So changing the color is definitely doable. Maybe you want to make a PR? :)

For the drawable. There is already another issue relate to this: #20 I'm a bit hesitant on this as it would open to a lot of problems (e.g. tinting will not make sense anymore, etc.).

Maybe I can extend the library to accept custom AVD or VectorDrawable. What do you think?

EricBatlle commented 5 years ago

And what about using the default "thumb" of seekbar? Thumb allows drawable customization, isn't it? Or it will break your code into pieces? :S Cause the problem is not only changing the icon itself, is the whole thumb (like changing the border of the sape, or the shape itself) Also as the issue that you have linked, would be nice to add gradient colors to the slider, so there's another reason to accept drawable styles on bouth sides, icon and slider :+1:

amit-mansa commented 4 years ago

How can i change the button image size its to small

cortinico commented 4 years ago

How can i change the button image size its to small

Please open another issue as this is unrelated to the current thread.