Bug 1203053 - Search icon appears blank until turning on search suggestions.r=mfinkle
authorAllison Naaktgeboren <ally@mozilla.com>
Sun, 13 Sep 2015 13:13:43 -0700
changeset 294848 00693818cbf5fdd073dd4d895be44771091e9432
parent 294847 b185d4bce7d91958696be9c750ac43252dfa23b0
child 294849 d885df6c27c10f5fba28b9523f00b5c416b476b2
child 294864 83d4e623d4762dc8ff5075d3a059de5ebdaab5d3
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs1203053
milestone43.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 1203053 - Search icon appears blank until turning on search suggestions.r=mfinkle
mobile/android/base/home/SearchEngineRow.java
--- a/mobile/android/base/home/SearchEngineRow.java
+++ b/mobile/android/base/home/SearchEngineRow.java
@@ -239,22 +239,16 @@ class SearchEngineRow extends AnimatedHe
             }
         } finally {
             c.close();
         }
         hideRecycledSuggestions(suggestionCounter, recycledSuggestionCount);
     }
 
     private int updateFromSearchEngine(boolean animate, int recycledSuggestionCount) {
-        // Set the search engine icon (e.g., Google) for the row.
-        mIconView.updateAndScaleImage(mSearchEngine.getIcon(), mSearchEngine.getEngineIdentifier());
-
-        // Set the initial content description.
-        setDescriptionOnSuggestion(mUserEnteredTextView, mUserEnteredTextView.getText().toString());
-
         int suggestionCounter = 0;
         // Apply Search Engine's suggestions
         for (String suggestion : mSearchEngine.getSuggestions()) {
             bindSuggestionView(suggestion, animate, recycledSuggestionCount, suggestionCounter, false);
             ++suggestionCounter;
         }
 
         hideRecycledSuggestions(suggestionCounter, recycledSuggestionCount);
@@ -265,16 +259,20 @@ class SearchEngineRow extends AnimatedHe
         }
 
         return suggestionCounter;
     }
 
     public void updateSuggestions(boolean suggestionsEnabled, SearchEngine searchEngine, String searchTerm, boolean animate) {
         // Update search engine reference. Even if the user has not seen the prompt, we need to set the engine for the mSearchTerm suggestion
         mSearchEngine = searchEngine;
+        // Set the search engine icon (e.g., Google) for the row.
+        mIconView.updateAndScaleImage(mSearchEngine.getIcon(), mSearchEngine.getEngineIdentifier());
+        // Set the initial content description.
+        setDescriptionOnSuggestion(mUserEnteredTextView, mUserEnteredTextView.getText().toString());
         // This can be called before the opt-in permission prompt is shown or set. Check first.
         if (suggestionsEnabled) {
             final int recycledSuggestionCount = mSuggestionView.getChildCount();
             final int suggestionViewCount = updateFromSearchEngine(animate, recycledSuggestionCount);
             if (AppConstants.NIGHTLY_BUILD) {
                 updateFromSavedSearches(searchTerm, animate, suggestionViewCount, recycledSuggestionCount);
             }
         }