Commit 57c20b97 authored by Jinsuk Kim's avatar Jinsuk Kim Committed by Commit Bot

Ensures action mode toolbar is hidden on tab change

This CL fixes a bug that removes tab strip upon
opening a new tab while text selection is made on tablets.
Made sure the action mode toolbar gets animated out
(if present) before new tab gets opened.

Bug: 807712
Change-Id: Icba04263d836733595696f12063c3b47afd314f0
Reviewed-on: https://chromium-review.googlesource.com/952602
Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Reviewed-by: default avatarYusuf Ozuysal <yusufo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541615}
parent b263b51b
...@@ -174,6 +174,7 @@ public class ActionModeController { ...@@ -174,6 +174,7 @@ public class ActionModeController {
* Hide animation for the textview if the action bar is not visible. * Hide animation for the textview if the action bar is not visible.
*/ */
public void startHideAnimation() { public void startHideAnimation() {
if (!mShowingActionMode) return;
if (mCurrentAnimation != null) mCurrentAnimation.cancel(); if (mCurrentAnimation != null) mCurrentAnimation.cancel();
mCurrentAnimation = ObjectAnimator.ofInt(mActionBarDelegate, TOP_MARGIN_ANIM_PROPERTY, mCurrentAnimation = ObjectAnimator.ofInt(mActionBarDelegate, TOP_MARGIN_ANIM_PROPERTY,
......
...@@ -1246,6 +1246,12 @@ public class ToolbarManager implements ToolbarTabController, UrlFocusChangeListe ...@@ -1246,6 +1246,12 @@ public class ToolbarManager implements ToolbarTabController, UrlFocusChangeListe
mToolbarModel.setTab(tab, isIncognito); mToolbarModel.setTab(tab, isIncognito);
updateCurrentTabDisplayStatus(); updateCurrentTabDisplayStatus();
// This method is called prior to action mode destroy callback for incognito <-> normal
// tab switch. Makes sure the action mode toolbar is hidden before selecting the new tab.
if (previousTab != null && wasIncognito != isIncognito && DeviceFormFactor.isTablet()) {
mActionModeController.startHideAnimation();
}
if (previousTab != tab || wasIncognito != isIncognito) { if (previousTab != tab || wasIncognito != isIncognito) {
if (previousTab != tab) { if (previousTab != tab) {
if (previousTab != null) { if (previousTab != null) {
......
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