diff options
author | Christopher Baines <cbaines8@gmail.com> | 2012-02-28 22:27:49 +0000 |
---|---|---|
committer | Christopher Baines <cbaines8@gmail.com> | 2012-02-28 22:27:49 +0000 |
commit | cde3c08d7e9e486d7d1a795832ea1b767d96a4f3 (patch) | |
tree | f1af1424ebf5cb3a548a7d73257723395dccb267 /src/net/cbaines/suma/POIArrayAdapter.java | |
parent | 7e88b00e017bde16c12e6adb78883acf7b2ba575 (diff) | |
parent | 5f2b8712079aeb5b7cee476b06b36013edac4fb3 (diff) | |
download | southamptonuniversitymap-cde3c08d7e9e486d7d1a795832ea1b767d96a4f3.tar southamptonuniversitymap-cde3c08d7e9e486d7d1a795832ea1b767d96a4f3.tar.gz |
Merge branch 'dev'
Conflicts:
src/net/cbaines/suma/BusSpecificStopView.java
src/net/cbaines/suma/StopView.java
Diffstat (limited to 'src/net/cbaines/suma/POIArrayAdapter.java')
-rw-r--r-- | src/net/cbaines/suma/POIArrayAdapter.java | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/src/net/cbaines/suma/POIArrayAdapter.java b/src/net/cbaines/suma/POIArrayAdapter.java index e35acf4..f9b5271 100644 --- a/src/net/cbaines/suma/POIArrayAdapter.java +++ b/src/net/cbaines/suma/POIArrayAdapter.java @@ -21,7 +21,6 @@ package net.cbaines.suma; import java.util.List; - import android.content.Context; import android.view.View; import android.view.ViewGroup; @@ -29,51 +28,52 @@ import android.widget.BaseAdapter; public class POIArrayAdapter extends BaseAdapter { - private final Context context; - private final List<POI> POIs; - - public POIArrayAdapter(Context context, List<POI> pois) { - this.context = context; - this.POIs = pois; - } + private final Context context; + private final List<? extends POI> POIs; - public View getView(int position, View convertView, ViewGroup parent) { - POIView poiView; - if (convertView == null) { - if (POIs.get(position).distTo == -1) { - poiView = new POIView(context, POIs.get(position)); - } else { - poiView = new POIView(context, POIs.get(position), POIs.get(position).distTo); - } - } else { - poiView = (POIView) convertView; - if (POIs.get(position).distTo == -1) { - poiView = new POIView(context, POIs.get(position)); - } else { - poiView = new POIView(context, POIs.get(position), POIs.get(position).distTo); - } + public POIArrayAdapter(Context context, List<? extends POI> pois) { + this.context = context; + this.POIs = pois; } - return poiView; - } + public View getView(int position, View convertView, ViewGroup parent) { + POIView poiView; + POI poi = POIs.get(position); + if (convertView == null) { + if (poi.distTo == -1) { + poiView = new POIView(context, poi); + } else { + poiView = new POIView(context, poi, poi.distTo); + } + } else { + poiView = (POIView) convertView; + if (((POI) POIs.get(position)).distTo == -1) { + poiView = new POIView(context, poi); + } else { + poiView = new POIView(context, poi, poi.distTo); + } + } - public int getCount() { - return POIs.size(); - } + return poiView; + } - public Object getItem(int position) { - return position; - } + public int getCount() { + return POIs.size(); + } - public POI getPOIItem(int position) { - return POIs.get(position); - } + public Object getItem(int position) { + return position; + } - public long getItemId(int position) { - return position; - } + public POI getPOIItem(int position) { + return (POI) POIs.get(position); + } + + public long getItemId(int position) { + return position; + } - public String getItemStringId(int position) { - return POIs.get(position).id; - } + public String getItemStringId(int position) { + return ((POI) POIs.get(position)).id; + } }
\ No newline at end of file |