Giter Site home page Giter Site logo

switchview's Introduction

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();
            }
        });

有问题需要 欢迎留言~

switchview's People

Contributors

799536960 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.