Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

799536960/switchView

Open more actions menu

Repository files navigation

switchView

<com.duma.ld.mylibrary.SwitchView
        android:layout_width="200dp"
        android:layout_height="50dp"
        app:time="500"//动画时间
        app:bgColor="#FFE0B2"//背景色
        app:leftColor="#8cc152"//左边颜色
        app:rightColor="#757575"//右边颜色
        app:setChecked="true"//true 是在右边 反之
        app:textLeft="预约车位"//左边text
        app:textLeftColor="#8cc152"//左边字的颜色
        app:textLeftClickColor="#757575"//左边字选中后颜色 默认白
        app:textRight="我有车位"//同上
        app:textRightClickColor="#FFE0B2"//同上
        app:textRightColor="#8cc152" />//同上

用法

compile 'com.ld:switchView:1.1.7'

点击监听

  switchView.setOnClickCheckedListener(new SwitchView.onClickCheckedListener() {
            @Override
            public void onClick() {
                Toast.makeText(MainActivity.this, "type:" + switchView.isChecked(), Toast.LENGTH_SHORT).show();
            }
        });

有问题需要 欢迎留言~

About

带有文字的switch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.