|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This report was generated with an evaluation server license. Purchase Clover or configure your license. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
No Tests | |||
1 | package com.loopback.androidapps.saveapp; | |
2 | //package com.loopback.androidapps.saveapp; | |
3 | // | |
4 | // | |
5 | //import java.io.IOException; | |
6 | //import java.util.ArrayList; | |
7 | //import java.util.List; | |
8 | //import java.util.Locale; | |
9 | // | |
10 | //import android.content.ContextWrapper; | |
11 | //import android.app.AlertDialog; | |
12 | //import android.content.Context; | |
13 | //import android.graphics.drawable.Drawable; | |
14 | //import android.location.Address; | |
15 | //import android.location.Geocoder; | |
16 | //import android.view.MotionEvent; | |
17 | //import android.widget.TextView; | |
18 | //import android.widget.Toast; | |
19 | // | |
20 | //import com.google.android.maps.GeoPoint; | |
21 | //import com.google.android.maps.ItemizedOverlay; | |
22 | //import com.google.android.maps.MapView; | |
23 | //import com.google.android.maps.Overlay; | |
24 | //import com.google.android.maps.OverlayItem; | |
25 | // | |
26 | //public class MapOverlay extends ItemizedOverlay { | |
27 | // | |
28 | // private ArrayList<OverlayItem> mOverlays = new ArrayList<OverlayItem>(); | |
29 | // private Context mContext; | |
30 | // | |
31 | // public MapOverlay(Drawable defaultMarker, Context context) { | |
32 | // super(boundCenterBottom(defaultMarker)); | |
33 | // mContext = context; | |
34 | // } | |
35 | // public void addOverlay(OverlayItem overlay) { | |
36 | // mOverlays.add(overlay); | |
37 | // populate(); | |
38 | // } | |
39 | // protected OverlayItem createItem(int i) { | |
40 | // return mOverlays.get(i); | |
41 | // } | |
42 | // public int size() { | |
43 | // return mOverlays.size(); | |
44 | // } | |
45 | // protected boolean onTap(int index) { | |
46 | // OverlayItem item = mOverlays.get(index); | |
47 | // AlertDialog.Builder dialog = new AlertDialog.Builder(mContext); | |
48 | // dialog.setTitle(item.getTitle()); | |
49 | // dialog.setMessage(item.getSnippet()); | |
50 | // dialog.show(); | |
51 | // return true; | |
52 | // } | |
53 | // public boolean onTouchEvent(MotionEvent event, MapView mapView) | |
54 | // { | |
55 | // //---when user lifts his finger--- | |
56 | // if (event.getAction() == 1) { | |
57 | // GeoPoint p = mapView.getProjection().fromPixels( | |
58 | // (int) event.getX(), | |
59 | // (int) event.getY()); | |
60 | // | |
61 | // Geocoder geoCoder = new Geocoder( | |
62 | // mContext, Locale.getDefault()); | |
63 | // try { | |
64 | // List<Address> addresses = geoCoder.getFromLocation( | |
65 | // p.getLatitudeE6() / 1E6, | |
66 | // p.getLongitudeE6() / 1E6, 1); | |
67 | // | |
68 | // String add = ""; | |
69 | // if (addresses.size() > 0) | |
70 | // { | |
71 | // for (int i=0; i<addresses.get(0).getMaxAddressLineIndex(); | |
72 | // i++) | |
73 | // add += addresses.get(0).getAddressLine(i) + "\n"; | |
74 | // } | |
75 | // | |
76 | // Toast.makeText(mContext, add, Toast.LENGTH_SHORT).show(); | |
77 | // | |
78 | // } | |
79 | // catch (IOException e) { | |
80 | // e.printStackTrace(); | |
81 | // } | |
82 | // return true; | |
83 | // } | |
84 | // else | |
85 | // return false; | |
86 | // } | |
87 | //} |
|