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

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

Issue 396863003: [Android] Always show infobars at the bottom of the screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added back areInfoBarsOnTop to prevent downstream breakage Created 6 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 | 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 cb2e07302debc9be7823cc35fbd7b8b402f9dafe..3e71ebda91cad38fbd1a539f32f32ccac130979a 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
@@ -124,7 +124,6 @@ public class AnimationHelper implements ViewTreeObserver.OnGlobalLayoutListener
if (mAnimationStarted) return;
mAnimationStarted = true;
- boolean infoBarsOnTop = mContainer.areInfoBarsOnTop();
int indexOfWrapperView = mContainer.indexOfChild(mTargetWrapperView);
assert indexOfWrapperView != -1;
@@ -136,16 +135,14 @@ public class AnimationHelper implements ViewTreeObserver.OnGlobalLayoutListener
int cumulativeTopStart = 0;
int cumulativeTopEnd = 0;
int cumulativeEndHeight = 0;
- if (!infoBarsOnTop) {
- if (heightDifference >= 0) {
- // The current container is smaller than the final container, so the current 0
- // coordinate will be >= 0 in the final container.
- cumulativeTopStart = heightDifference;
- } else {
- // The current container is bigger than the final container, so the current 0
- // coordinate will be < 0 in the final container.
- cumulativeTopEnd = -heightDifference;
- }
+ if (heightDifference >= 0) {
+ // The current container is smaller than the final container, so the current 0
+ // coordinate will be >= 0 in the final container.
+ cumulativeTopStart = heightDifference;
+ } else {
+ // The current container is bigger than the final container, so the current 0
+ // coordinate will be < 0 in the final container.
+ cumulativeTopEnd = -heightDifference;
}
for (int i = 0; i < mContainer.getChildCount(); ++i) {
@@ -169,13 +166,12 @@ public class AnimationHelper implements ViewTreeObserver.OnGlobalLayoutListener
} else {
// A translation is required to move the View into place.
int translation = heightDifference;
- if (infoBarsOnTop) translation *= -1;
- boolean translateDownward = false;
+ boolean translateDownward;
if (topStart < topEnd) {
- translateDownward = infoBarsOnTop;
+ translateDownward = false;
} else if (topStart > topEnd) {
- translateDownward = !infoBarsOnTop;
+ translateDownward = true;
} else {
translateDownward = bottomEnd > bottomStart;
}
@@ -204,28 +200,16 @@ public class AnimationHelper implements ViewTreeObserver.OnGlobalLayoutListener
// Lock the InfoBarContainer's size at its largest during the animation to avoid
// clipping issues.
- final int oldContainerTop = mContainer.getTop();
- final int oldContainerBottom = mContainer.getBottom();
- final int newContainerTop;
- final int newContainerBottom;
- if (infoBarsOnTop) {
- newContainerTop = oldContainerTop;
- newContainerBottom = newContainerTop + cumulativeEndHeight;
- } else {
- newContainerBottom = oldContainerBottom;
- newContainerTop = newContainerBottom - cumulativeEndHeight;
- }
- final int biggestContainerTop = Math.min(oldContainerTop, newContainerTop);
- final int biggestContainerBottom = Math.max(oldContainerBottom, newContainerBottom);
+ int oldContainerTop = mContainer.getTop();
+ int newContainerTop = mContainer.getBottom() - cumulativeEndHeight;
+ int biggestContainerTop = Math.min(oldContainerTop, newContainerTop);
mContainer.setTop(biggestContainerTop);
- mContainer.setBottom(biggestContainerBottom);
// Set up and run all of the animations.
mAnimatorSet.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
mTargetWrapperView.startTransition();
- mContainer.startTransition();
}
@Override
« 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