https://github.com/ykw93/constraintradiogroup
ConstraintRadioGroup
https://github.com/ykw93/constraintradiogroup
android constraintlayout constraintradiogroup radiogroup
Last synced: 8 months ago
JSON representation
ConstraintRadioGroup
- Host: GitHub
- URL: https://github.com/ykw93/constraintradiogroup
- Owner: YKW93
- License: apache-2.0
- Created: 2020-09-02T11:47:27.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-16T05:22:03.000Z (almost 6 years ago)
- Last Synced: 2025-06-17T13:50:27.547Z (about 1 year ago)
- Topics: android, constraintlayout, constraintradiogroup, radiogroup
- Language: Kotlin
- Homepage:
- Size: 315 KB
- Stars: 11
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.
```