All Projects → llollox → Compoundbuttongroup

llollox / Compoundbuttongroup

Licence: mit
An Android library to easily implement compound buttons

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Compoundbuttongroup

Vxe Table
🐬 vxe-table vue 表格解决方案
Stars: ✭ 4,242 (+8057.69%)
Mutual labels:  radio, grid, checkbox
Niui
Lightweight, feature-rich, accessible front-end library
Stars: ✭ 152 (+192.31%)
Mutual labels:  grid, buttons
React Icheck
🔘 iCheck components built with React. Highly customizable checkbox, radio buttons and radio group.
Stars: ✭ 175 (+236.54%)
Mutual labels:  radio, checkbox
Bootstrap Table
An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation, Vue.js)
Stars: ✭ 11,068 (+21184.62%)
Mutual labels:  radio, checkbox
Prompt Checkbox
This repository has been archived, use Enquirer instead.
Stars: ✭ 21 (-59.62%)
Mutual labels:  radio, checkbox
Easy Toggle State
A tiny JavaScript library to easily toggle the state of any HTML element in any contexts, and create UI components in no time.
Stars: ✭ 261 (+401.92%)
Mutual labels:  radio, checkbox
Vue Checkbox Radio
Checkbox and radio component for Vue.js
Stars: ✭ 99 (+90.38%)
Mutual labels:  radio, checkbox
Flutter smart select
SmartSelect allows you to easily convert your usual form select or dropdown into dynamic page, popup dialog, or sliding bottom sheet with various choices input such as radio, checkbox, switch, chips, or even custom input. Supports single and multiple choice.
Stars: ✭ 179 (+244.23%)
Mutual labels:  radio, checkbox
Bootstrap Switch
Turn checkboxes and radio buttons in toggle switches.
Stars: ✭ 5,132 (+9769.23%)
Mutual labels:  radio, checkbox
Ckdcss
A tiny set of micro interactions for your checkboxes.
Stars: ✭ 49 (-5.77%)
Mutual labels:  radio, checkbox
Fld Grd
Google Images/Flickr inspired fluid grid layouts
Stars: ✭ 37 (-28.85%)
Mutual labels:  grid
Atgrid.css
CSS Grid System with attribute selectors
Stars: ✭ 37 (-28.85%)
Mutual labels:  grid
Pandoraplayer
🅿️ PandoraPlayer is a lightweight music player for iOS, based on AudioKit and completely written in Swift.
Stars: ✭ 1,037 (+1894.23%)
Mutual labels:  radio
Tdoa Evaluation Rtlsdr
Matlab Scripts for Evaluation of a TDOA System based on RTL-SDRs
Stars: ✭ 49 (-5.77%)
Mutual labels:  radio
Memo
Decorators that help you remember.
Stars: ✭ 34 (-34.62%)
Mutual labels:  grid
Rf1101se Teensy
Driving one of those cheap RF1101SE boards with a Arduino or Teensy
Stars: ✭ 45 (-13.46%)
Mutual labels:  radio
Baseliner
All your baseline are belong to us
Stars: ✭ 35 (-32.69%)
Mutual labels:  grid
Blog
在这里写一些工作中遇到的前端,后端以及运维的问题
Stars: ✭ 974 (+1773.08%)
Mutual labels:  grid
React Native Super Grid
Responsive Grid View for React Native
Stars: ✭ 971 (+1767.31%)
Mutual labels:  grid
Fgci Ansible
🔬 Collection of the Finnish Grid and Cloud Infrastructure Ansible playbooks
Stars: ✭ 49 (-5.77%)
Mutual labels:  grid

Compound Button Group Android

Alt text API Android Arsenal

An Android library to easily implement compound buttons

Installation

Gradle

Add Gradle dependency:

dependencies {
  compile 'com.llollox.androidprojects:compoundbuttongroup:1.0.2'
}

Maven

<dependency>
  <groupId>com.llollox.androidprojects</groupId>
  <artifactId>compoundbuttongroup</artifactId>
  <version>1.0.2</version>
  <type>pom</type>
</dependency>

Usage

Check Box

Sample of check_box

<com.llollox.androidprojects.compoundbuttongroup.CompoundButtonGroup
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:entries="@array/planets"
    app:compoundType="check_box"/>

Check Box Grid (2 Cols, Label After)

Sample of check_box

<com.llollox.androidprojects.compoundbuttongroup.CompoundButtonGroup
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:entries="@array/planets"
    app:compoundType="check_box"
    app:numCols="2"
    app:labelOrder="after"/>

Radio

Sample of radio

<com.llollox.androidprojects.compoundbuttongroup.CompoundButtonGroup
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:entries="@array/planets"
    app:compoundType="radio"
    app:labelOrder="after"/>

Radio Grid (3 Cols)

Sample of check_box

<com.llollox.androidprojects.compoundbuttongroup.CompoundButtonGroup
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:entries="@array/planets"
    app:compoundType="radio"
    app:numCols="3"
    app:labelOrder="after"/>

Getters

  • List<Integer> getCheckedPositions() Returns the current checked positions
List<Integer> positions = compoundButtonGroup.getCheckedPositions();
  • CompoundType getCompoundType() Get the type of the compound buttons.
compoundButtonGroup.getCompoundType();
  • LabelOrder getLabelOrder() Get the label order of the compound buttons. This determines if the label is before or after the compound button.
compoundButtonGroup.getLabelOrder();
  • int getNumCols() Get the current number of cols.
compoundButtonGroup.getNumCols();

Setters

  • void setCheckedPosition(int position) Checks the button at the position passed as argument. Typically to be used with radio buttons.
int position = 3;
compoundButtonGroup.setCheckedPosition(position);
  • void setCheckedPositions(List<Integer> positions) Checks all the buttons at the positions passed as argument. Typically to be used with check box buttons.
List<Integer> positions = new ArrayList<Integer>(){{add(2); add(4);}};
compoundButtonGroup.setCheckedPositions(positions);
  • void setCompoundType(CompoundType compoundType) Set the type of the compound buttons. Allowed values are: CompoundType.CHECK_BOX, CompoundType.RADIO. In order to see the changes on UI please call the reDraw() method.
compoundButtonGroup.setCompoundType(CompoundButtonGroup.CompoundType.RADIO);
  • void setEntries(List<String> entries) Set the entries for the compound button group. In order to see the changes on UI please call the reDraw() method.
List<String> entries = new ArrayList<String>(){{add("Mars"); add("Mercury"); add("Earth");}};
compoundButtonGroup.setEntries(entries);
  • void setEntries(HashMap<String, String> entries) Set the entries for the compound button group. The key / value pair represent the value / label of the entry respectively. In order to see the changes on UI please call the reDraw() method.
LinkedHashMap<String, String> map = new LinkedHashMap<>();
map.put("house", getString(R.string.house));
map.put("orange", getString(R.string.orange));
compoundButtonGroup.setEntries(map);
compoundButtonGroup.reDraw();
  • void setLabelOrder(LabelOrder LabelOrder) Set the label order of each compound button. This determines if the label is before or after the compound button. Allowed values are: LabelOrder.BEFORE, LabelOrder.AFTER. In order to see the changes on UI please call the reDraw() method.
compoundButtonGroup.setLabelOrder(CompoundButtonGroup.LabelOrder.AFTER);
  • void setNumCols(int numCols) Set the number of cols. If it is greater than 1 the compound buttons are shown as a grid. NB. It cannot be smaller than 1! In order to see the changes on UI please call the reDraw() method.
int numCols = 2;
compoundButtonGroup.setNumCols(numCols);

Listeners

OnButtonSelectedListener
compoundButtonGroup.setOnButtonSelectedListener(new CompoundButtonGroup.OnButtonSelectedListener() {
    @Override
    public void onButtonSelected(int position, String value, boolean isChecked) {
        // Your code
    }
});

Attributes

It is possible to customize the compound button group applying the following options:

Option Name Format Description
w app:compoundType check_box or radio
app:entries array String array of the entries of the compound button group.
app:labelOrder before or after This determines if the label is before or after the compound button. By default is before.
app:numCols int Setting this parameter the compound buttons are shown as a grid and it indicates the number of cols of the grid.
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].