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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/widget/DualControlLayout.java

Issue 2256653002: Change password update infobar design according to current mocks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unused variables Created 4 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
Index: chrome/android/java/src/org/chromium/chrome/browser/widget/DualControlLayout.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/DualControlLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/DualControlLayout.java
index 19453f8502711452f076132f81b8d9d13d570b05..f6cafda68935a2cd9fef03243891ea5aa1e74c59 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/widget/DualControlLayout.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/DualControlLayout.java
@@ -147,8 +147,10 @@ public final class DualControlLayout extends ViewGroup {
if (mSecondaryView != null) {
// Measure the secondary View, allowing it to be as wide as the layout.
measureChild(mSecondaryView, unspecifiedSpec, unspecifiedSpec);
- int combinedWidth = mPrimaryView.getMeasuredWidth()
- + mHorizontalMarginBetweenViews + mSecondaryView.getMeasuredWidth();
+ int combinedWidth = mPrimaryView.getMeasuredWidth() + mSecondaryView.getMeasuredWidth();
+ if (mPrimaryView.getMeasuredWidth() > 0 && mSecondaryView.getMeasuredWidth() > 0) {
+ combinedWidth += mHorizontalMarginBetweenViews;
+ }
if (combinedWidth > maxWidth) {
// Stack the Views on top of each other.
@@ -214,11 +216,17 @@ public final class DualControlLayout extends ViewGroup {
secondaryRight = secondaryLeft + mSecondaryView.getMeasuredWidth();
} else if (isPrimaryOnRight) {
// Sit to the left of the primary View.
- secondaryRight = primaryLeft - mHorizontalMarginBetweenViews;
+ secondaryRight = primaryLeft;
+ if (mPrimaryView.getMeasuredWidth() > 0) {
+ secondaryRight -= mHorizontalMarginBetweenViews;
+ }
secondaryLeft = secondaryRight - mSecondaryView.getMeasuredWidth();
} else {
// Sit to the right of the primary View.
- secondaryLeft = primaryRight + mHorizontalMarginBetweenViews;
+ secondaryLeft = primaryRight;
+ if (mPrimaryView.getMeasuredWidth() > 0) {
+ secondaryLeft += mHorizontalMarginBetweenViews;
+ }
secondaryRight = secondaryLeft + mSecondaryView.getMeasuredWidth();
}

Powered by Google App Engine
This is Rietveld 408576698