-
Notifications
You must be signed in to change notification settings - Fork 29
Ability to get ToggleButtonLayout from Toggle #10
Copy link
Copy link
Closed
Description
In Android from all listeners you can get a view which called this listener.
e.g. View.OnClickListener::onClick(View v) or CompoundButton.OnCheckedChangeListener::onCheckedChanged(CompoundButton buttonView, boolean isChecked).
It is convenient to use setTag()/getTag(Object) with view.
At the same time it is not possible to get ToggleButtonLayout object from listener to use setTag()/getTag(Object) with the current implementation.
There are two solutions:
-
Change listener callback, e.g.
onToggledListener: ((layout: ToggleButtonLayout, toggle: Toggle, selected: Boolean) -> Unit)? -
Allow to get ToggleButtonLayout from Toggle class.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels