0

I have a requirement from my client where the switch looks like angled switch . Please refer to the attached jpeg.

enter image description here

When the user switches off the switch then the color changes to brown ? So following are my questions

How to implement angled switch ? How to implement different colors for ON/OFF behaviour ?

Thanks in advance.

Shark
  • 6,513
  • 3
  • 28
  • 50
Preethi
  • 2,112
  • 7
  • 38
  • 54

1 Answers1

0

You need a selector. in the selector you can define which drawables are used for different states.

sorry i don't have any samples atm, but a simple search landed this Android selector & text color

EDIT: the switch itself looks like a ToggleButton http://developer.android.com/reference/android/widget/ToggleButton.html but i don't know what to tell you how to make it look like that...

though, android settings has those buttons, just gray instead of blue. maybe you can dig something out of there?

Community
  • 1
  • 1
Shark
  • 6,513
  • 3
  • 28
  • 50