Skip to content

Commit 6f6378e

Browse files
committed
Update readme.
1 parent fb630a3 commit 6f6378e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ A container of toggle buttons, supports multiple / single selection and button c
99

1010
```
1111
dependencies {
12-
compile 'com.nex3z:toggle-button-group:0.2.3'
12+
compile 'com.nex3z:toggle-button-group:1.0.0'
1313
}
1414
```
1515

16+
There has been a lot of changes since the 1.0.0 version, old versions can be found in the [release page](https://github.com/nex3z/ToggleButtonGroup/releases).
17+
1618

1719
## SingleSelectToggleGroup
1820

@@ -139,11 +141,11 @@ multi.setOnCheckedChangeListener(new MultiSelectToggleGroup.OnCheckedStateChange
139141

140142
You can implement custom toggle button in two ways,
141143

142-
- Implement [ToggleButton](https://github.com/nex3z/ToggleButtonGroup/blob/master/togglebuttongroup/src/main/java/com/nex3z/togglebuttongroup/button/ToggleButton.java) interface, as [CustomToggleButton](https://github.com/nex3z/ToggleButtonGroup/blob/master/sample/src/main/java/com/nex3z/togglebuttongroup/sample/CustomToggleButton.java) in the sample, or
144+
- Implement [`ToggleButton`](https://github.com/nex3z/ToggleButtonGroup/blob/master/togglebuttongroup/src/main/java/com/nex3z/togglebuttongroup/button/ToggleButton.java) interface, as [`CustomToggleButton`](https://github.com/nex3z/ToggleButtonGroup/blob/master/sample/src/main/java/com/nex3z/togglebuttongroup/sample/CustomToggleButton.java) in the sample, or
143145

144-
- Extend [CompoundToggleButton](https://github.com/nex3z/ToggleButtonGroup/blob/master/togglebuttongroup/src/main/java/com/nex3z/togglebuttongroup/button/CompoundToggleButton.java) class, like [CustomCompoundToggleButton](https://github.com/nex3z/ToggleButtonGroup/blob/master/sample/src/main/java/com/nex3z/togglebuttongroup/sample/CustomCompoundToggleButton.java).
146+
- Extend [`CompoundToggleButton`](https://github.com/nex3z/ToggleButtonGroup/blob/master/togglebuttongroup/src/main/java/com/nex3z/togglebuttongroup/button/CompoundToggleButton.java) class, like [`CustomCompoundToggleButton`](https://github.com/nex3z/ToggleButtonGroup/blob/master/sample/src/main/java/com/nex3z/togglebuttongroup/sample/CustomCompoundToggleButton.java).
145147

146-
If you choose to implement `ToggleButton`, besides the [Checkable](https://developer.android.com/reference/android/widget/Checkable.html) interface, you also need to implement the `setOnCheckedChangeListener()`, which allows [ToggleButtonGroup](https://github.com/nex3z/ToggleButtonGroup/blob/master/togglebuttongroup/src/main/java/com/nex3z/togglebuttongroup/ToggleButtonGroup.java) to listen to changes of any checked states. You need to handle the click event on the button and toggle its checked state properly, as `ToggleButtonGroup` will not toggle the button when it's being clicked.
148+
If you choose to implement `ToggleButton`, besides the [`Checkable`](https://developer.android.com/reference/android/widget/Checkable.html) interface, you also need to implement the `setOnCheckedChangeListener()`, which allows [`ToggleButtonGroup`](https://github.com/nex3z/ToggleButtonGroup/blob/master/togglebuttongroup/src/main/java/com/nex3z/togglebuttongroup/ToggleButtonGroup.java) to listen to changes of any checked states. You need to handle the click event on the button and toggle its checked state properly, as `ToggleButtonGroup` will not toggle the button when it's being clicked.
147149

148150
`CompoundToggleButton` implements `ToggleButton` and notifies `ToggleButtonGroup` of any checked state changes. But you still need to handle the click event on the button, as `CompoundToggleButton` wouldn't know which part of it should trigger the "toggle" operation. Add an `OnClickListener` on the "trigger view" and call `toggle()` is just enough.
149151

0 commit comments

Comments
 (0)