-
Notifications
You must be signed in to change notification settings - Fork 99
The binding should not be passed around #57
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
The binding should not be passed around #57
Conversation
The binding generated by the MainActivity should not be passed around as it can generate memory leaks. This also helps to keep things where they belong instead of doing view logic everywhere. Eventually this could help to write better unit tests.
app/src/main/java/to/dev/dev_android/view/main/view/CustomWebViewClient.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/to/dev/dev_android/view/main/view/MainActivity.kt
Outdated
Show resolved
Hide resolved
…ty.kt Co-Authored-By: Joan Barroso Garrido <joanbarrosogarrido@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good, only a small change is required in one file to make it less error-prone and more readable.
app/src/main/java/to/dev/dev_android/view/main/view/CustomWebViewClient.kt
Outdated
Show resolved
Hide resolved
Any help merging @maestromac ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the long delay @sierisimo 🙇
LGTM!
What type of PR is this? (check all applicable)
Description
The binding generated by the
MainActivity
should not be passed around as it can generate memory leaks. This also helps to keep things where they belong instead of doing view logic everywhere.Adding a single lambda instead as the way to communicate makes the class more generic and easy to manage.
Eventually this could help to write better unit tests.
[optional] What gif best describes this PR or how it makes you feel?