Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/acontenti/radiobar
- Owner: acontenti
- Created: 2015-09-14T22:18:34.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-23T21:55:41.000Z (over 9 years ago)
- Last Synced: 2024-03-15T17:11:14.343Z (10 months ago)
- Language: Java
- Homepage:
- Size: 281 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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/).