Index: chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableListToolbar.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableListToolbar.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableListToolbar.java |
index add383a00e074c0475685968f909d117e7715398..bb4de561915f2b02d17dd6400ea7c7700a083755 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableListToolbar.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableListToolbar.java |
@@ -363,6 +363,8 @@ public class SelectableListToolbar<E> extends Toolbar implements SelectionObserv |
setNavigationIcon(iconResId); |
} |
setNavigationContentDescription(contentDescriptionId); |
+ |
+ updateDisplayStyleIfNecessary(); |
} |
/** |
@@ -387,6 +389,8 @@ public class SelectableListToolbar<E> extends Toolbar implements SelectionObserv |
public void hideSearchView() { |
assert mHasSearchView; |
+ if (!mIsSearching) return; |
+ |
gone
2017/05/02 17:49:48
no newline?
Theresa
2017/05/02 18:15:25
I like new lines after early returns. I removed th
|
mIsSearching = false; |
mSearchEditText.setText(""); |
@@ -434,6 +438,7 @@ public class SelectableListToolbar<E> extends Toolbar implements SelectionObserv |
* |
* @param wideDisplayLateralOffsetPx The offset to use for the lateral padding when in |
* {@link HorizontalDisplayStyle#WIDE}. |
+ * @param uiConfig The UiConfig used to observe display style changes. |
*/ |
public void setHasWideDisplayStyle(int wideDisplayLateralOffsetPx, UiConfig uiConfig) { |
mWideDisplayLateralOffsetPx = wideDisplayLateralOffsetPx; |
@@ -464,7 +469,8 @@ public class SelectableListToolbar<E> extends Toolbar implements SelectionObserv |
// The title and nav buttons are inset in the normal display style. In the wide display |
// style they should be aligned with the starting edge of the list elements. |
- if (mIsSearching || mIsSelectionEnabled) { |
+ if (mIsSearching || mIsSelectionEnabled |
+ || mNavigationButton != NAVIGATION_BUTTON_NONE) { |
paddingStartOffset += mWideDisplayNavButtonOffsetPx; |
} else { |
paddingStartOffset -= mDefaultTitleMarginStartPx; |