• Stars
    star
    99
  • Rank 343,315 (Top 7 %)
  • Language
    Java
  • Created over 9 years ago
  • Updated over 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Switch view which can instead of CheckBox

This is a library project with a custom view that implements open&close function same as CheckBox.This implements the concept of switch(https://dribbble.com/shots/1376110-iOS7-Swith-free-After-Effects-file?list=likes&offset=0)made by Jelio Dimitrov.

###Demo###

demo

###Usage###

Add the SwitchView in your layout.

<com.zhanglei.customizeview.SwitchView
        android:id="@+id/switch_button"
        android:layout_centerInParent="true"
        android:layout_width="150dp"
        android:layout_height="100dp" />

and

switchButton.setOnCheckedChangeListener(new SwitchView.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(View view, boolean isChecked) {
                Toast.makeText(MainActivity.this, "isChecked: " + isChecked,
                 Toast.LENGTH_LONG).show();
            }
        });