diff options
author | Christopher Baines <cbaines8@gmail.com> | 2012-01-05 21:58:33 +0000 |
---|---|---|
committer | Christopher Baines <cbaines8@gmail.com> | 2012-01-05 21:58:33 +0000 |
commit | 9c08b26fd465583db317cc68dde9c2d95f8d8733 (patch) | |
tree | be1300c45b3a5d724ddb66ae9bfabd2ba2556d5d /src/net/cbaines/suma/BusStopOverlay.java | |
parent | f06b62c092ae6b9532982eb4729a911c378ccfbd (diff) | |
download | southamptonuniversitymap-9c08b26fd465583db317cc68dde9c2d95f8d8733.tar southamptonuniversitymap-9c08b26fd465583db317cc68dde9c2d95f8d8733.tar.gz |
Some speed improvements and a basic default preferences implementation.
Diffstat (limited to 'src/net/cbaines/suma/BusStopOverlay.java')
-rw-r--r-- | src/net/cbaines/suma/BusStopOverlay.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/net/cbaines/suma/BusStopOverlay.java b/src/net/cbaines/suma/BusStopOverlay.java index 69687b6..1b6a384 100644 --- a/src/net/cbaines/suma/BusStopOverlay.java +++ b/src/net/cbaines/suma/BusStopOverlay.java @@ -20,8 +20,8 @@ package net.cbaines.suma; import java.sql.SQLException; -import java.util.ArrayList; import java.util.Collections; +import java.util.List; import org.osmdroid.views.MapView; import org.osmdroid.views.MapView.Projection; @@ -45,7 +45,7 @@ import com.j256.ormlite.dao.Dao; public class BusStopOverlay extends Overlay implements RouteColorConstants { - private ArrayList<BusStop> busStops; + private List<BusStop> busStops; private final Point mCurScreenCoords = new Point(); private final Point mTouchScreenPoint = new Point(); @@ -70,6 +70,7 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { public BusStopOverlay(Context context) throws SQLException { super(context); + final long startTime = System.currentTimeMillis(); this.context = context; @@ -83,8 +84,9 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants { paint.setStyle(Style.FILL); paint.setStrokeWidth(6); - busStops = new ArrayList<BusStop>((int) busStopDao.countOf()); - busStops.addAll(busStopDao.queryForAll()); + Log.i(TAG, "Begining to load bus stops in to overlay " + (System.currentTimeMillis() - startTime)); + busStops = busStopDao.queryForAll(); + Log.i(TAG, "Finished loading bus stops in to overlay " + (System.currentTimeMillis() - startTime)); } void setRoutes(int route, boolean visible) { |