Android : Custom Slider-like Control/Button in Android

on Sunday, August 10, 2014


I am kind of new to Android, so maybe I am asking a silly question, but it's something I can't figure out, so... here goes.


I am trying to create a control not unlike the toggles for things like Wi-Fi or Bluetooth inside the Settings app, but with a few distinct differences (let's refer to the beautiful drawn and designed image below):



  • I imagine the green circle as the "off" setting, and red one as the "on" one

  • Instead of just touching either circle to toggle the setting on or off, the user would slide it to the other side (where the toggle would trigger if the user released the control over the other end of the black bar)

  • At this point (releasing the control button), the circle would snap to the other position (and change color) and call whatever method I bind to this


What should I be looking at for this?


http://i.imgur.com/TmJ1tJJ.png


0 comments:

Post a Comment