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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/infobar/AnimationHelper.java

Issue 487273004: Make InfobarContainer scrollable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed custom drawChild logic Created 6 years, 4 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 | chrome/android/java/src/org/chromium/chrome/browser/infobar/ContentWrapperView.java » ('j') | 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/infobar/AnimationHelper.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/AnimationHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/AnimationHelper.java
index 3e71ebda91cad38fbd1a539f32f32ccac130979a..7848fa5c02432342b72025786bb5b02a189c0c4f 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/AnimationHelper.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/AnimationHelper.java
@@ -13,6 +13,7 @@ import android.os.Build;
import android.view.View;
import android.view.ViewTreeObserver;
import android.view.animation.AccelerateDecelerateInterpolator;
+import android.widget.LinearLayout;
import org.chromium.base.ApiCompatibilityUtils;
@@ -45,6 +46,7 @@ public class AnimationHelper implements ViewTreeObserver.OnGlobalLayoutListener
public static final int ANIMATION_TYPE_BOUNDARY = 3;
private final InfoBarContainer mContainer;
+ private final LinearLayout mLinearLayout;
private final InfoBar mInfoBar;
private final ContentWrapperView mTargetWrapperView;
private final AnimatorSet mAnimatorSet;
@@ -66,12 +68,13 @@ public class AnimationHelper implements ViewTreeObserver.OnGlobalLayoutListener
public AnimationHelper(InfoBarContainer container, ContentWrapperView target, InfoBar infoBar,
View toShow, int animationType) {
mContainer = container;
+ mLinearLayout = container.getLinearLayout();
mInfoBar = infoBar;
mTargetWrapperView = target;
mAnimatorSet = new AnimatorSet();
mAnimationType = animationType;
mToShow = toShow;
- assert mContainer.indexOfChild(mTargetWrapperView) != -1;
+ assert mLinearLayout.indexOfChild(mTargetWrapperView) != -1;
}
/**
@@ -124,7 +127,7 @@ public class AnimationHelper implements ViewTreeObserver.OnGlobalLayoutListener
if (mAnimationStarted) return;
mAnimationStarted = true;
- int indexOfWrapperView = mContainer.indexOfChild(mTargetWrapperView);
+ int indexOfWrapperView = mLinearLayout.indexOfChild(mTargetWrapperView);
assert indexOfWrapperView != -1;
ArrayList<Animator> animators = new ArrayList<Animator>();
@@ -145,8 +148,8 @@ public class AnimationHelper implements ViewTreeObserver.OnGlobalLayoutListener
cumulativeTopEnd = -heightDifference;
}
- for (int i = 0; i < mContainer.getChildCount(); ++i) {
- View view = mContainer.getChildAt(i);
+ for (int i = 0; i < mLinearLayout.getChildCount(); ++i) {
+ View view = mLinearLayout.getChildAt(i);
// At this point, the View being transitioned in shouldn't have been added to the
// visible container, yet, and shouldn't affect calculations.
@@ -200,10 +203,10 @@ public class AnimationHelper implements ViewTreeObserver.OnGlobalLayoutListener
// Lock the InfoBarContainer's size at its largest during the animation to avoid
// clipping issues.
- int oldContainerTop = mContainer.getTop();
- int newContainerTop = mContainer.getBottom() - cumulativeEndHeight;
+ int oldContainerTop = mLinearLayout.getTop();
+ int newContainerTop = mLinearLayout.getBottom() - cumulativeEndHeight;
int biggestContainerTop = Math.min(oldContainerTop, newContainerTop);
- mContainer.setTop(biggestContainerTop);
+ mLinearLayout.setTop(biggestContainerTop);
// Set up and run all of the animations.
mAnimatorSet.addListener(new AnimatorListenerAdapter() {
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/infobar/ContentWrapperView.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698