Bug 1414309 - Tell ToolbarEditLayout's title background about private mode changes. r=nechen
authorJan Henning <jh+bugzilla@buttercookie.de>
Fri, 22 Dec 2017 19:46:20 +0100
changeset 449594 da52ff7129ad5c91aedc1f81a0a916aece58e361
parent 449593 0bf62601f709d0619e221f3229f148ffc2cc061b
child 449595 73863c493315ec5b769c4db4c1e07b7382c12862
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnechen
bugs1414309
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1414309 - Tell ToolbarEditLayout's title background about private mode changes. r=nechen The background is enabled when using a theme to increase readability of the URL, but disabled in private mode, because we don't show the theme while in private mode. However for the latter feature to work, the respective layout needs to be told about the private mode state of the toolbar in the first place. We did this for the ToolbarDisplayLayout, but had forgotten the ToolbarEditLayout. MozReview-Commit-ID: 3GAesHvwDEX
mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java
--- a/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java
+++ b/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditLayout.java
@@ -49,16 +49,17 @@ import java.util.List;
 */
 public class ToolbarEditLayout extends ThemedLinearLayout {
 
     public interface OnSearchStateChangeListener {
         public void onSearchStateChange(boolean isActive);
     }
 
     private final ToolbarEditText mEditText;
+    private final ThemedLinearLayout mThemeBackground;
 
     private final ThemedImageButton mSearchIcon;
     private final ThemedImageButton mVoiceInput;
     private final ThemedImageButton mQrCode;
 
     private OnFocusChangeListener mFocusChangeListener;
 
     private boolean showKeyboardOnFocus = false; // Indicates if we need to show the keyboard after the app resumes
@@ -66,16 +67,17 @@ public class ToolbarEditLayout extends T
     public ToolbarEditLayout(Context context, AttributeSet attrs) {
         super(context, attrs);
 
         setOrientation(HORIZONTAL);
 
         LayoutInflater.from(context).inflate(R.layout.toolbar_edit_layout, this);
 
         mEditText = (ToolbarEditText) findViewById(R.id.url_edit_text);
+        mThemeBackground = (ThemedLinearLayout) findViewById(R.id.url_bar_title_bg);
 
         mSearchIcon = (ThemedImageButton) findViewById(R.id.search_icon);
         mVoiceInput = (ThemedImageButton) findViewById(R.id.mic);
         mQrCode = (ThemedImageButton) findViewById(R.id.qrcode);
     }
 
     @Override
     public void onAttachedToWindow() {
@@ -172,16 +174,17 @@ public class ToolbarEditLayout extends T
         super.setEnabled(enabled);
         mEditText.setEnabled(enabled);
     }
 
     @Override
     public void setPrivateMode(boolean isPrivate) {
         super.setPrivateMode(isPrivate);
         mEditText.setPrivateMode(isPrivate);
+        mThemeBackground.setPrivateMode(isPrivate);
         mSearchIcon.setPrivateMode(isPrivate);
         mVoiceInput.setPrivateMode(isPrivate);
         mQrCode.setPrivateMode(isPrivate);
     }
 
     /**
      * Called when the parent gains focus (on app launch and resume)
      */