From 132652c5576462f036ed9437720b15b0c31430e4 Mon Sep 17 00:00:00 2001 From: Fabrice Di Meglio Date: Thu, 5 Jun 2014 19:15:02 -0700 Subject: [PATCH] Do not show the Preference summary in Search results - as the summary was sometimes showing "Unknown" or even not the real Preference value (we dont have right now the capability to know the current value of a Preference), so it is better to be safe than sorry. Change-Id: I009c31fc41ad35a630f4b34aa0ef998932f65263 --- res/layout/search_result_item.xml | 9 ------ .../dashboard/SearchResultsSummary.java | 28 ------------------- 2 files changed, 37 deletions(-) diff --git a/res/layout/search_result_item.xml b/res/layout/search_result_item.xml index 8e537d51c3f..b659387f7a9 100644 --- a/res/layout/search_result_item.xml +++ b/res/layout/search_result_item.xml @@ -52,15 +52,6 @@ android:ellipsize="marquee" android:fadingEdge="horizontal" /> - - diff --git a/src/com/android/settings/dashboard/SearchResultsSummary.java b/src/com/android/settings/dashboard/SearchResultsSummary.java index 387e9bc935b..910d66156be 100644 --- a/src/com/android/settings/dashboard/SearchResultsSummary.java +++ b/src/com/android/settings/dashboard/SearchResultsSummary.java @@ -572,7 +572,6 @@ public class SearchResultsSummary extends Fragment { View view; TextView textTitle; - TextView textSummary; ImageView imageView; if (convertView == null) { @@ -582,38 +581,11 @@ public class SearchResultsSummary extends Fragment { } textTitle = (TextView) view.findViewById(R.id.title); - textSummary = (TextView) view.findViewById(R.id.summary); imageView = (ImageView) view.findViewById(R.id.icon); final SearchResult result = (SearchResult) getItem(position); textTitle.setText(result.title); - final String summaryOn = result.summaryOn; - final String entries = result.entries; - - final StringBuilder sb = new StringBuilder(); - if (!TextUtils.isEmpty(summaryOn) && - !summaryOn.contains(PERCENT_RECLACE) && !summaryOn.contains(DOLLAR_REPLACE)) { - sb.append(summaryOn); - sb.append(ELLIPSIS); - } else if (!TextUtils.isEmpty(entries)) { - final int index = entries.indexOf(Index.ENTRIES_SEPARATOR); - if (index > 0) { - final String firstEntriesValue = entries.substring(0, index); - sb.append(firstEntriesValue); - } else { - sb.append(entries); - } - sb.append(ELLIPSIS); - } - - if (TextUtils.isEmpty(sb)) { - textSummary.setVisibility(View.GONE); - } else { - textSummary.setText(sb.toString()); - textSummary.setVisibility(View.VISIBLE); - } - if (result.iconResId != R.drawable.empty_icon) { final Context packageContext = result.context; final Drawable drawable;