I want to implement a three way sliding button for my app. at the first position it should show one color, at the center it should show another color and at the end position it should change the color again. Here I am giving the images for this.
How can I implement this?
This actually looks for my like a extend of the seekbar.
To implement this kind of slider I would create a class that extends seekbar. In the Constructor I would use .setMax(2); which means that the seekbar has only 3 positions/steps.
Then in the default implementation I would intecrate a seekbar.OnChangeListener(). There in the pogressChanged(...) method switch the background image resoure with .setBackgroundDrawable(...) and if necessary change the thumb with .setThumb(...) to a image of your desire.
If you even want to change the position of the slider you can implement a Click event handling and there change the position of the slider with .setProgress();
This is a very easy to handle and quick to do implementation since it requires only several lines of code.