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

Fix click listener kapt bug #1327

Merged
merged 3 commits into from
May 19, 2023
Merged

Fix click listener kapt bug #1327

merged 3 commits into from
May 19, 2023

Conversation

elihart
Copy link
Contributor

@elihart elihart commented Nov 15, 2022

This addresses a rare bug because of the xprocessing behavior change in its new version. In kapt only (not ksp), a click listener in a base epoxy model view class that has a sub class epoxy model view extend it specifically in a different module, would result in the sub class's generated epoxy model not having the OnModelClickListener override function. This is because the type checking for a click listener wasn't working correctly in this case where the click listener type was being inherited from a type on the class path. Was a simple fix to use correct type checking instead of ==

Also cleans up how publishing is done

@elihart elihart force-pushed the eli-fix_click_listener_problem branch from f4514c3 to 2ad48dd Compare November 15, 2022 00:43
@elihart elihart requested a review from vinaygaba November 15, 2022 00:44


// https://vanniktech.github.io/gradle-maven-publish-plugin/other/
publishing {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this file, I ended up using this for Showkase publishing as well 🙏

nonNullType == memoizer.viewOnClickListenerType -> ViewClickListener
nonNullType == memoizer.viewOnLongClickListenerType -> ViewLongClickListener
nonNullType == memoizer.viewOnCheckChangedType -> ViewCheckedChangeListener
// Note, == does not work for type comparisons when comparing types between classpath
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any chance you could maybe describe the bug a bit more in the PR description. Just helps me understand a bit better. I can follow that the equals check wasn't what was needed but didn't understand what the difference in the generated code looked like

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any test case that could be added?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hard to test because this happens when they are in different modules

@elihart elihart merged commit 5af2c81 into master May 19, 2023
@elihart elihart deleted the eli-fix_click_listener_problem branch May 19, 2023 18:48
@elihart elihart mentioned this pull request May 19, 2023
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

Successfully merging this pull request may close these issues.

2 participants