Giter Club home page Giter Club logo

ncswitchmultibutton-android's Introduction

NCSwitchMultiButton-Android

🔥 A SwitchButton support Multiple https://github.com/nanchen2251/NCSwitchMultiButton-Android

feature

  1. switchbutton
  2. multitype

Screenshots

How to use it

Step 1. Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}       

Step 2. Add the dependency

dependencies {
    implementation 'com.github.nanchen2251:NCSwitchMultiButton-Android:1.0.1'
}

Step 3. Just use it in your project

<com.nanchen.ncswitchmultibutton.NCSwitchMultiButton
        android:id="@+id/btn2"
        android:layout_width="match_parent"
        android:layout_height="35dp"
        android:layout_marginTop="20dp"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/btn1"
        app:smb_style="all_circle"
        app:smb_tabs="@array/test" />

Step 3. Support for custom attributes

<declare-styleable name="NCSwitchMultiButton">
        <attr name="smb_style" format="enum">
            <enum name="normal" value="0" />
            <enum name="all_circle" value="1" />
        </attr>
        <attr name="smb_tv_size" format="dimension" />
        <attr name="smb_tabs" format="reference" />
        <attr name="smb_selected_color" format="color|reference" />
        <attr name="smb_unselected_color" format="color|reference" />
        <attr name="smb_selected_tv_color" format="color|reference" />
        <attr name="smb_unselected_tv_color" format="color|reference" />
        <attr name="smb_select_pos" format="integer" />
        <attr name="smb_stroke_width" format="dimension" />
        <attr name="smb_radius" format="dimension" />
    </declare-styleable>

Step 5. If you still don't understand, please refer to the demo

Thasks for:https://github.com/KingJA/SwitchButton

About the author

   nanchen
   Chengdu,China
   其它开源
   个人博客
   简书
   博客园
   交流群:118116509
   欢迎投稿(关注)我的唯一公众号,公众号搜索 nanchen 或者扫描下方二维码:
   

Licenses

 Copyright 2019 nanchen(刘世麟)

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

ncswitchmultibutton-android's People

Contributors

nanchen2251 avatar

Stargazers

 avatar 王孝云 avatar 陈茶 avatar ChenYy avatar Nisarg avatar Fengqi Mao avatar LiqiangZhang avatar 胡敏 avatar skeeter avatar  avatar

Watchers

James Cloos avatar  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.