-
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] Replace findViewById
with ViewBinding
for Comments (relatively safe
)
#19217
Merged
AjeshRPai
merged 8 commits into
trunk
from
refactor/replace-findviewbyid-with-viewbinding-for-comments
Sep 21, 2023
Merged
[Nullability Annotations to Java Classes] Replace findViewById
with ViewBinding
for Comments (relatively safe
)
#19217
AjeshRPai
merged 8 commits into
trunk
from
refactor/replace-findviewbyid-with-viewbinding-for-comments
Sep 21, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is done in order to avoid using the 'if (mBinding != null) { ... }' check everywhere and only use that where absolutely necessary, which usually is only needed when a 'binding' is required via an SDK related '@OverRide' method, that is, it being the 'binding' starting point. FYI: This way, when this class gets converted to Kotlin (in the future), instead of using the 'binding' as a parameter to a method, the same method will get converted to a 'binding' extension function, and then, everything will become much more straightforward. For what is worth, this pattern is already used as such with Kotlin classes. For example, see 'PreviewImageFragment.kt' class and its 'initializeViews()' extension function.
Warnings: - "Deprecated member 'CommentsDetailActivity' is still used" - "'org.wordpress.android.ui.comments.CommentActions' is deprecated" - "'org.wordpress.android.ui.comments.unified.CommentsStoreAdapter' is deprecated" - "'org.wordpress.android.ui.comments.CommentDetailFragmentAdapter' is deprecated" - "'org.wordpress.android.ui.comments.CommentsDetailActivity' is deprecated"
FYI: 'nl-a' stands for 'nullable annotation'.
FYI: 'nl-a' stands for 'nullable annotation'.
FYI: 'nl-a' stands for 'nullable annotation'.
FYI: 'nl-a' stands for 'nullable annotation'.
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr19217-5953977 | |
Commit | 5953977 | |
Direct Download | wordpress-prototype-build-pr19217-5953977.apk |
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr19217-5953977 | |
Commit | 5953977 | |
Direct Download | jetpack-prototype-build-pr19217-5953977.apk |
AjeshRPai
approved these changes
Sep 21, 2023
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.
Hey @ParaskP7
The changes looks good to me and I have tested the Comment detail page in JP and WP. Everything is working as expected 👍🏼
Awesome, thanks for much for reviewing, testing and merging this @AjeshRPai , you rock! 🙇 ❤️ 🚀 |
12 tasks
12 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Parent #18906
This PR's main focus is to replace
findViewById
withViewBinding
for the CommentsDetailActivity.java class.Additionally, this PR is also dealing with adding any missing nullability annotations to this activity class, focusing mainly on its fields, and, any effected neighbour classes. But first, all existing warnings on this class are being resolved/suppressed so as to make it easier to deal with any missing nullability checks (with help from the IDE), especially when a
@Nullable
annotation is added.FYI: This change is
relatively safe
, meaning that although there are compile-time changes associated with this change, and it needs testing, the changes included in this PR are very targeted and specific to one screen, and one screen only. Thus, if this screen is tested appropriately, it should be safe to merge this totrunk
.PS: @AjeshRPai I added you as the main reviewer, randomly so, since I just wanted someone from the Jetpack/WordPress mobile team to be aware of and sign-off on that change for JP/WPAndroid. Feel free to merge this PR directly yourself if you deem so.
findViewById
->ViewBinding
Nullability Annotation List:
Warnings Suppression List:
To test:
Comment Details Screen [CommentsDetailActivity.java]
ℹ️ This test applies to both, the
Jetpack
andWordPress
app.Comments
screen and tap on any comment.Comment Details
screen is shown and functioning as expected.Regression Notes
Potential unintended areas of impact
What I did to test those areas of impact (or what existing automated tests I relied on)
To test
section above.What automated tests I added (or what prevented me from doing so)
PR submission checklist:
RELEASE-NOTES.txt
if necessary.UI Changes testing checklist: