Awesome Toggle

Additional

Language
Java
Version
N/A
Created
Nov 22, 2016
Updated
Mar 22, 2017 (Retired)
Owner
Jinesh Francis (jineshfrancs)
Contributor
Jinesh Francis (jineshfrancs)
1
Activity
Badge
Generate
Download
Source code

AwesomeToggle

A customized toggle button

ScreenShot:

In your xml file add this tag to get AwesomeToggle

<test.jinesh.awesometoggleproject.AwesomeToggle
       android:layout_width="100dp"
       android:layout_height="wrap_content"
       android:id="@+id/sample"
       app:inactive_background_color="@color/colorPrimary"
       app:active_background_color="@color/colorAccent"
       app:font_color="@color/white"
       app:inner_toggle_color="@color/white"
       />

You can apply checked change listner in java code to monitor the toggle state changes

  awesomeToggle= (AwesomeToggle) findViewById(R.id.sample);
  awesomeToggle.setOnCheckedChangeListner(new AwesomeToggle.OnCheckedChangeListner() {
            @Override
            public void onChecked(boolean isChecked) {
                
            }
  });