Skip to content

Commit 00f9f4c

Browse files
authored
Update README.md
1 parent 6f8c27f commit 00f9f4c

1 file changed

Lines changed: 22 additions & 6 deletions

File tree

README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Generic%20Dialog-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/7770)
1414

1515
___
16-
## Installation
16+
### Installation
1717

1818
1. Add it in your root build.gradle at the end of repositories:
1919
```groovy
@@ -33,7 +33,7 @@ ___
3333
implementation 'com.github.JDevZone:CheckableTextView:{latest_version}'
3434
}
3535
```
36-
## Basic usage
36+
### Basic usage
3737

3838
```xml
3939
<com.devzone.checkabletextview.CheckableTextView
@@ -46,8 +46,24 @@ ___
4646
app:ctv_Text="@string/app_name"
4747
android:layout_width="match_parent"
4848
android:layout_height="wrap_content"/>
49-
```
50-
## Listen State Changes
49+
```
50+
### Change State Programatically
51+
You can change checked state as follows :
52+
```kotlin
53+
checkedTV.setChecked(isChecked)
54+
55+
// default value `shouldNotifyListeners` is false
56+
57+
//or
58+
checkedTV.setChecked(isChecked,shouldNotifyListeners)
59+
60+
// First Boolean parameter `isChecked` sets the current state
61+
// Second Boolean parameter `shouldNotifyListeners` determines
62+
//if `onCheckChange` method should be Called or Not
63+
64+
```
65+
66+
### Listen State Changes
5167
You can listen to state changes by registering a listener like as follows :
5268
```kotlin
5369
checkedTV.setOnCheckChangeListener()
@@ -60,7 +76,7 @@ override fun onCheckChange(view: View, isChecked: Boolean) {
6076
}
6177
```
6278

63-
## Customisation
79+
### Customisation
6480

6581
Here are the attributes you can specify through XML or related setters:
6682
* `ctv_Text` - Set text.
@@ -71,7 +87,7 @@ Here are the attributes you can specify through XML or related setters:
7187
* `ctv_IconTint` - Set icon tint.
7288
* `ctv_IconChecked` - Set textView state checked.
7389

74-
## 📄 License
90+
### 📄 License
7591

7692
Checkable TextView is released under the MIT license.
7793
See [LICENSE](./LICENSE) for details.

0 commit comments

Comments
 (0)