Merge "Bind icon and remote views for Suggestion"

This commit is contained in:
TreeHugger Robot
2017-10-03 22:20:03 +00:00
committed by Android (Google) Code Review
3 changed files with 24 additions and 9 deletions

View File

@@ -601,6 +601,9 @@ public class DashboardAdapter extends RecyclerView.Adapter<DashboardAdapter.Dash
}
public Drawable getIcon(Icon icon) {
if (icon == null) {
return null;
}
Drawable drawable = mMap.get(icon);
if (drawable == null) {
drawable = icon.loadDrawable(mContext);

View File

@@ -96,8 +96,7 @@ public class SuggestionAdapter extends RecyclerView.Adapter<DashboardItemHolder>
// itemView));
// } else
{
// TODO: Add icon field in Suggestion, and enable this.
// holder.icon.setImageDrawable(mCache.getIcon(suggestion.icon));
holder.icon.setImageDrawable(mCache.getIcon(suggestion.getIcon()));
holder.title.setText(suggestion.getTitle());
final CharSequence summary = suggestion.getSummary();
if (!TextUtils.isEmpty(summary)) {