diff options
author | Fabrice Di Meglio <fdimeglio@google.com> | 2014-06-03 15:24:36 -0700 |
---|---|---|
committer | Fabrice Di Meglio <fdimeglio@google.com> | 2014-06-03 15:29:08 -0700 |
commit | 302f75d6e6005e46e4500f3419bf1010202765e1 (patch) | |
tree | 32c940bc200d0f2485b17077957878b94f46f203 /src | |
parent | 19250a91df542465a1713d5a290315c9118b2091 (diff) | |
download | packages_apps_Settings-302f75d6e6005e46e4500f3419bf1010202765e1.tar.gz packages_apps_Settings-302f75d6e6005e46e4500f3419bf1010202765e1.tar.bz2 packages_apps_Settings-302f75d6e6005e46e4500f3419bf1010202765e1.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/dashboard/SearchResultsSummary.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/com/android/settings/dashboard/SearchResultsSummary.java b/src/com/android/settings/dashboard/SearchResultsSummary.java index 1bd0bf032..387e9bc93 100644 --- a/src/com/android/settings/dashboard/SearchResultsSummary.java +++ b/src/com/android/settings/dashboard/SearchResultsSummary.java @@ -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); } - textSummary.setText(sb.toString()); + + 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; |