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
This commit is contained in:
@@ -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>
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user