Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2098)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java

Issue 2121283002: Reset translation of toolbar_buttons for Url Defocus Animation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 003b5cc31fdc17f9cbaf41749d806692612fb625..6b1cd17da9b07d795852f2017c32abedcb2b4c94 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
@@ -1714,6 +1714,16 @@ public class ToolbarPhone extends ToolbarLayout
public void onUrlFocusChange(final boolean hasFocus) {
super.onUrlFocusChange(hasFocus);
+ // https://crbug.com/623885: The mToolbarButtonsContainer has its translationY modified
+ // during scroll so when the user scrolls on the NTP, it appears to scroll too. However
+ // during the URL focus and defocus animations it should not be touched. Unfortunately
+ // updateNtpTransitionAnimation() is called a few times after the URL focus animation has
+ // been completed while mUrlFocusChangeInProgress is set to false, causing translationY to
+ // non-zero at the end.
+ // We reset the translationY here so the mToolbarButtonsContainer is on screen for the
+ // defocusing animation.
+ mToolbarButtonsContainer.setTranslationY(0f);
+
triggerUrlFocusAnimation(hasFocus);
TransitionDrawable shadowDrawable = (TransitionDrawable) mToolbarShadow.getDrawable();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698