Skip to content

Commit 8e68865

Browse files
committed
Improvements to API
1 parent 8fa9eb2 commit 8e68865

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

togglebuttonlayout/src/main/java/com/savvyapps/togglebuttonlayout/Toggle.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import android.graphics.drawable.Drawable
55
/**
66
* An item within a [ToggleButtonLayout]
77
*/
8-
class Toggle(
8+
data class Toggle(
99

1010
/**
1111
* The ID provided within the Toggle
@@ -20,7 +20,8 @@ class Toggle(
2020
/**
2121
* Optional title
2222
*/
23-
val title: CharSequence?) {
23+
val title: CharSequence?
24+
) {
2425

2526
/**
2627
* The selection state of the toggle
@@ -29,13 +30,13 @@ class Toggle(
2930

3031

3132
/**
32-
* Get the parent view of the toggle. Null if not yet inflated
33+
* Get the parent view of the toggle. Null if its view has not been inflated
3334
*/
3435
var toggleButtonLayout: ToggleButtonLayout? = null
3536
internal set
3637

3738
/**
38-
* The current toggle view. Null if not yet inflated
39+
* The current toggle view. Null if its view has not been inflated
3940
*/
4041
var toggleView: ToggleView? = null
4142
internal set

togglebuttonlayout/src/main/java/com/savvyapps/togglebuttonlayout/ToggleButtonLayout.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class ToggleButtonLayout : CardView {
116116
/**
117117
* Listen for when toggles get selected and deselected
118118
*/
119-
var onToggledListener: ((toggleButtonLayout: ToggleButtonLayout?, toggle: Toggle, selected: Boolean) -> Unit)? = null
119+
var onToggledListener: ((toggleButtonLayout: ToggleButtonLayout, toggle: Toggle, selected: Boolean) -> Unit)? = null
120120

121121
constructor(context: Context) : super(context) {
122122
init(context, null)

0 commit comments

Comments
 (0)