From b6b19b474eba23369b5250c250ab7fe7e8adbef2 Mon Sep 17 00:00:00 2001 From: TacoTheDank Date: Tue, 19 Oct 2021 17:31:59 -0400 Subject: [PATCH] Update RecyclerView & Groupie --- app/build.gradle | 7 +++++-- .../schabi/newpipe/fragments/list/BaseListFragment.java | 2 +- .../newpipe/fragments/list/search/SearchFragment.java | 4 ++-- .../newpipe/local/playlist/LocalPlaylistFragment.java | 4 ++-- .../local/subscription/dialog/FeedGroupReorderDialog.kt | 4 ++-- .../player/playqueue/PlayQueueItemTouchCallback.java | 2 +- .../newpipe/settings/PeertubeInstanceListFragment.java | 6 +++--- .../schabi/newpipe/settings/tabs/ChooseTabsFragment.java | 6 +++--- 8 files changed, 19 insertions(+), 16 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 970cfa89d..f13483012 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -107,7 +107,7 @@ ext { icepickVersion = '3.2.0' exoPlayerVersion = '2.12.3' googleAutoServiceVersion = '1.0' - groupieVersion = '2.9.0' + groupieVersion = '2.10.0' markwonVersion = '4.6.2' leakCanaryVersion = '2.5' @@ -211,11 +211,14 @@ dependencies { implementation 'androidx.media:media:1.4.2' implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.preference:preference:1.1.1' - implementation 'androidx.recyclerview:recyclerview:1.1.0' + implementation 'androidx.recyclerview:recyclerview:1.2.1' implementation "androidx.room:room-runtime:${androidxRoomVersion}" implementation "androidx.room:room-rxjava3:${androidxRoomVersion}" kapt "androidx.room:room-compiler:${androidxRoomVersion}" implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' + // Newer version specified to prevent accessibility regressions with RecyclerView, see: + // https://developer.android.com/jetpack/androidx/releases/viewpager2#1.1.0-alpha01 + implementation 'androidx.viewpager2:viewpager2:1.1.0-beta01' implementation 'androidx.webkit:webkit:1.4.0' implementation 'com.google.android.material:material:1.2.1' diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListFragment.java index c30b6fc05..037eb8f94 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListFragment.java @@ -143,7 +143,7 @@ public abstract class BaseListFragment extends BaseStateFragment final View focusedItem = itemsList.getFocusedChild(); final RecyclerView.ViewHolder itemHolder = itemsList.findContainingViewHolder(focusedItem); - return itemHolder.getAdapterPosition(); + return itemHolder.getBindingAdapterPosition(); } catch (final NullPointerException e) { return -1; } diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java index 7de212383..d4d73f74f 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java @@ -1088,7 +1088,7 @@ public class SearchFragment extends BaseListFragment