Skip to content

Ability to get ToggleButtonLayout from Toggle #10

@alexeyvasilyev

Description

@alexeyvasilyev

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:

  1. Change listener callback, e.g.
    onToggledListener: ((layout: ToggleButtonLayout, toggle: Toggle, selected: Boolean) -> Unit)?

  2. Allow to get ToggleButtonLayout from Toggle class.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions