kyleduo/SwitchButton

Toggling with finger or mouse doesn't work

chewedon opened this issue · 5 comments

This library looks useful and I could surely use it in my project but maybe I'm doing something wrong?

I programmatically created an instance of SwitchButton like so:

SwitchButton toggle = new SwitchButton(this);

I then setup the layout so the switch appears on screen using code.

I see my switch in the center of my screen but trying to drag it or tapping on the switch using my finger doesn't toggle the switch.

I ran the app on the Android emulator too and tried using the mouse to click on the switch, nothing changes. The switch is still in the disabled state.

What am I doing wrong?

Project Settings
Using Android API level 19 (KitKat 4.4+)
AndroidCompat enabled

Use 1.4.6 version pls, I fixed this. Thx for your feedback. :)

Version 1.4.6 didn't made any difference, still not working :(

Do I need to set any onClickEventListeners or do anything extra besides creating an instance like I have done above?

Just try again with a clean build.

Deleted app off my phone.
Removed dependencies from Gradle.
Cleaned project.
Restarted my computer.
Restarted my phone.

Now it's working o.O.

Thanks for the help :D

Ok...