← Back to team overview

mais-devel team mailing list archive

[Branch ~tiagofalcao/mais/trunk] Rev 22: Places++

 

------------------------------------------------------------
revno: 22
committer: Tiago Falcao <tiagofalcao@xxxxxxxxx>
branch nick: mais
timestamp: Sun 2008-06-15 12:37:01 -0300
message:
  Places++
modified:
  src/org/mais/R.java
  src/org/mais/plugin/Places.java

=== modified file 'src/org/mais/R.java'
--- a/src/org/mais/R.java	2008-06-14 23:04:33 +0000
+++ b/src/org/mais/R.java	2008-06-15 15:37:01 +0000
@@ -1,66 +1,66 @@
-/* AUTO-GENERATED FILE.  DO NOT MODIFY.
- *
- * This class was automatically generated by the
- * aapt tool from the resource data it found.  It
- * should not be modified by hand.
- */
-
-package org.mais;
-
-public final class R {
-    public static final class attr {
-    }
-    public static final class drawable {
-        public static final int background=0x7f020000;
-        public static final int config=0x7f020001;
-        public static final int config_=0x7f020002;
-        public static final int config_contacts=0x7f020003;
-        public static final int config_contacts_=0x7f020004;
-        public static final int mais_compact=0x7f020005;
-        public static final int mais_full=0x7f020006;
-        public static final int mais_small=0x7f020007;
-        public static final int plugin_apps=0x7f020008;
-        public static final int plugin_apps_=0x7f020009;
-        public static final int plugin_games=0x7f02000a;
-        public static final int plugin_movies=0x7f02000b;
-        public static final int plugin_music=0x7f02000c;
-        public static final int plugin_music_=0x7f02000d;
-        public static final int plugin_places=0x7f02000e;
-        public static final int plugin_places_=0x7f02000f;
-        public static final int plugin_places_food=0x7f020010;
-        public static final int plugin_schedule=0x7f020011;
-        public static final int plugin_schedule_=0x7f020012;
-        public static final int solid_blue=0x7f020016;
-        public static final int solid_green=0x7f020017;
-        public static final int solid_red=0x7f020015;
-        public static final int start=0x7f020013;
-        public static final int start_=0x7f020014;
-    }
-    public static final class id {
-        public static final int text1=0x7f060000;
-    }
-    public static final class layout {
-        public static final int forward_target=0x7f030000;
-        public static final int main=0x7f030001;
-        public static final int recs_list=0x7f030002;
-        public static final int recs_row=0x7f030003;
-    }
-    public static final class main {
-        public static final int logo=0x7f050000;
-        public static final int plugin_apps=0x7f050005;
-        public static final int plugin_music=0x7f050003;
-        public static final int plugin_places=0x7f050004;
-        public static final int plugins=0x7f050002;
-        public static final int selection=0x7f050001;
-    }
-    public static final class string {
-        public static final int app_name=0x7f040000;
-        public static final int config_contacts=0x7f040006;
-        public static final int field=0x7f040002;
-        public static final int forward_target=0x7f040007;
-        public static final int no_recs=0x7f040001;
-        public static final int plugin_apps=0x7f040004;
-        public static final int plugin_musics=0x7f040003;
-        public static final int plugin_places=0x7f040005;
-    }
-}
+/* AUTO-GENERATED FILE.  DO NOT MODIFY.
+ *
+ * This class was automatically generated by the
+ * aapt tool from the resource data it found.  It
+ * should not be modified by hand.
+ */
+
+package org.mais;
+
+public final class R {
+    public static final class attr {
+    }
+    public static final class drawable {
+        public static final int background=0x7f020000;
+        public static final int config=0x7f020001;
+        public static final int config_=0x7f020002;
+        public static final int config_contacts=0x7f020003;
+        public static final int config_contacts_=0x7f020004;
+        public static final int mais_compact=0x7f020005;
+        public static final int mais_full=0x7f020006;
+        public static final int mais_small=0x7f020007;
+        public static final int plugin_apps=0x7f020008;
+        public static final int plugin_apps_=0x7f020009;
+        public static final int plugin_games=0x7f02000a;
+        public static final int plugin_movies=0x7f02000b;
+        public static final int plugin_music=0x7f02000c;
+        public static final int plugin_music_=0x7f02000d;
+        public static final int plugin_places=0x7f02000e;
+        public static final int plugin_places_=0x7f02000f;
+        public static final int plugin_places_food=0x7f020010;
+        public static final int plugin_schedule=0x7f020011;
+        public static final int plugin_schedule_=0x7f020012;
+        public static final int solid_blue=0x7f020016;
+        public static final int solid_green=0x7f020017;
+        public static final int solid_red=0x7f020015;
+        public static final int start=0x7f020013;
+        public static final int start_=0x7f020014;
+    }
+    public static final class id {
+        public static final int text1=0x7f060000;
+    }
+    public static final class layout {
+        public static final int forward_target=0x7f030000;
+        public static final int main=0x7f030001;
+        public static final int recs_list=0x7f030002;
+        public static final int recs_row=0x7f030003;
+    }
+    public static final class main {
+        public static final int logo=0x7f050000;
+        public static final int plugin_apps=0x7f050005;
+        public static final int plugin_music=0x7f050003;
+        public static final int plugin_places=0x7f050004;
+        public static final int plugins=0x7f050002;
+        public static final int selection=0x7f050001;
+    }
+    public static final class string {
+        public static final int app_name=0x7f040000;
+        public static final int config_contacts=0x7f040006;
+        public static final int field=0x7f040002;
+        public static final int forward_target=0x7f040007;
+        public static final int no_recs=0x7f040001;
+        public static final int plugin_apps=0x7f040004;
+        public static final int plugin_musics=0x7f040003;
+        public static final int plugin_places=0x7f040005;
+    }
+}

=== modified file 'src/org/mais/plugin/Places.java'
--- a/src/org/mais/plugin/Places.java	2008-06-14 23:03:13 +0000
+++ b/src/org/mais/plugin/Places.java	2008-06-15 15:37:01 +0000
@@ -3,65 +3,108 @@
 //Need the following import to get access to the app resources, since this
 //class is in a sub-package.
 
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
 import android.os.Bundle;
 import android.view.KeyEvent;
 
 import com.google.android.maps.MapActivity;
 import com.google.android.maps.MapController;
 import com.google.android.maps.MapView;
+import com.google.android.maps.Overlay;
 import com.google.android.maps.Point;
 
-
 /**
-* Example of removing yourself from the history stack after forwarding to
-* another activity.
-*/
-public class Places extends MapActivity
-{
-    private MapView mapview;
-
-    @Override
-    public void onCreate(Bundle icicle) {
-        super.onCreate(icicle);
-        mapview = new MapView(this);
-
-        // Lets start at the Statue of Liberty
-        // I grabbed the data from Google-Maps
-        Point p = new Point((int) (40.689213 * 1000000),
-                              (int) (-74.044558 * 1000000));
-        // Get the controller, that is used for translation and zooming
-        MapController mc = mapview.getController();
-        // Translate to the Statue of Liberty
-        mc.animateTo(p);
-        // Zoom Very close
-        mc.zoomTo(21);
-        
-        // Make myMapView the exilicit view of this app
-        setContentView(mapview);
-        // Enable Sattelite-Mode, so we will se the
-        // Statue of liberty instantly on the screen
-        mapview.toggleSatellite();
-        mapview.displayZoomDialog(0, 0);
-    }
-
-    public boolean onKeyDown(int keyCode, KeyEvent event) {
-        if (keyCode == KeyEvent.KEYCODE_I) {
-            // Zooming In
-            mapview.getController().zoomTo(mapview.getZoomLevel() + 1);
-            return true;
-        } else if (keyCode == KeyEvent.KEYCODE_O) {
-            // Zooming Out
-        	mapview.getController().zoomTo(mapview.getZoomLevel() - 1);
-            return true;
-        } else if (keyCode == KeyEvent.KEYCODE_S) {
-          // Switch to satellite view
-        	mapview.toggleSatellite();
-            return true;
-        } else if (keyCode == KeyEvent.KEYCODE_T) {
-            // Switch on traffic overlays
-        	mapview.toggleTraffic();
-            return true;
-        }
-        return false;
-    } 
+ * Example of removing yourself from the history stack after forwarding to
+ * another activity.
+ */
+public class Places extends MapActivity {
+	private MapView mapview;
+
+	@Override
+	public void onCreate(Bundle icicle) {
+		super.onCreate(icicle);
+		mapview = new MapView(this);
+
+		// Lets start at the Statue of Liberty
+		// I grabbed the data from Google-Maps
+		Point p = new Point((int) (40.689213 * 1000000),
+				(int) (-74.044558 * 1000000));
+		// Get the controller, that is used for translation and zooming
+		MapController mc = mapview.getController();
+		// Translate to the Statue of Liberty
+		mc.animateTo(p);
+		// Zoom Very close
+		mc.zoomTo(21);
+
+		// Make myMapView the exilicit view of this app
+		setContentView(mapview);
+		// Enable Sattelite-Mode, so we will se the
+		// Statue of liberty instantly on the screen
+		mapview.toggleSatellite();
+		// mapview.displayZoomDialog(0, 0);
+
+		mapview.createOverlayController().add(new RecOverlay(30), true);
+	}
+
+	public class RecOverlay extends Overlay {
+
+		float radius;
+
+		public RecOverlay(float radius) {
+			this.radius = radius;
+		}
+
+		public void draw(Canvas canvas, PixelCalculator calculator,
+				boolean shadow) {
+			
+//            Paint mCenterPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
+//            mCenterPaint.setColor(0xFFFF0000);
+//            mCenterPaint.setStrokeWidth(5);
+//			canvas.drawColor(0X88000000);
+//			canvas.drawCircle(canvas.getBitmapWidth()/2 ,canvas.getBitmapHeight()/2, radius, mCenterPaint);
+			
+			Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
+			mPaint.setColor(Color.GRAY);
+            mPaint.setStyle(Paint.Style.STROKE);
+            canvas.drawCircle(canvas.getBitmapWidth()/2 ,canvas.getBitmapHeight()/2, radius, mPaint);
+			
+			/*calculator.getPointXY(p, sXYCoords);
+			bmp.setBounds(sXYCoords[0] - w / 2, sXYCoords[1] - h, sXYCoords[0]
+					+ w / 2, sXYCoords[1]);
+			bmp.setAlpha(70);
+			bmp.draw(canvas);*/
+
+			/*
+			 * RectF oval = new RectF(xyCoords[0], xyCoords[1], xyCoords[0] + 5,
+			 * xyCoords[1] + 5);
+			 * 
+			 * Paint paint = new Paint(); paint.setARGB(200, 255, 0, 0);
+			 * canvas.drawOval(oval, paint);
+			 */
+		}
+
+	}
+
+	public boolean onKeyDown(int keyCode, KeyEvent event) {
+		if (keyCode == KeyEvent.KEYCODE_I) {
+			// Zooming In
+			mapview.getController().zoomTo(mapview.getZoomLevel() + 1);
+			return true;
+		} else if (keyCode == KeyEvent.KEYCODE_O) {
+			// Zooming Out
+			mapview.getController().zoomTo(mapview.getZoomLevel() - 1);
+			return true;
+		} else if (keyCode == KeyEvent.KEYCODE_S) {
+			// Switch to satellite view
+			mapview.toggleSatellite();
+			return true;
+		} else if (keyCode == KeyEvent.KEYCODE_T) {
+			// Switch on traffic overlays
+			mapview.toggleTraffic();
+			return true;
+		}
+		return false;
+	}
 }



--

https://code.launchpad.net/~tiagofalcao/mais/trunk

You are receiving this branch notification because you are subscribed to it.