[Dependency Updates] Update androidxRecyclerviewVersion to 1.2.1#17952
Merged
[Dependency Updates] Update androidxRecyclerviewVersion to 1.2.1#17952
androidxRecyclerviewVersion to 1.2.1#17952Conversation
It is generally recommended that transitively used dependencies should be declared directly.
Release Notes: https://developer.android.com/jetpack/androidx/releases/ recyclerview#recyclerview-1.2.1 ------------------------------------------------------------------------ Note that this update adds the following 'Adapter Position' specific warnings that need to be resolved in order for this project to compile again due to the 'allWarningsAsErrors' flag. Per module, the number of warnings and their corresponding classes are: - 'image-editor' module (1): - PreviewImageViewHolder.kt (1) - 'WordPress' module (23): - TrailingLabelViewHolder.kt (1) - UsernameChangerRecyclerViewAdapter.java (1) - SitePickerAdapter.java (3) - MediaGridAdapter.java (6) - PeopleListFragment.java (1) - PluginBrowserActivity.java (1) - PluginListFragment.java (1) - MultiSelectRecyclerViewAdapter.java (1) - SiteSettingsTagListActivity.java (1) - PublicizeAccountChooserListAdapter.java (1) - ReaderBlogAdapter.java (1) - ReaderCommentAdapter.java (1) - ReaderPostAdapter.java (1) - ReaderSiteSearchAdapter.java (1) - StockMediaPickerActivity.java (2) As such, all the above listed modules, classes and their warnings need to be migrated to the new 'Adapter Position' APIs. All that is going to be done in subsequent commits. For more info see: - Release Notes (1.2.0): https://developer.android.com/jetpack/androidx/ releases/recyclerview#recyclerview-1.2.0 - RecyclerView.ViewHolder#getAdapterPosition (Doc): https://developer.android.com/reference/androidx/recyclerview/widget/ RecyclerView.ViewHolder#getAdapterPosition() ------------------------------------------------------------------------ Also, as part of the '1.2.0-alpha02' it seems that this and higher versions of RecyclerView are not compatible with lower versions of ViewPager2. The recommendation is to update to newer version of 'View Pager 2', the '1.1.0-alpha01' or above. - Release Notes (1.2.0-alpha02): https://developer.android.com/jetpack/ androidx/releases/recyclerview#recyclerview-1.2.0-alpha02 This seems to means that updating 'Recycler View' to '1.2.1' might mean that 'View Pager 2' needs to be update to '1.1.0' as well. However, it seems that the newest version of 'View Pager 2' is the '1.1.0-beta01', and that has been this way since August 3, 2021. This means that there is no production ready version of 'View Pager 2' so far, and more so, that this library might have been abandoned. Also, the fact that the '1.2.1' release notes don't suggest this update might also mean that this requirement is no longer applicable, that is, at least on newer, post alpha releases of 'Recycler View'. - View Pager 2: https://developer.android.com/jetpack/androidx/releases/ viewpager2
Warning Messages: - "'getAdapterPosition()' is deprecated" Explanation: "This method is confusing when adapters nest other adapters. If you are calling this in the context of an Adapter, you probably want to call 'getBindingAdapterPosition' or if you want the position as 'RecyclerView' sees it, you should call 'getAbsoluteAdapterPosition'." ------------------------------------------------------------------------ If those deprecation warnings were left unresolved, the 'getAdapterPosition()' method will anyway redirect the call to 'getBindingAdapterPosition()'. As such, it is better to be explicit now and call this newly added 'getBindingAdapterPosition()' API directly, and only change that to 'getAbsoluteAdapterPosition()' if and whenever necessary. ------------------------------------------------------------------------ For more info see: - RecyclerView.ViewHolder#getAdapterPosition (Doc): https://developer.android.com/reference/androidx/recyclerview/widget/ RecyclerView.ViewHolder#getAdapterPosition()
Contributor
|
Found 1 violations: The PR caused the following dependency changes: +--- project :libs:analytics
| \--- androidx.preference:preference:1.1.0
-| \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.1.0
-| +--- androidx.annotation:annotation:1.1.0 -> 1.3.0
-| +--- androidx.core:core:1.1.0 -> 1.8.0 (*)
-| +--- androidx.customview:customview:1.0.0 -> 1.1.0 (*)
-| \--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)
+| \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.2.1
+| +--- androidx.annotation:annotation:1.1.0 -> 1.3.0
+| +--- androidx.core:core:1.3.2 -> 1.8.0 (*)
+| +--- androidx.customview:customview:1.0.0 -> 1.1.0 (*)
+| \--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)
+--- project :libs:image-editor
+| +--- androidx.recyclerview:recyclerview:1.2.1 (*)
| +--- androidx.viewpager2:viewpager2:1.0.0
-| | \--- androidx.recyclerview:recyclerview:1.1.0 (*)
+| | \--- androidx.recyclerview:recyclerview:1.1.0 -> 1.2.1 (*)
| +--- com.google.android.material:material:1.2.1 -> 1.6.0-alpha01
-| | \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.1.0 (*)
+| | \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.2.1 (*)
+--- project :libs:editor
| \--- org.wordpress-mobile.gutenberg-mobile:react-native-gutenberg-bridge:v1.88.0
| +--- com.github.wordpress-mobile:react-native-video:5.2.0-wp-5
| | \--- com.google.android.exoplayer:exoplayer:2.13.3
| | \--- com.google.android.exoplayer:exoplayer-ui:2.13.3
-| | \--- androidx.recyclerview:recyclerview:1.1.0 (*)
+| | \--- androidx.recyclerview:recyclerview:1.1.0 -> 1.2.1 (*)
| \--- org.wordpress-mobile.gutenberg-mobile:react-native-aztec:v1.88.0
-| \--- androidx.recyclerview:recyclerview:1.1.0 (*)
+| \--- androidx.recyclerview:recyclerview:1.1.0 -> 1.2.1 (*)
+--- org.wordpress:fluxc:{strictly 2657-77f6e8b4af256b762d0c1482a9347ccf9fb4820e} -> 2657-77f6e8b4af256b762d0c1482a9347ccf9fb4820e
| +--- androidx.paging:paging-runtime:2.1.2
-| | \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.1.0 (*)
+| | \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.2.1 (*)
-| \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.1.0 (*)
+| \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.2.1 (*)
+--- org.wordpress:utils:{strictly 3.2.0} -> 3.2.0
-| \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.1.0 (*)
+| \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.2.1 (*)
+--- com.automattic:stories:2.0.0
-| \--- androidx.recyclerview:recyclerview:1.1.0 (*)
+| \--- androidx.recyclerview:recyclerview:1.1.0 -> 1.2.1 (*)
-+--- androidx.recyclerview:recyclerview:1.0.0 -> 1.1.0 (*)
++--- androidx.recyclerview:recyclerview:1.2.1 (*)
\--- com.zendesk:support:5.0.2
+--- com.zendesk:guide:1.0.1
- | \--- androidx.recyclerview:recyclerview -> 1.1.0 (*)
+ | \--- androidx.recyclerview:recyclerview -> 1.2.1 (*)
- \--- androidx.recyclerview:recyclerview -> 1.1.0 (*)
+ \--- androidx.recyclerview:recyclerview -> 1.2.1 (*)
Please review and act accordingly
|
Contributor
|
|||||||||||
| 💡 Scan this QR code with your Android phone to download and install the APK directly on it. | ||
| App | WordPress | |
| Build Flavor | Jalapeno | |
| Build Type | Debug | |
| Commit | fd073d8 | |
Contributor
|
|||||||||||
| 💡 Scan this QR code with your Android phone to download and install the APK directly on it. | ||
| App | Jetpack | |
| Build Flavor | Jalapeno | |
| Build Type | Debug | |
| Commit | fd073d8 | |
5 tasks
AjeshRPai
approved these changes
Feb 14, 2023
Contributor
AjeshRPai
left a comment
There was a problem hiding this comment.
Hey @ParaskP7
Everything looks good to me.I have tested the app by keeping the adapters listed below in mind. 🟢
- image-editor module
- PreviewImageViewHolder.kt
- WordPress module:
- TrailingLabelViewHolder.kt
- UsernameChangerRecyclerViewAdapter.java
- SitePickerAdapter.java
- MediaGridAdapter.java
- PeopleListFragment.java
- PluginBrowserActivity.java
- PluginListFragment.java
- MultiSelectRecyclerViewAdapter.java
- SiteSettingsTagListActivity.java
- PublicizeAccountChooserListAdapter.java
- ReaderBlogAdapter.java\
- ReaderCommentAdapter.java
- ReaderPostAdapter.java
- ReaderSiteSearchAdapter.java
- StockMediaPickerActivity.java
I have tested the recycler view behaviours 🟢
- Scroll state works as expected
- Diff works as expected
- Clicking on the items works as expected
I have also looked for any places where we want to replace getBindingAdapterPosition()
with getAbsoluteAdapterPosition() .I couldn't see any
I am approving but not merging this PR so that anyone from @wordpress-mobile/apps-infrastructure can have a look. Please go ahead and merge at your convenience
Contributor
Author
|
Woohoo, you are awesome @AjeshRPai , thank you so much for reviewing and testing this, choo choo the trains goes, the rocket launches, the PR merge triggers! 🚂 🚀 :pr-merge: 🙇 ❤️ |
This file contains hidden or 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
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 #17566
This PR update
androidxRecyclerviewVersionto 1.2.1.Also, as part of this update the below transitive dependencies were added:
Image Editormodule (4131c6d):androidx.recyclerview:recyclerviewIn addition to the dependency update commits, one more additional analysis related commit was added to resolve the
Adapter Positiondeprecation on theandroidx.recyclerviewlibrary itself (fd073d8).PS: @AjeshRPai I added you as the main reviewer, that is, in addition to the @wordpress-mobile/apps-infrastructure team itself, but randomly, since I just wanted someone from the WordPress team to be aware of and sign-off on that change for WPAndroid.
To test:
getAdapterPosition()got explicitly replaced withgetBindingAdapterPosition(), maybe focusing on those screens first might be better:Adapter Position to Binding Adapter Position
image-editormodule:WordPressmodule:PS: During testing, if you notice any inconsistency you might want to replace
getBindingAdapterPosition()withgetAbsoluteAdapterPosition()and test again.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 testsection.What automated tests I added (or what prevented me from doing so)
PR submission checklist:
RELEASE-NOTES.txtif necessary.