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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelAnimation.java

Issue 1337703002: [Contextual Search] Add support for crushed sprites and animate the search provider icon (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 3 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
Index: chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelAnimation.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelAnimation.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelAnimation.java
index e7bc0248909ab15ac931d0a3570c438a1b471d1a..d3c64df590a214aca041556bf403949948384822 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelAnimation.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelAnimation.java
@@ -29,7 +29,8 @@ public abstract class ContextualSearchPanelAnimation extends ContextualSearchPan
protected enum Property {
PANEL_HEIGHT,
PROMO_VISIBILITY,
- BOTTOM_BAR_TEXT_VISIBILITY
+ BOTTOM_BAR_TEXT_VISIBILITY,
+ SEARCH_PROVIDER_ICON_ANIMATION
}
/**
@@ -227,6 +228,16 @@ public abstract class ContextualSearchPanelAnimation extends ContextualSearchPan
}
/**
+ * Animates the search provider icon. This should only be called once the panel open
+ * animation has finished.
+ */
+ private void animateSearchProviderIcon() {
+ setIsSearchProviderIconSpriteVisible(true);
+ animateProperty(Property.SEARCH_PROVIDER_ICON_ANIMATION, 0.f, 1.f,
+ MAXIMUM_ANIMATION_DURATION_MS);
+ }
+
+ /**
* Animates the Panel to its nearest state.
*/
protected void animateToNearestState() {
@@ -379,6 +390,8 @@ public abstract class ContextualSearchPanelAnimation extends ContextualSearchPan
setPromoVisibilityForOptInAnimation(value);
} else if (prop == Property.BOTTOM_BAR_TEXT_VISIBILITY) {
updateSearchBarTextOpacity(value);
+ } else if (prop == Property.SEARCH_PROVIDER_ICON_ANIMATION) {
+ setSearchProviderIconAnimationCompletion(value);
}
}
@@ -426,6 +439,14 @@ public abstract class ContextualSearchPanelAnimation extends ContextualSearchPan
mIsAnimatingPanelClosing = false;
}
+ PanelState state = getPanelState();
+ if (mAnimatingState == PanelState.PEEKED
+ && (state == PanelState.CLOSED || state == PanelState.UNDEFINED)) {
+ if (shouldAnimateSearchProviderIconSprite()) {
+ animateSearchProviderIcon();
+ }
+ }
+
// If animating to a particular PanelState, and after completing
// resizing the Panel to its desired state, then the Panel's state
// should be updated. This method also is called when an animation

Powered by Google App Engine
This is Rietveld 408576698