From 23eb8a2d37055379cdc97b9ca70d4b184e121370 Mon Sep 17 00:00:00 2001 From: misaochan Date: Mon, 29 Aug 2016 19:36:38 +1200 Subject: [PATCH] Add icon field --- .../java/fr/free/nrw/commons/nearby/NearbyListFragment.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyListFragment.java b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyListFragment.java index 2c726b4a8..1c2fcff31 100644 --- a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyListFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyListFragment.java @@ -12,6 +12,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.Adapter; import android.widget.ArrayAdapter; +import android.widget.ImageView; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.ProgressBar; @@ -138,12 +139,16 @@ public class NearbyListFragment extends ListFragment { TextView tvName = (TextView) convertView.findViewById(R.id.tvName); TextView tvDesc = (TextView) convertView.findViewById(R.id.tvDesc); TextView distance = (TextView) convertView.findViewById(R.id.distance); + ImageView icon = (ImageView) convertView.findViewById(R.id.icon); // Populate the data into the template view using the data object tvName.setText(place.name); tvDesc.setText(place.description); distance.setText(place.distance); + //TODO: Check for description type and set Drawable image here + icon.setImageResource(place.image); + // Return the completed view to render on screen return convertView; }