Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 302f75d6 authored by Fabrice Di Meglio's avatar Fabrice Di Meglio
Browse files

Tune Search Results layout

- make the summary view as GONE when its text is empty

See bug: #12910134 Implement Search into the Settings App

Change-Id: Iafd680706b937137eaa30692e1c57a77cb5d7fc8
parent 19250a91
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -580,19 +580,18 @@ public class SearchResultsSummary extends Fragment {
            } else {
                view = convertView;
            }

            textTitle = (TextView) view.findViewById(R.id.title);
            textSummary = (TextView) view.findViewById(R.id.summary);
            imageView = (ImageView) view.findViewById(R.id.icon);

            SearchResult result = (SearchResult) getItem(position);

            final SearchResult result = (SearchResult) getItem(position);
            textTitle.setText(result.title);

            String summaryOn = result.summaryOn;
            String entries = result.entries;
            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);
@@ -607,7 +606,13 @@ public class SearchResultsSummary extends Fragment {
                }
                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;