-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Nullability Annotations to Java Classes - Activity & Fragment - Replace findViewById
with ViewBinding
#18906
Comments
Generated by 🚫 dangerJS |
findViewById
with ViewBinding
findViewById
with ViewBinding
👋 @develric @khaykov and @RenanLukas ! I just started work on EditCommentActivity.java and noticed the deprecation on this class, plus its associated Javadoc, mentioning that if someone is adding any features or modifying this class should first reach out to you. I also noticed the CommentDetailFragment.java class, which is driving the opening of the comment for editing (via the editComment() method), and wondering what's the current state with the UnifiedCommentsCommentEditFeatureConfig.kt feature flag. Can we drop it and its single usage here, wdyt? 🤔 FYI: This will help me cleanup and delete this EditCommentActivity.java class, that is, instead of replacing any |
👋 Thanks for the ping, @ParaskP7. Unfortunately I don't have context on the deprecation of Maybe someone else has context on this. |
I think I can add some context, and maybe @develric can correct me If I got something wrong :) Comment reworking was a pretty big projects, but only part of it was finished, so we have this "Unified" package for new stuff. We deprecated all the files we were planning to change, and left the comments so folks would not add any new functionality to them while we are working on them. As far as I remember we only finished the comment list, and maybe had some work on comment editor (since we have |
Hey @ParaskP7 👋 , I second what @khaykov said above. Also I think removing the UnifiedCommentsCommentEditFeatureConfig.kt makes sense as a cleanup/simplification. AFAIU you are going to work on this issue soon-ish, feel free to send PR(s) my way or let's align on slack if we need to plan for more consistently supporting this (we cannot commit on this soon-ish but I think having an overall cleaning up for those deprecated classes where they now have a replacement class would be good, I made a draft note on our team gh board for this since afaiu a deeper cleanup can also happen separately). |
👋 @RenanLukas @khaykov @develric and thanks for the quick reply, you all rock! 🙇 ❤️
Great, this is what I thought as well. 👍 Let me then know if you are okay with me proceeding with removing this UnifiedCommentsCommentEditFeatureConfig.kt feature flag and the associated unused EditCommentActivity.java activity class, and then, I'll definitely start work on that and send a PR your way. I just need a formal thumbs-up on that. 😊 💯 😊 FYI: From the looks of it, in total, we have this
|
Sounds good 👍 and thanks 🙇
I would need to look better into the code, but as you reported already some of them are still in use, so probably until we come back to them with a future project we should remove the deprecation and clean-up what's possible (like not more needed feature flags/code branches or the like where possible 🙇...that's possibly the scope of the draft gh issue I placed in the team gh board, unless something makes sense to cleanup anyway while you go over the tasks you are tackling here, we can decide while we go with your PRs, and if we are lucky we end up with a good clean-up already 🤞 ) |
Awesome, thanks for another 👍 on that @develric , I will then go ahead and start work on this soon-ish, that is, after finishing my current in-progress work on CommentDetailFragment.java! 🙇
👍 🤞 🙏 |
👋 @develric !
After finishing #19232, I went ahead and created this #19239 for you to review. 🙏 PS: Feel free to re-assign this on any other reviewer you deem more appropriate. |
Parent #18905
This issue is about adding replacing
findViewById(...)
with ViewBinding to as many Java-relatedActivity
&Fragment
classes as possible.Instead of adding missing nullability annotations (
@Nullable
&@NonNull
) to layoutView
related fields on such Java-relatedActivity
&Fragment
classes, it is better to migrate those fields, from the old way of assigning those (usingfindViewById(...)
), and into the new way of referencing such view (direct via ViewBinding.FYI: You could reference #14845 to get an idea on how to go about that.
Activity
Tasks (
WordPress
+ui.main
)findViewById
withViewBinding
for Site Picker (relatively safe
) #19209Tasks (
WordPress
+ui.comments
)findViewById
withViewBinding
for Comments (relatively safe
) #19217EditCommentActivity
Screen #19239Tasks (
WordPress
+ui.media
)Tasks (
WordPress
+ui.notifications
)findViewById
withViewBinding
for Notifications (relatively safe
) #18935Tasks (
WordPress
+ui.photopicker
)Tasks (
WordPress
+ui.plugins
)Tasks (
WordPress
+ui.posts
)Tasks (
WordPress
+ui.publicize
)Tasks (
WordPress
+ui.reader
+post
)Tasks (
WordPress
+ui.reader
+user
)Tasks (
WordPress
+ui.reader
+other
)findViewById
withViewBinding
for Reader Comments (relatively safe
) #19333Tasks (
WordPress
+ui.stockmedia
)Tasks (
WordPress
+ui.themes
)Tasks (
WordPress
+ui
+webview
)Tasks (
WordPress
+ui
+other
)Fragment
Tasks (
libs/editor
)Tasks (
WordPress
+ui.accounts
)Tasks (
WordPress
+ui.comments
)findViewById
withViewBinding
for Comment (relatively safe
->risky
) #19232Tasks (
WordPress
+ui.history
)findViewById
withViewBinding
for History (relatively safe
) #19172Tasks (
WordPress
+ui.media
)Tasks (
WordPress
+ui.people
)Tasks (
WordPress
+ui.plugins
)Tasks (
WordPress
+ui.posts
)Tasks (
WordPress
+ui.publicize
)Tasks (
WordPress
+ui.reader
+fragment
)Tasks (
WordPress
+ui.themes
)Tasks (
WordPress
+ui
)(❗) This exclamation mark is added to those activities and fragments that are quite complicated to migrate, and thus, maybe those should be left out from this specific attempt to replace
findViewById
withViewBinding
.The text was updated successfully, but these errors were encountered: