Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: How to make sliding buttons like phone unlock button on screensaver?

I don't know how exactly this type of buttons is called that's why I can't even google about it. You use that button to unlock phone - tap on it and move from left to right. I'd like to add same button in my app. How to do it?

enter image description here

like image 779
mc.dev Avatar asked Oct 25 '12 23:10

mc.dev


2 Answers

You should use SeekBar to achieve what you want. http://developer.android.com/reference/android/widget/SeekBar.html

Here is a good example

http://www.techrepublic.com/blog/app-builder/androids-seekbar-your-way/943

like image 54
Anirudh Avatar answered Oct 12 '22 21:10

Anirudh


Try this for a library https://github.com/sitepoint-editors/SwipeButtonExample and this for a DIY https://rightclicksolutions.wordpress.com/2014/04/09/android-slide-to-unlock-like-ios-mb-slider-slider/

like image 26
Gowrav Avatar answered Oct 12 '22 19:10

Gowrav