From b063294e604fb07eb909942aa17aba3e358753c8 Mon Sep 17 00:00:00 2001 From: Andras Kloczl Date: Tue, 3 Aug 2021 14:03:58 +0200 Subject: [PATCH] Follow up CL for controller navigation fix Fixing unresolved comment: http://shortn/_YCaiPNApNc Test: manual test with a game controller, check on both normal and two panel home Bug: 187205980 Change-Id: I8cae48effcce852c85273f16d1107dec90ff6f51 --- src/com/android/launcher3/PagedView.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index 242e3e3743..eb3f94ce7c 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -353,7 +353,7 @@ public abstract class PagedView extends ViewGrou } else if (focus == View.FOCUS_RIGHT) { nextPage = currentPage + panelCount; } else { - // no neighbours to those direction + // no neighbours to other directions return new IntSet(); } nextPage = validateNewPage(nextPage); @@ -362,12 +362,7 @@ public abstract class PagedView extends ViewGrou return new IntSet(); } - int pageCount = getPageCount(); - IntSet neighbourIndices = new IntSet(); - for (int page = nextPage; page < nextPage + panelCount && page < pageCount; page++) { - neighbourIndices.add(page); - } - return neighbourIndices; + return getPageIndices(nextPage); } /**