From dde3f451431b8d5a26dc16c2ee9aee9f9c966c85 Mon Sep 17 00:00:00 2001 From: Petros Paraskevopoulos Date: Thu, 9 Feb 2023 14:26:18 +0200 Subject: [PATCH] Analysis: Suppress recyclerview adapter position deprecation warning This started appearing because, as part of the 'ExoPlayer' update to '2.18.1', its transient 'RecyclerView' dependency got updated as well, from '1.1.0' to '1.2.1', which caused this deprecation warning. Warning Message: "'getter for adapterPosition: Int' is deprecated. Deprecated in Java" 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." This deprecated warning is suppressed, that is, instead of being resolved, since a resolution is out of the scope of this 'ExoPlayer' update. For more info see: - RecyclerView.ViewHolder#getAdapterPosition (Doc): https://developer.android.com/reference/androidx/recyclerview/widget/ RecyclerView.ViewHolder#getAdapterPosition() --- .../org/wordpress/android/ui/avatars/TrailingLabelViewHolder.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/avatars/TrailingLabelViewHolder.kt b/WordPress/src/main/java/org/wordpress/android/ui/avatars/TrailingLabelViewHolder.kt index 4f069d9313af..b2eeca87528f 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/avatars/TrailingLabelViewHolder.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/avatars/TrailingLabelViewHolder.kt @@ -14,6 +14,7 @@ class TrailingLabelViewHolder( parent: ViewGroup, private val uiHelpers: UiHelpers ) : TrainOfAvatarsViewHolder(parent.viewBinding(TrailingLabelItemBinding::inflate)) { + @Suppress("DEPRECATION") fun bind(textItem: TrailingLabelTextItem) = with(binding) { val position = adapterPosition