All Projects → okdroid → Checkable Chip View

okdroid / Checkable Chip View

Licence: apache-2.0
Android Chipview Widget

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Checkable Chip View

Dragpointview
A draggable PointView for Android.
Stars: ✭ 401 (-21.83%)
Mutual labels:  widget
Sliding Panel
Android sliding panel that is part of the view hierarchy, not above it.
Stars: ✭ 433 (-15.59%)
Mutual labels:  widget
Chip Navigation Bar
An android navigation bar widget
Stars: ✭ 491 (-4.29%)
Mutual labels:  widget
Scriptable
scriptable widget
Stars: ✭ 405 (-21.05%)
Mutual labels:  widget
Styled widget
Simplifying widget style in Flutter.
Stars: ✭ 424 (-17.35%)
Mutual labels:  widget
Flutter easyloading
✨A clean and lightweight loading/toast widget for Flutter, easy to use without context, support iOS、Android and Web
Stars: ✭ 455 (-11.31%)
Mutual labels:  widget
Sofi
an OS agnostic UI module for Python
Stars: ✭ 378 (-26.32%)
Mutual labels:  widget
React Event Timeline
A responsive event timeline in React.js
Stars: ✭ 504 (-1.75%)
Mutual labels:  widget
Avatarview
A circular Image View with a lot of perks. Including progress animation and highlight state with borders and gradient color.
Stars: ✭ 429 (-16.37%)
Mutual labels:  widget
Radarchartview
Android view (widget) for rendering radial diagrams
Stars: ✭ 488 (-4.87%)
Mutual labels:  widget
Githubcontributionsios
Show off your GitHub contributions from your lock screen 📱
Stars: ✭ 410 (-20.08%)
Mutual labels:  widget
Qt Advanced Docking System
Advanced Docking System for Qt
Stars: ✭ 422 (-17.74%)
Mutual labels:  widget
Dividerdrawable
Help to layout and draw dividers on android views.
Stars: ✭ 464 (-9.55%)
Mutual labels:  widget
Tabulator
Interactive Tables and Data Grids for JavaScript
Stars: ✭ 4,329 (+743.86%)
Mutual labels:  widget
Vue Grid Layout
A draggable and resizable grid layout, for Vue.js.
Stars: ✭ 5,170 (+907.8%)
Mutual labels:  widget
Flutter badges
A flutter package for creating badges.
Stars: ✭ 391 (-23.78%)
Mutual labels:  widget
Lottie Flutter
Render After Effects animations natively on Flutter. This package is a pure Dart implementation of a Lottie player.
Stars: ✭ 444 (-13.45%)
Mutual labels:  widget
Material Viewpagerindicator
Dot-based Android ViewPager indicator with Material Design animations.
Stars: ✭ 511 (-0.39%)
Mutual labels:  widget
Aws Lex Web Ui
Sample Amazon Lex chat bot web interface
Stars: ✭ 500 (-2.53%)
Mutual labels:  widget
Switchbutton
A cute widget of Switch Button for you to create beautiful and friendly UI.
Stars: ✭ 4,531 (+783.24%)
Mutual labels:  widget

CheckableChipView

Build Status Bintray

A checkable widget for Android. Based on the EventFilterView from the Google I/O 2018 app.

Requires Android minSdkVersion 21.

Setup

Make sure you have the jcenter repo in your project level build.gradle

allprojects {
    repositories {
        jcenter()
    }
}

Add the dependency to your lib/app build.gradle

dependencies {
    implementation 'com.github.okdroid:checkablechipview:2.0.0'
}

Usage

XML

Include the widget into your xml layout like this

<com.github.okdroid.checkablechipview.CheckableChipView
        android:id="@+id/chip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Pie Cake" />

The following xml attributes are supported

Attribute Description
android:text The text to display
android:textColor The default text color
android:color The color of the indicator dot as well as the background color when the widget is checked
android:background The default background color
android:checked The checked state of the widget, either true or false
app:ccv_outlineColor The color of the outline
app:ccv_outlineCornerRadius The corner radius of the outline, in dp. Defaults to a pill shape if not set
app:ccv_outlineWidth The stroke width of the outline, in dp
app:ccv_checkedTextColor The text color when the widget is checked
app:ccv_foreground The foreground drawable to display

In code

The state of the widget can be observed like this

chip.onCheckedChangeListener = { view: CheckableChipView, isChecked: Boolean ->
    // do your logic here
}

To switch between checked/unchecked state programatically with animation, use the following method:

chip.setCheckedAnimated(checked = true) {
    // onAnimationEnd callback
}

Plus, there are following methods at your service for changing the state without animation:

if (!chip.isChecked) {
    chip.isChecked = true
}

chip.toggle() // toggles between states

Acknowledgements

Thanks to the team behind the Google I/O app. Thank you for open sourcing the code and letting others reuse and learn from it.

Thanks to Nick Butcher for the initial implementation in the I/O app.

License

Copyright 2018 Google, Inc.
Copyright 2018 okdroid

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].