0

I am trying to achieve the following (see image below) with CompatSwitch.

Toggle Button.

The original post was from Android toggle button custom look. But there is no answer for SwitchCompat or ToggleButton (apart from using the image in ToggleButton).

So far, I am able to customize the ToggleButton, but I am having trouble customizing the track and keep both word (from photo above: NU and DA).

I have also been following this tutorial: Slide Toggle for Android, but it uses its own switch.

Another example what I am hoping to do in SwitchCompat is the following: Simple Toggle

Any idea how to keep both "words" in SwitchCompat? If there is no way to workaround this, then I'll use the radiobutton solution which is posted at How to custom switch button?. Is there any drawback from using radiobutton?

Please help... :)

PS. I don't want to use image because I need to support multilanguage text.

Sam
  • 1,826
  • 26
  • 58
  • Are you sure you want others to go through each of the articles / tutorials / posts you have gone through to help you? Can you please post a little bit of code related to this and explain what's going wrong? – Deepak Kamat Dec 24 '17 at 04:05
  • @DeepakKamat hahaha... no no no... it is not my intention. My apology. If I post the question without those links, it will be marked as duplicate. It is to show that I have done my homework. I am hoping to get answer from someone who know *how to create custom SwitchCompat*. This question is not meant to offend anyone including you. – Sam Dec 24 '17 at 06:42
  • I can understand. And it didn't offend me. I said that so you can get help more quickly as any potential helper might be very uncomfortable in going through all the links. Yes, you have done your homework, but you also have to tell what you have tried till now i.e provide the codes. My suggestion is evaluate the result of all of the posts you have gone through, and post what you come up with. If you didn't find your answer in the given links then I don't see why your question can be marked as a duplicate. – Deepak Kamat Dec 24 '17 at 06:57
  • https://stackoverflow.com/a/73177722/16555594 Answer is mentioned here you can check. – Ritik Raj Nov 19 '22 at 07:37

0 Answers0