Commit 2a20c1c6 authored by Ryan Landay's avatar Ryan Landay Committed by Commit Bot

Fix swiping down from toolbar to show current tab in new Android tab switcher

We previously had a behavior in the new Android horizontal tab switcher where
opening the tab switcher would show the previous tab instead of the current one.
I previously landed a CL to remove this behavior, but swiping down from the
toolbar is still showing the previous tab. It turns out there's a totally
separate piece of pre-existing logic that, together with the scroll snapping,
is actually causing swiping down from the toolbar to still go to the previous
tab. We of course did not notice this prior to removing the "show previous tab"
behavior.

This CL fixes this pre-existing logic to not show the previous tab.

Bug: 849480,831359
Change-Id: I0b89f87e536c5d4938638fbd6ac7fabde568e772
Reviewed-on: https://chromium-review.googlesource.com/1091230Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Commit-Queue: Ryan Landay <rlanday@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565372}
parent d528644c
...@@ -2082,7 +2082,8 @@ public abstract class Stack { ...@@ -2082,7 +2082,8 @@ public abstract class Stack {
// Update the scroll offset to put the focused tab at the top. // Update the scroll offset to put the focused tab at the top.
final int index = mTabList.index(); final int index = mTabList.index();
if (mCurrentMode == Orientation.PORTRAIT) { if (mCurrentMode == Orientation.PORTRAIT
|| ChromeFeatureList.isEnabled(ChromeFeatureList.HORIZONTAL_TAB_SWITCHER_ANDROID)) {
mScrollOffset = -index * mSpacing; mScrollOffset = -index * mSpacing;
} else { } else {
mScrollOffset = -index * mSpacing + x - LANDSCAPE_SWIPE_DRAG_TAB_OFFSET_DP; mScrollOffset = -index * mSpacing + x - LANDSCAPE_SWIPE_DRAG_TAB_OFFSET_DP;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment