-
Notifications
You must be signed in to change notification settings - Fork 3
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
Question regarding Delegated Property deprecation #66
Comments
The deprecation statement in the Readme might be too strong. The reason for deprecation is the IllegalStateException in the case of Fragments. However, there are no plans to remove, mark as Comparing Delegated Property with the official approach, there are few drawbacks to using Delegated Property. If there is a possibility of accessing the binding outside the onCreateView and onDestroyView methods, in the official approach, you would use the It's worth noting that even in the official approach, if you use the binding variable without considering the IllegalStateException, a similar exception can occur. Therefore, I don't believe the drawbacks of Delegated Property are significant. |
I would like to write |
Question regarding Delegated Property deprecation #66
Question regarding Delegated Property deprecation wada811/ViewBinding-ktx#66
I have noticed, that now Delegated Property are marked as Deprecated in the Readme's Overview:
https://github.com/wada811/ViewBinding-ktx/blob/master/README.md#overview
But looks like it's the only place where it's done. In the Delegated Property section below or in the source code they are not marked as Depricated either.
If they are deprecated - I am wondered what's the reason? Is it because of the
IllegalStateException
in the Fragment case?If so - what is the current and the future state of these api?
Are you planing to remove them or make
@RequiresOptIn
?Btw, I am wondered if approach of using Delegated Property with Fragments has any draw-backs comparing to using the official approach described at https://developer.android.com/topic/libraries/view-binding#fragments
P.S. I acknowledge, that
withBinding
approach is obviously preferable solution for the new Activities/Fragments, but migrating to it in the old classes might be an effort depending on the side of the code base.The text was updated successfully, but these errors were encountered: