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
18181 . Add it in your root build.gradle at the end of repositories:
1919``` groovy
3333 implementation 'com.github.JDevZone:CheckableTextView:{latest_version}'
3434 }
3535```
36- ## Basic usage
36+ ### Basic usage
3737
3838``` xml
3939<com .devzone.checkabletextview.CheckableTextView
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
5167You can listen to state changes by registering a listener like as follows :
5268``` kotlin
5369checkedTV.setOnCheckChangeListener()
@@ -60,7 +76,7 @@ override fun onCheckChange(view: View, isChecked: Boolean) {
6076 }
6177```
6278
63- ## Customisation
79+ ### Customisation
6480
6581Here 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
7692Checkable TextView is released under the MIT license.
7793See [ LICENSE] ( ./LICENSE ) for details.
0 commit comments