Index: chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java |
index 9febad563f726d3872f8df111d604b1d16aa40e9..e3ab78c38a6787786983d8f00dcd5ed56f5d8513 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java |
@@ -724,7 +724,17 @@ public class ToolbarPhone extends ToolbarLayout |
// NewTabPage.OnSearchBoxScrollListener |
@Override |
public void onNtpScrollChanged(float scrollPercentage) { |
- if (scrollPercentage == mNtpSearchBoxScrollPercent) return; |
+ // TODO(peconn): Clear up the animation transition calculations so that the parts that |
+ // depend on the absolute scroll value (such as the Toolbar location) are separate from the |
+ // parts that depend on the fakebox transition percentage (such as the omnibox width and |
+ // opacity). |
+ // At the moment, we disable the check below because these two concepts are not |
+ // separate and we want to still update the parts that depend on scroll value when the |
+ // transition percentage is not changed. |
+ if (scrollPercentage == mNtpSearchBoxScrollPercent |
+ && !getToolbarDataProvider().getNewTabPageForCurrentTab().isCardsUiEnabled()) { |
+ return; |
+ } |
mNtpSearchBoxScrollPercent = scrollPercentage; |
updateUrlExpansionPercent(); |
@@ -873,7 +883,7 @@ public class ToolbarPhone extends ToolbarLayout |
mToolbarShadow.setAlpha(0f); |
float growthPercent = 0f; |
- if (mUrlExpansionPercent == 0f || mUrlExpansionPercent == 1f) { |
+ if (ntp.isCardsUiEnabled() || mUrlExpansionPercent == 0f || mUrlExpansionPercent == 1f) { |
growthPercent = 1f - mUrlExpansionPercent; |
} else { |
// During the transition from search box to omnibox, keep the omnibox drawing |