RobertApikyan / SegmentedControl

Android SegmentedControl + multi row support
Apache License 2.0
162 stars 30 forks source link

No way to remove segment click listeners #16

Closed ka05 closed 5 years ago

ka05 commented 5 years ago

I am using this control in a cell in a recycler view for use in a form. There are duplicated calls occurring since the listener is added and never removed. I will create a pull request.

ka05 commented 5 years ago

Just created a pull request: https://github.com/RobertApikyan/SegmentedControl/pull/17

RobertApikyan commented 5 years ago

Adding listeners in the onCreateViewHolder method (or in the ViewHolder's constructor ) will be more preferable, instead of adding them in the onBindViewHolder method. This approach will solve the problem, however using the remove method also will do the job.

RobertApikyan commented 5 years ago

Thanks for contribution, the remove methods are added in the latest release 'com.github.RobertApikyan:SegmentedControl:1.1.0'

ka05 commented 5 years ago

@RobertApikyan, thanks for merging the PR and making the update! Seems to be working appropriately now, much apreciated