Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/acontenti/radiobar

A re-implementation of Android RadioGroup with images instead of RadioButtons
https://github.com/acontenti/radiobar

Last synced: about 2 months ago
JSON representation

A re-implementation of Android RadioGroup with images instead of RadioButtons

Awesome Lists containing this project

README

        

# RadioBar
[![JitPack](https://img.shields.io/github/release/acontenti/RadioBar.svg?label=JitPack)](https://jitpack.io/#acontenti/RadioBar/1.0)

A re-implementation of Android RadioGroup with images instead of RadioButtons.

It consists of two Views:
- RadioBar
- RadioImageView

##Getting Started
### Adding to Android Studio project
1. Add these lines to `build.gradle` of your project
```groovy
repositories {
// ...
maven { url "https://jitpack.io" }
}
```

2. Add these lines to `build.gradle` of your module
```groovy
dependencies {
// ...
compile 'com.github.acontenti:RadioBar:1.1'
}
```
###Example code
XML layout example
```xml

```
Java implementation
```java
RadioBar mRadioBar = (RadioBar) findViewById(R.id.radioBar1);
mRadioBar.setOnSelectedItemChangeListener(new RadioBar.OnSelectedItemChangeListener() {
@Override
public void onSelectedItemChange(RadioBar radioBar, int id, int position) {
mSelectedRadioImageViewOldPosition = mSelectedRadioImageViewPosition;
mSelectedRadioImageViewPosition = position;
RadioImageView mSelectedRadioImageView = (RadioImageView) findViewById(id);

}
});
int mSelectedRadioImageViewId = mRadioBar.getSelectedRadioImageViewId();
RadioImageView mSelectedRadioImageView = (RadioImageView) findViewById(mSelectedRadioImageViewId);
```
##Copyright
Copyright © 2015, Alessandro Contenti.

This work is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-sa/4.0/).