From 1cc5a67d82a555424fa3d22ff744434369060ea2 Mon Sep 17 00:00:00 2001 From: Alexander-- Date: Thu, 12 Mar 2020 05:29:37 +0659 Subject: [PATCH] Fix focus getting stuck by cycling within the same list item --- .../org/schabi/newpipe/views/SuperScrollLayoutManager.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/views/SuperScrollLayoutManager.java b/app/src/main/java/org/schabi/newpipe/views/SuperScrollLayoutManager.java index 3946b8435..25864b51d 100644 --- a/app/src/main/java/org/schabi/newpipe/views/SuperScrollLayoutManager.java +++ b/app/src/main/java/org/schabi/newpipe/views/SuperScrollLayoutManager.java @@ -98,6 +98,12 @@ public final class SuperScrollLayoutManager extends LinearLayoutManager { continue; } + if (view == focusedItem) { + // do not pass focus back to the item View itself - it makes no sense + // (we can still pass focus to it's children however) + continue; + } + int candidate = getDistance(sourcePosition, view, listDirection); if (candidate < 0) { continue;