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
diff --git a/res/layout/search_result_item.xml b/res/layout/search_result_item.xml
index 8e537d5..b659387 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" />
- <TextView android:id="@+id/summary"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/title"
- android:layout_alignStart="@id/title"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorSecondary"
- android:maxLines="10" />
-
</RelativeLayout>
</LinearLayout>
diff --git a/src/com/android/settings/dashboard/SearchResultsSummary.java b/src/com/android/settings/dashboard/SearchResultsSummary.java
index 387e9bc..910d661 100644
--- a/src/com/android/settings/dashboard/SearchResultsSummary.java
+++ b/src/com/android/settings/dashboard/SearchResultsSummary.java
@@ -572,7 +572,6 @@
View view;
TextView textTitle;
- TextView textSummary;
ImageView imageView;
if (convertView == null) {
@@ -582,38 +581,11 @@
}
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;