Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Observing TabLayout selection events throws cast exception #528

Open
d7knight opened this issue Oct 25, 2019 · 2 comments
Open

Observing TabLayout selection events throws cast exception #528

d7knight opened this issue Oct 25, 2019 · 2 comments

Comments

@d7knight
Copy link

I am using the latest androidx material dependency 11.1.0-beta01, upon subscribing to the RxTabLayout selectionEvents observable an exception is thrown

Exception
Caused by: java.lang.ClassCastException: com.jakewharton.rxbinding3.material.TabLayoutSelectionEventsObservable$Listener cannot be cast to com.google.android.material.tabs.TabLayout$BaseOnTabSelectedListener
Related Issue
Discovered another issue that was fixed in July for the selections observable was merged here #517 related to this issue #495

Potential Fix
The fix would be to make this listener in TapLayoutSelectionEventsObservable extend from BaseOnTabSelectedListener like the other fix I mentioned earlier in the related issue section

@himattm
Copy link

himattm commented Feb 10, 2020

I am having this issue as well using the androidx material dependency version 1.1.0-rc01

java.lang.ClassCastException: com.jakewharton.rxbinding3.material.TabLayoutSelectionEventObservable$Listener cannot be cast to com.google.android.material.tabs.TabLayout$BaseOnTabSelectedListener
        at com.jakewharton.rxbinding3.material.TabLayoutSelectionEventObservable.subscribeActual(TabLayoutSelectionEventObservable.kt:38)

@himattm
Copy link

himattm commented Feb 10, 2020

@d7knight Just confirmed this works using the material dependency version 1.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants