Giter Site home page Giter Site logo

animcheckbox's Introduction

AnimCheckBox

##Screenshot screenshot

###Inspired By Dribbble

##Import to your project ###Gradle Add it in your build.gradle at the end of repositories

repositories {
    // ...
    maven { url "https://jitpack.io" }
}

Add the dependency in the form

dependencies {
    compile 'com.github.lguipeng:AnimCheckBox:1.0.1'
}

###Maven

<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>
<dependency>
    <groupId>com.github.lguipeng</groupId>
    <artifactId>AnimCheckBox</artifactId>
    <version>1.0.1</version>
</dependency>

###Or Copy AnimCheckBox.java into your project.

##Usage ###In Layout File

  <com.github.lguipeng.library.animcheckbox.AnimCheckBox
        android:layout_gravity="center_horizontal"
        android:layout_width="80dp"
        android:padding="4dp"
        android:layout_height="wrap_content"
        app:stroke_width="4dp"
        app:stroke_color="#2196F3"
        app:circle_color="#1976D2"
        app:checked="true"/>

###In Java File

AnimCheckBox checkbox = (AnimCheckBox)findViewById(R.id.checkbox)
checkbox.setChecked(true);
boolean animation = true;
checkbox.setChecked(false, animation);

##关于我

##License

Copyright 2017 Liaoguipeng

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.

animcheckbox's People

Contributors

jinyuzhang avatar lguipeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

animcheckbox's Issues

Circle is slightly trimmed from bottom

Hi I am using Xiaomi device running on 4.4.4 an I can see the circle slightly trimmed from the bottom. I have tried changing sizes and padding but no avail. Empty relative layout! Can someone help ?

Hi! Can anyone help with code?

Can you help me with implementing it to the ViewPager's Adapter.
Here is code how I implemented basic CheckBox. RecyclerView with Multi items

@Override
    public void onBindViewHolder(final ViewHolder viewHolder, final int position) {
        final int pos = position;

        viewHolder.chkSelected.setOnCheckedChangeListener(null);
        viewHolder.chkSelected.setChecked(genreList.get(position).isSelected());
        viewHolder.chkSelected.setTag(genreList.get(position));
        viewHolder.chkSelected.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                CheckBox cb = (CheckBox) v;
                Genres gr = (Genres) cb.getTag();
                tinyDB = new TinyDB(v.getContext());

                if (cb.isChecked()) {
                    gr.setSelected(cb.isChecked());
                    genreList.get(pos).setSelected(cb.isChecked());
                    cgIntegerList.add(pos);
                } else {
                    cgIntegerList.remove(Integer.valueOf(pos));
                }
            }
        });

    }

Btw, nice CB! It looks awesome!

Different colours for stroke, circle and tick (check)

Hi, this is a nice library. There is a way to have separate colours for the component like a different stroke colour when unchecked, a fill colour when checked but then with a different colour for the check mark? At the moment, have only two colours.

work without the tick

when i press the checkbox it works nicely,
but when i use
setchecked=true;
it looks like this
screenshot 2f e2 80 8f 2f - -

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.