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

https://github.com/ykw93/constraintradiogroup

ConstraintRadioGroup
https://github.com/ykw93/constraintradiogroup

android constraintlayout constraintradiogroup radiogroup

Last synced: 8 months ago
JSON representation

ConstraintRadioGroup

Awesome Lists containing this project

README

          

# ConstraintRadioGroup
This is a custom RadioGroup library that inherits from ConstraintLayout. You can use ConstraintLayout attributes, easily changing text font and color for checked/unchecked statuses. RadioGroup uses CompoundButton so you can use RadioButton as well as CheckBox components.

## Usage
### Gradle
```gradle
dependencies {
implementation 'com.wayne:constraint-radiogroup:1.0.0'
}
```

#### How to use
* xml
```xml

```
*kotlin
```kotlin
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

crg_custom.checkedChangeListener = object : OnCheckedChangeListener {
override fun onCheckedChanged(
group: ConstraintRadioGroup,
checkedButton: CompoundButton
) {
// TODO
// (checkedButton as RadioButton)
}
}
}
}
```

#### Attributes
- `selected_font` (null)
- `unSelected_font` (null)
- `selected_text_color` (Color.BLACK)
- `unSelected_text_color` (Color.BLACK)

#### Important note while applying font
- You must create a directory to res/value/ and place the font file within that path.

## License
```
Copyright 2020 @Wayne

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.
```