Bug 1043624 - Set correct end for SpannableString. r=eedens
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Fri, 25 Jul 2014 14:39:21 -0700
changeset 196326 ceab6297c50223ba24bd76ae246b46a24cecc945
parent 196325 b2ce4cf640efed321ddfad5e9b142a2ed512f252
child 196327 b5ae1c999f27a9025e5beae2cdf27e0ee6b3b94d
push id46844
push usercbook@mozilla.com
push dateMon, 28 Jul 2014 14:30:47 +0000
treeherdermozilla-inbound@7dd701896de8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerseedens
bugs1043624
milestone34.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 1043624 - Set correct end for SpannableString. r=eedens
mobile/android/search/java/org/mozilla/search/autocomplete/SearchFragment.java
--- a/mobile/android/search/java/org/mozilla/search/autocomplete/SearchFragment.java
+++ b/mobile/android/search/java/org/mozilla/search/autocomplete/SearchFragment.java
@@ -216,17 +216,17 @@ public class SearchFragment extends Frag
         public Suggestion(String value, String searchTerm) {
             this.value = value;
 
             display = new SpannableString(value);
 
             // Highlight mixed-case matches.
             final int start = value.toLowerCase().indexOf(searchTerm.toLowerCase());
             if (start >= 0) {
-                display.setSpan(COLOR_SPAN, start, searchTerm.length(), 0);
+                display.setSpan(COLOR_SPAN, start, start + searchTerm.length(), 0);
             }
         }
     }
 
     private class SuggestionLoaderCallbacks implements LoaderManager.LoaderCallbacks<List<Suggestion>> {
         @Override
         public Loader<List<Suggestion>> onCreateLoader(int id, Bundle args) {
             return new SuggestionAsyncLoader(getActivity(), suggestClient, args.getString(KEY_SEARCH_TERM));