aboutsummaryrefslogtreecommitdiff
path: root/src/net/cbaines/suma/BuildingNumOverlay.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/cbaines/suma/BuildingNumOverlay.java')
-rw-r--r--src/net/cbaines/suma/BuildingNumOverlay.java49
1 files changed, 32 insertions, 17 deletions
diff --git a/src/net/cbaines/suma/BuildingNumOverlay.java b/src/net/cbaines/suma/BuildingNumOverlay.java
index 87d4156..a4cf556 100644
--- a/src/net/cbaines/suma/BuildingNumOverlay.java
+++ b/src/net/cbaines/suma/BuildingNumOverlay.java
@@ -88,24 +88,33 @@ public class BuildingNumOverlay extends Overlay implements Preferences, OnShared
}
/**
- * Draw a marker on each of our items. populate() must have been called first.<br/>
+ * Draw a marker on each of our items. populate() must have been called
+ * first.<br/>
* <br/>
- * The marker will be drawn twice for each Item in the Overlay--once in the shadow phase, skewed and darkened, then again in
- * the non-shadow phase. The bottom-center of the marker will be aligned with the geographical coordinates of the Item.<br/>
+ * The marker will be drawn twice for each Item in the Overlay--once in the
+ * shadow phase, skewed and darkened, then again in the non-shadow phase.
+ * The bottom-center of the marker will be aligned with the geographical
+ * coordinates of the Item.<br/>
* <br/>
- * The order of drawing may be changed by overriding the getIndexToDraw(int) method. An item may provide an alternate marker
- * via its OverlayItem.getMarker(int) method. If that method returns null, the default marker is used.<br/>
+ * The order of drawing may be changed by overriding the getIndexToDraw(int)
+ * method. An item may provide an alternate marker via its
+ * OverlayItem.getMarker(int) method. If that method returns null, the
+ * default marker is used.<br/>
* <br/>
- * The focused item is always drawn last, which puts it visually on top of the other items.<br/>
+ * The focused item is always drawn last, which puts it visually on top of
+ * the other items.<br/>
*
* @param canvas
- * the Canvas upon which to draw. Note that this may already have a transformation applied, so be sure to leave it
- * the way you found it
+ * the Canvas upon which to draw. Note that this may already have
+ * a transformation applied, so be sure to leave it the way you
+ * found it
* @param mapView
- * the MapView that requested the draw. Use MapView.getProjection() to convert between on-screen pixels and
- * latitude/longitude pairs
+ * the MapView that requested the draw. Use
+ * MapView.getProjection() to convert between on-screen pixels
+ * and latitude/longitude pairs
* @param shadow
- * if true, draw the shadow layer. If false, draw the overlay contents.
+ * if true, draw the shadow layer. If false, draw the overlay
+ * contents.
*/
@Override
public void draw(final Canvas canvas, final MapView mapView, final boolean shadow) {
@@ -129,7 +138,8 @@ public class BuildingNumOverlay extends Overlay implements Preferences, OnShared
final SharedPreferences favouritesPrefs = context.getSharedPreferences(FAVOURITES_PREFERENCES, 0);
/*
- * Draw in backward cycle, so the items with the least index are on the front.
+ * Draw in backward cycle, so the items with the least index are on the
+ * front.
*/
for (Iterator<Building> buildingIter = buildings.iterator(); buildingIter.hasNext();) {
final Building building = buildingIter.next();
@@ -200,7 +210,8 @@ public class BuildingNumOverlay extends Overlay implements Preferences, OnShared
Log.v(TAG, "building Pressed " + building.id);
if (context.activityToast == null) {
- context.activityToast = Toast.makeText(context, building.name + " (" + building.id + ")", Toast.LENGTH_SHORT);
+ context.activityToast = Toast.makeText(context, building.name + " (" + building.id + ")",
+ Toast.LENGTH_SHORT);
} else {
context.activityToast.setDuration(Toast.LENGTH_SHORT);
context.activityToast.setText(building.name + " (" + building.id + ")");
@@ -252,7 +263,8 @@ public class BuildingNumOverlay extends Overlay implements Preferences, OnShared
favouritesPrefs.edit().remove(building.id).commit();
if (context.activityToast == null) {
- context.activityToast = Toast.makeText(context, building.id + " removed from favourites", Toast.LENGTH_SHORT);
+ context.activityToast = Toast.makeText(context, building.id + " removed from favourites",
+ Toast.LENGTH_SHORT);
} else {
context.activityToast.setDuration(Toast.LENGTH_SHORT);
context.activityToast.setText(building.id + " removed from favourites");
@@ -261,7 +273,8 @@ public class BuildingNumOverlay extends Overlay implements Preferences, OnShared
} else {
if (context.activityToast == null) {
- context.activityToast = Toast.makeText(context, building.id + " made a favourite", Toast.LENGTH_SHORT);
+ context.activityToast = Toast.makeText(context, building.id + " made a favourite",
+ Toast.LENGTH_SHORT);
} else {
context.activityToast.setDuration(Toast.LENGTH_SHORT);
context.activityToast.setText(building.id + " made a favourite");
@@ -271,7 +284,8 @@ public class BuildingNumOverlay extends Overlay implements Preferences, OnShared
favouritesPrefs.edit().putBoolean(building.id, true).commit();
}
- Collections.sort(buildings, new POIFavouriteComparator(context.getSharedPreferences(FAVOURITES_PREFERENCES, 0)));
+ Collections.sort(buildings,
+ new POIFavouriteComparator(context.getSharedPreferences(FAVOURITES_PREFERENCES, 0)));
mapView.invalidate();
@@ -304,7 +318,8 @@ public class BuildingNumOverlay extends Overlay implements Preferences, OnShared
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
Log.i(TAG, "Got a favourites change in the BuildingNumOverlay for key " + key);
- Collections.sort(buildings, new POIFavouriteComparator(context.getSharedPreferences(FAVOURITES_PREFERENCES, 0)));
+ Collections
+ .sort(buildings, new POIFavouriteComparator(context.getSharedPreferences(FAVOURITES_PREFERENCES, 0)));
}
}