Git Product home page Git Product logo

custom-toggle-button's Introduction

Custom-Toggle-Button

Download Build Status Android Arsenal codecov Codacy Badge codebeat badge

An android library for outline toggle buttons

unchecked state

checked state

How to use

Include the Library

Add the following lines in your app level dependencies

 dependencies {
        compile 'me.rishabhkhanna:CustomToggle:1.0.0'
    }

Usage

To use Custom toggle button, add the following lines in your xml

    <me.rishabhkhanna.customtogglebutton.CustomToggleButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:textOn="toggle button"
        android:textOff="toggle button"
        ></me.rishabhkhanna.customtogglebutton.CustomToggleButton>

Customizations

you can use all the default toggle button attributes and apart from that customizations can be made using following attributes: -

  • app:checkedColor="#333" (To change the color of checked toggle state)
  • app:uncheckedColor="#444" (To change the outline color of unchecked state)
  • app:borderWidth="10dp" (To change border width)
  • app:checkedTextColor="#fff" (To change text color of checked state, Default is #fff)
  • app:uncheckedTextColor="#000" (To change text color of unchecked state, Default is #333)
  • app:radius="10dp" (Define the corner radius of the button, examples given below)

Examples

  • app:radius="0dp"

radius 0dp unchecked radius 0dp checked

  • app:radius="2dp"

radius 2dp unchecked radius 2dp checked

  • app:radius="20dp"

radius 20dp unchecked radius 20dp checked

License

This software is licensed under the Apache License V2.0 A copy can be found here

custom-toggle-button's People

Contributors

rishabhk07 avatar

Stargazers

Jayant Jha avatar

Watchers

Naseem Akhtar 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.