1

Here I have this image.

two muppets

I want to implement a slide button or slide bar or anything that similar to this in Android. How can I do this, Is there any library for this? . Thanks so much.

xtiger
  • 1,446
  • 2
  • 15
  • 33
  • You shouldn't use UI elements from other platforms on Android. Please have a look through the Design Guidelines here: http://developer.android.com/design/index.html – Karakuri Mar 15 '14 at 20:41

2 Answers2

1

Take a look on this library: Swipe List View use it for ideas. Check SwipeListViewTouchListener's method

public boolean onTouch(View view, MotionEvent motionEvent)

Or also, take a look at this answer: how to swipe a button ontouch event in android

Edit:

Perhaps, if you don't need the library, use a FrameLayout and add the TextView ("Slide to Unlock") as first child, and the button as the second child. Then, implement the OnTouchListener of the button, and animate it's moviment to the right. Lot's of answers as to "how to move a view using OnTouchListener". Here's an example android: move a view on touch move (ACTION_MOVE)

Community
  • 1
  • 1
LeoFarage
  • 517
  • 3
  • 16
  • So, did the library help in anyway? Have you been able to do something about your problem. Keep us update :D – LeoFarage Mar 28 '14 at 20:49
1

SeekBar should be a good class to extend, although you'll have to implement all the animation stuff, and obviously all the GFX customization: http://developer.android.com/reference/android/widget/SeekBar.html

piotrpo
  • 12,398
  • 7
  • 42
  • 58