From dcb99856f93f09cc5445a57ef6a6078748f1173f Mon Sep 17 00:00:00 2001 From: Gabriel Luong Date: Mon, 31 Aug 2020 11:14:37 -0400 Subject: [PATCH] For #13264 - Scroll to the tab above the selected tab in the tabs tray (#14372) --- app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt b/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt index 4963c044e..b45b9332b 100644 --- a/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt +++ b/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt @@ -543,9 +543,11 @@ class TabTrayView( // We offset the tab index by the number of items in the other adapters. // We add the offset, because the layoutManager is initialized with `reverseLayout`. + // We also add 1 to display the tab item above the selected browser tab. val recyclerViewIndex = selectedBrowserTabIndex + collectionsButtonAdapter.itemCount + - syncedTabsController.adapter.itemCount + syncedTabsController.adapter.itemCount + + 1 layoutManager?.scrollToPosition(recyclerViewIndex) }