-
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 - DialogFragment - Replace findViewById
with ViewBinding
#19180
Comments
Generated by 🚫 dangerJS |
2 similar comments
Generated by 🚫 dangerJS |
Generated by 🚫 dangerJS |
findViewById
with ViewBinding
findViewById
with ViewBinding
can you please assign me this issue? |
👋 @Areeb786123 and thank you so much for offering to contribute! 🥇 Please feel free to start working on this. As such, I'll go ahead and assign this task to you (and me). PS: I am assigning myself as well, as I'll be guiding you all the way, up until we collaboratively merge your solution to Before you begin, make sure to at least read the following documentation:
FYI: Note that depending on your solution, number of PRs, PR description, commit strategy, etc, I might ask you to improve on the quality and sometimes, even redo a PR. But, don't be afraid of it, I will only do that to help you out. Since this will be one of your first contribution to this repo, it is all part of the learning process, that is, until you become comfortable and aware about the ins-and-outs of how we work. Do let me know if you need anything else! 🌟 PS: You can also check #18906 to get some inspiration on how to go about when working on your commits and then finally creating your PRs. I hope that helps. 🙏 |
@ParaskP7 thanks for assigning me i will complete it as soon as possible |
👋 @Areeb786123 and thank you! 💯
There is no rush, please take you time. Actually, it is better if you do it right, rather than fast. FYI: Please create a new PR per task above (aka per class), this way it will be more manageable for us to review, test and finally merge any of your PRs. |
@ParaskP7 OK sir thanks for the guidance. |
@ParaskP7 Can I work on this issue? |
👋 @neeldoshii and thank you so much for offering to contribute! 🥇 Please feel free to start working on this. As such, I'll go ahead and re-assign this task to you now. FYI: As per the above message, please make sure to read the documentation first. Also, I would suggest for you to create a new PR per task above (aka per class), this way it will be more manageable for us to review, test and finally merge any of your PRs. |
Thank you Petros Can you provide steps to reproduce the following fragment in the app? I did migration to ViewBinding locally but I am unsure about the impact wanna test it first before pushing. Also as a commit strategy as usual, would it be okay for one class migration as a commit for ease in reverting if needed? My current plan is to migrate |
👋 @neeldoshii and thanks for starting work on that! 🌟
You are correct, I just marked them as done, just to get them out of the way. ✅
We just want to make sure that the change is not breaking anything and thus impacting the app negatively. Thus, we should make sure that we can test it first, before the change, and then again, after the change, and this way to assert correctness of behavior.
👍
Actually, I would need to invest some time into reproducing this dialog myself. But, this is actually part of the task itself, to first try and figure out how to reproduce a screen/view/dialog. Sometimes, this might even be a dead-code that we could just need to "safely" remove instead.
First, I would suggest one class per PR, that is, unless a group of classes are related to a single specific screen and/or functionality. Then, as far as the commit strategy is concerned, I suggest multiple commits if possible, but self-sufficient, commits that do everything that they describe, but also don't do too many things at once. For example, if you need to refactor something, that is, before replacing a findViewById, a group of findViewById or all of them in one go, I would first suggest committing this unrelated refactor work first. Doest that help? 😊
As long as we take this PR by PR, one step at a time, your plan sounds good to me! 💯 Once more thanks for all your current and future contributions Neel! 🥇 |
Hi @ParaskP7,
👍
Gotcha, Rebasing #20933 and splitting it into two PR as this has 2 classes covered One more thing to ask. Would it be okay if I migrate this class to kotlin due to two reason 1. We still have 8 null annotation lint warning even after migrating to viewbinding 2. Sooner or later we eventually will need to migrate it. PostSettingsInputDialogFragment Same with Current plan : As a first step I am migrating currently to viewbinding in two PR then once this get merged without breaking then convert to kotlin (if approved). |
👋 @neeldoshii !
👍
Just to keep it simple, let's avoid the Kotlin migration and do it on separate PR(s) for now. Later on, when we gain more confidence over this process, and in us working together, we might consider doing both in a single PR. The truth is, I just don't want to overwhelmed you with (potential) extra PR comments, just because of the extra Kotlinization work (commits), risking your contributions/PR to stay still and maybe even not merge into PS: Don't worry too much about the warnings you see there. Most of them are nullability related warnings, which are anyway a prerequisite for a class Kotlinization process.
👍
Let's avoid this for a later (subsequent) set of PRs. |
Hi @ParaskP7 ! I have rebased and splitted it into Two PR (#20933 & #20941) and ready for review. Did more digging for Tasks (WordPress + widgets) Edit : PR #19568 says the steps to reproduce
Issue #8376 (comment) & #8376 (comment) also says the steps to reproduce this but this dialog is no longer used latest version of wordpress. I am not able to reproduce this in iOS and Android version. also doesn't have any |
👋 @neeldoshii !
Awesome, thanks, I'll get into reviewing those next week! 🌟
Great, you're right, I just marked this as done as well! ✅
Interesting, let me take a look at it and will get back to you on that. 🤔
The dialogs you mentioned with the linked comments are
Do you mean the But, yes, looking at |
Apologies. I pasted two comments from the PR which created confusion. If this is no longer used its safe to say both (
Yes |
👋 @neeldoshii and a happy new week to you! ☀️
Yes, let me first investigate that real quick, just to verify that both |
After investigating those real quick, I found out that both the |
Hi @ParaskP7
|
Apologies over here, I was testing the app only for I was so confused where is |
👋 @neeldoshii and thanks!
I guess you're right, this
Actually, I think we should only consider Java classes for now, since, as per what the title suggests, this all is about making Java classes null-safe. Thus, you'll notice that in general I haven't included any Kotlin classes on the issue description and its lists. 😊 |
👋 @neeldoshii and please, don't apologize to me, I am just here to guide you and help you become the most effective contributor you can be. So, first, let me THANK YOU again for all the work you've been doing! 🙇
Yea, this project is quite complicated to be honest, 2 apps, 3 product flavors, etc. However, I am not sure why you were not able to use the Let me know if you can't find this screen. 🤔
👍 |
👋 @neeldoshii ! Just a note that the screenshot is not that accurate, the
So, the Does this make sense to you? 🙏
👍
Both the |
You are correct ✅. That was jetpack app from Playstore.
I am not sure how ❓, but for both Several tasks require a WordPress account login, which is currently not possible for contributors due to recent changes in the API. Therefore, I am un-assigning myself so others can tackle the remaining classes who has login access. |
👋 @neeldoshii and I am very 😞 about you not being able to test this functionality, most probably due to the login access, my apologies for that! 🫂
Makes sense to me, let's try and find you something else to work on! 🙏 |
Hi @ParaskP7 👋, |
Done, thanks @neeldoshii ! 🥇 |
Parent #18911
This issue is about adding replacing
findViewById(...)
with ViewBinding to as many Java-relatedDialogFragment
classes as possible.Instead of adding missing nullability annotations (
@Nullable
&@NonNull
) to layoutView
related fields on such Java-relatedDialogFragment
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.
Tasks (
libs/editor
)Tasks (
WordPress
+ui.people
)Tasks (
WordPress
+ui.posts
)Tasks (
WordPress
+ui.publicize
)Tasks (
WordPress
+ui
)Tasks (
WordPress
+widgets
)Tasks (
WordPress
+inner static
)The text was updated successfully, but these errors were encountered: