Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

deleted pointless project

  • Loading branch information...
commit 8af8df4f7d4d27b5bfef10e90f0d38e9fd2db227 1 parent 9c2e31d
@commonsguy authored
Showing with 0 additions and 727 deletions.
  1. +0 −8 MapsV2/Fallback/.classpath
  2. +0 −33 MapsV2/Fallback/.project
  3. +0 −54 MapsV2/Fallback/AndroidManifest.xml
  4. BIN  MapsV2/Fallback/libs/actionbarsherlock-plugin-maps-4.0.0.jar
  5. BIN  MapsV2/Fallback/libs/android-support-v4.jar
  6. +0 −20 MapsV2/Fallback/proguard-project.txt
  7. +0 −16 MapsV2/Fallback/project.properties
  8. BIN  MapsV2/Fallback/res/drawable-hdpi/ic_launcher.png
  9. BIN  MapsV2/Fallback/res/drawable-ldpi/ic_launcher.png
  10. BIN  MapsV2/Fallback/res/drawable-mdpi/ic_launcher.png
  11. BIN  MapsV2/Fallback/res/drawable-mdpi/marker.png
  12. BIN  MapsV2/Fallback/res/drawable-xhdpi/ic_launcher.png
  13. +0 −5 MapsV2/Fallback/res/layout/activity_main.xml
  14. +0 −12 MapsV2/Fallback/res/layout/legal.xml
  15. +0 −7 MapsV2/Fallback/res/layout/main.xml
  16. +0 −35 MapsV2/Fallback/res/layout/popup.xml
  17. +0 −9 MapsV2/Fallback/res/menu/activity_main.xml
  18. +0 −22 MapsV2/Fallback/res/values/strings.xml
  19. +0 −130 MapsV2/Fallback/src/com/commonsware/android/mapsv2/fallback/AbstractMapActivity.java
  20. +0 −32 MapsV2/Fallback/src/com/commonsware/android/mapsv2/fallback/LegalNoticesActivity.java
  21. +0 −137 MapsV2/Fallback/src/com/commonsware/android/mapsv2/fallback/MainActivity.java
  22. +0 −129 MapsV2/Fallback/src/com/commonsware/android/mapsv2/fallback/MapFragment.java
  23. +0 −31 MapsV2/Fallback/src/com/commonsware/android/mapsv2/fallback/NooYawk.java
  24. +0 −47 MapsV2/Fallback/src/com/commonsware/android/mapsv2/fallback/PopupAdapter.java
View
8 MapsV2/Fallback/.classpath
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="gen"/>
- <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
- <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
- <classpathentry kind="output" path="bin/classes"/>
-</classpath>
View
33 MapsV2/Fallback/.project
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>MapsV2Fallback</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.ApkBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
View
54 MapsV2/Fallback/AndroidManifest.xml
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.commonsware.android.mapsv2.fallback"
- android:versionCode="1"
- android:versionName="1.0">
-
- <uses-sdk
- android:minSdkVersion="11"
- android:targetSdkVersion="16"/>
-
- <permission
- android:name="com.commonsware.android.mapsv2.fallback.permission.MAPS_RECEIVE"
- android:protectionLevel="signature"/>
-
- <uses-permission android:name="com.commonsware.android.mapsv2.fallback.permission.MAPS_RECEIVE"/>
- <uses-permission android:name="android.permission.INTERNET"/>
- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
- <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
-
- <uses-feature
- android:glEsVersion="0x00020000"
- android:required="true"/>
-
- <application
- android:allowBackup="true"
- android:icon="@drawable/ic_launcher"
- android:label="@string/app_name"
- android:theme="@style/Theme.Sherlock.Light.DarkActionBar">
- <uses-library
- android:name="com.google.android.maps"
- android:required="false"/>
-
- <activity
- android:name="MainActivity"
- android:label="@string/app_name">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
-
- <category android:name="android.intent.category.LAUNCHER"/>
- </intent-filter>
- </activity>
- <activity android:name="com.commonsware.android.mapsv2.fallback.LegalNoticesActivity">
- </activity>
- <activity
- android:name=".NooYawk"
- android:label="@string/app_name">
- </activity>
-
- <meta-data
- android:name="com.google.android.maps.v2.API_KEY"
- android:value="AIzaSyCis4NzxMw1aJyvUIrjGILjPkSdxrRfof4"/>
- </application>
-
-</manifest>
View
BIN  MapsV2/Fallback/libs/actionbarsherlock-plugin-maps-4.0.0.jar
Binary file not shown
View
BIN  MapsV2/Fallback/libs/android-support-v4.jar
Binary file not shown
View
20 MapsV2/Fallback/proguard-project.txt
@@ -1,20 +0,0 @@
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
View
16 MapsV2/Fallback/project.properties
@@ -1,16 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=Google Inc.:Google APIs:17
-android.library.reference.1=../../external/ActionBarSherlock
-android.library.reference.2=../../../../../../../../../opt/android-sdk-linux_x86/extras/google/google_play_services/libproject/google-play-services_lib
View
BIN  MapsV2/Fallback/res/drawable-hdpi/ic_launcher.png
Deleted file not rendered
View
BIN  MapsV2/Fallback/res/drawable-ldpi/ic_launcher.png
Deleted file not rendered
View
BIN  MapsV2/Fallback/res/drawable-mdpi/ic_launcher.png
Deleted file not rendered
View
BIN  MapsV2/Fallback/res/drawable-mdpi/marker.png
Deleted file not rendered
View
BIN  MapsV2/Fallback/res/drawable-xhdpi/ic_launcher.png
Deleted file not rendered
View
5 MapsV2/Fallback/res/layout/activity_main.xml
@@ -1,5 +0,0 @@
-<fragment xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/map"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- class="com.google.android.gms.maps.SupportMapFragment"/>
View
12 MapsV2/Fallback/res/layout/legal.xml
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <TextView
- android:id="@+id/legal"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceMedium"/>
-
-</ScrollView>
View
7 MapsV2/Fallback/res/layout/main.xml
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<fragment xmlns:android="http://schemas.android.com/apk/res/android"
- android:name="com.commonsware.android.mapsv2.fallback.MapFragment"
- android:id="@+id/map_fragment"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
-/>
View
35 MapsV2/Fallback/res/layout/popup.xml
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
-
- <ImageView
- android:id="@+id/icon"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:padding="2dip"
- android:src="@drawable/ic_launcher"
- android:contentDescription="@string/icon"/>
-
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/title"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textSize="25sp"
- android:textStyle="bold"/>
-
- <TextView
- android:id="@+id/snippet"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textSize="15sp"/>
- </LinearLayout>
-
-</LinearLayout>
View
9 MapsV2/Fallback/res/menu/activity_main.xml
@@ -1,9 +0,0 @@
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
-
- <item
- android:id="@+id/legal"
- android:orderInCategory="100"
- android:showAsAction="never"
- android:title="@string/legal"/>
-
-</menu>
View
22 MapsV2/Fallback/res/values/strings.xml
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
- <string name="app_name">MapsV2 Fallback</string>
- <string name="legal">Legal Notices</string>
- <string name="no_maps">Google Maps V2 not available!</string>
- <string name="normal">Normal</string>
- <string name="hybrid">Hybrid</string>
- <string name="satellite">Satellite</string>
- <string name="terrain">Terrain</string>
- <string name="un">UN</string>
- <string name="united_nations">United Nations</string>
- <string name="lincoln_center">Lincoln Center</string>
- <string name="lincoln_center_snippet">Home of Jazz at Lincoln Center</string>
- <string name="carnegie_hall">Carnegie Hall</string>
- <string name="practice_x3">Where you go with practice, practice, practice</string>
- <string name="downtown_club">The Downtown Club</string>
- <string name="heisman_trophy">Original home of the Heisman Trophy</string>
- <string name="icon">CommonsWare logo</string>
- <string name="no_mapping_engines">No mapping engines available!</string>
-
-</resources>
View
130 MapsV2/Fallback/src/com/commonsware/android/mapsv2/fallback/AbstractMapActivity.java
@@ -1,130 +0,0 @@
-/***
- Copyright (c) 2012 CommonsWare, LLC
- Licensed under the Apache License, Version 2.0 (the "License"); you may not
- use this file except in compliance with the License. You may obtain a copy
- of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required
- by applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- OF ANY KIND, either express or implied. See the License for the specific
- language governing permissions and limitations under the License.
-
- From _The Busy Coder's Guide to Android Development_
- http://commonsware.com/Android
- */
-
-package com.commonsware.android.mapsv2.fallback;
-
-import android.app.ActivityManager;
-import android.app.Dialog;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.os.Bundle;
-import android.support.v4.app.DialogFragment;
-import android.widget.Toast;
-import com.actionbarsherlock.app.SherlockFragmentActivity;
-import com.actionbarsherlock.view.Menu;
-import com.actionbarsherlock.view.MenuItem;
-import com.google.android.gms.common.ConnectionResult;
-import com.google.android.gms.common.GooglePlayServicesUtil;
-
-public class AbstractMapActivity extends SherlockFragmentActivity {
- protected static final String TAG_ERROR_DIALOG_FRAGMENT="errorDialog";
-
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- getSupportMenuInflater().inflate(R.menu.activity_main, menu);
-
- return(super.onCreateOptionsMenu(menu));
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- if (item.getItemId() == R.id.legal) {
- startActivity(new Intent(this, LegalNoticesActivity.class));
-
- return(true);
- }
-
- return super.onOptionsItemSelected(item);
- }
-
- protected boolean isV2Possible() {
- ActivityManager mgr=
- (ActivityManager)getSystemService(ACTIVITY_SERVICE);
-
- if (mgr.getDeviceConfigurationInfo().reqGlEsVersion >= 0x20000) {
- int status=
- GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
-
- if (status != ConnectionResult.SERVICE_INVALID) {
- return(true);
- }
- }
-
- return(false);
- }
-
- protected boolean isV1Available() {
- try {
- Class.forName("com.google.android.maps.MapActivity");
-
- return(true);
- }
- catch (Exception e) {
- // that's OK
- }
-
- return(false);
- }
-
- protected boolean prepareV2() {
- int status=
- GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
-
- if (status == ConnectionResult.SUCCESS) {
- return(true);
- }
- else if (GooglePlayServicesUtil.isUserRecoverableError(status)) {
- ErrorDialogFragment.newInstance(status)
- .show(getSupportFragmentManager(),
- TAG_ERROR_DIALOG_FRAGMENT);
- }
- else {
- Toast.makeText(this, R.string.no_maps, Toast.LENGTH_LONG).show();
- finish();
- }
-
- return(false);
- }
-
- public static class ErrorDialogFragment extends DialogFragment {
- static final String ARG_STATUS="status";
-
- static ErrorDialogFragment newInstance(int status) {
- Bundle args=new Bundle();
-
- args.putInt(ARG_STATUS, status);
-
- ErrorDialogFragment result=new ErrorDialogFragment();
-
- result.setArguments(args);
-
- return(result);
- }
-
- @Override
- public Dialog onCreateDialog(Bundle savedInstanceState) {
- Bundle args=getArguments();
-
- return GooglePlayServicesUtil.getErrorDialog(args.getInt(ARG_STATUS),
- getActivity(), 0);
- }
-
- @Override
- public void onDismiss(DialogInterface dlg) {
- if (getActivity() != null) {
- getActivity().finish();
- }
- }
- }
-}
View
32 MapsV2/Fallback/src/com/commonsware/android/mapsv2/fallback/LegalNoticesActivity.java
@@ -1,32 +0,0 @@
-/***
- Copyright (c) 2012 CommonsWare, LLC
- Licensed under the Apache License, Version 2.0 (the "License"); you may not
- use this file except in compliance with the License. You may obtain a copy
- of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required
- by applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- OF ANY KIND, either express or implied. See the License for the specific
- language governing permissions and limitations under the License.
-
- From _The Busy Coder's Guide to Android Development_
- http://commonsware.com/Android
- */
-
-package com.commonsware.android.mapsv2.fallback;
-
-import android.os.Bundle;
-import android.widget.TextView;
-import com.actionbarsherlock.app.SherlockActivity;
-import com.google.android.gms.common.GooglePlayServicesUtil;
-
-public class LegalNoticesActivity extends SherlockActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.legal);
-
- TextView legal=(TextView)findViewById(R.id.legal);
-
- legal.setText(GooglePlayServicesUtil.getOpenSourceSoftwareLicenseInfo(this));
- }
-}
View
137 MapsV2/Fallback/src/com/commonsware/android/mapsv2/fallback/MainActivity.java
@@ -1,137 +0,0 @@
-/***
- Copyright (c) 2012 CommonsWare, LLC
- Licensed under the Apache License, Version 2.0 (the "License"); you may not
- use this file except in compliance with the License. You may obtain a copy
- of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required
- by applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- OF ANY KIND, either express or implied. See the License for the specific
- language governing permissions and limitations under the License.
-
- From _The Busy Coder's Guide to Android Development_
- http://commonsware.com/Android
- */
-
-package com.commonsware.android.mapsv2.fallback;
-
-import android.content.Intent;
-import android.os.Build;
-import android.os.Bundle;
-import android.widget.ArrayAdapter;
-import android.widget.Toast;
-import java.util.ArrayList;
-import com.actionbarsherlock.app.ActionBar;
-import com.actionbarsherlock.app.ActionBar.OnNavigationListener;
-import com.google.android.gms.maps.CameraUpdate;
-import com.google.android.gms.maps.CameraUpdateFactory;
-import com.google.android.gms.maps.GoogleMap;
-import com.google.android.gms.maps.GoogleMap.OnInfoWindowClickListener;
-import com.google.android.gms.maps.SupportMapFragment;
-import com.google.android.gms.maps.model.LatLng;
-import com.google.android.gms.maps.model.Marker;
-import com.google.android.gms.maps.model.MarkerOptions;
-
-public class MainActivity extends AbstractMapActivity implements
- OnNavigationListener, OnInfoWindowClickListener {
- private static final int[] MAP_TYPE_NAMES= { R.string.normal,
- R.string.hybrid, R.string.satellite, R.string.terrain };
- private static final int[] MAP_TYPES= { GoogleMap.MAP_TYPE_NORMAL,
- GoogleMap.MAP_TYPE_HYBRID, GoogleMap.MAP_TYPE_SATELLITE,
- GoogleMap.MAP_TYPE_TERRAIN };
- private GoogleMap map=null;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- if (isV2Possible()) {
- if (prepareV2()) {
- setContentView(R.layout.activity_main);
-
- SupportMapFragment mapFrag=
- (SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map);
-
- initListNav();
-
- map=mapFrag.getMap();
-
- CameraUpdate center=
- CameraUpdateFactory.newLatLng(new LatLng(40.76793169992044,
- -73.98180484771729));
- CameraUpdate zoom=CameraUpdateFactory.zoomTo(15);
-
- map.moveCamera(center);
- map.animateCamera(zoom);
-
- addMarker(map, 40.748963847316034, -73.96807193756104,
- R.string.un, R.string.united_nations);
- addMarker(map, 40.76866299974387, -73.98268461227417,
- R.string.lincoln_center,
- R.string.lincoln_center_snippet);
- addMarker(map, 40.765136435316755, -73.97989511489868,
- R.string.carnegie_hall, R.string.practice_x3);
- addMarker(map, 40.70686417491799, -74.01572942733765,
- R.string.downtown_club, R.string.heisman_trophy);
-
- map.setInfoWindowAdapter(new PopupAdapter(getLayoutInflater()));
- map.setOnInfoWindowClickListener(this);
- }
- }
- else if (isV1Available()) {
- startActivity(new Intent(this, NooYawk.class));
- finish();
- }
- else {
- Toast.makeText(this, R.string.no_mapping_engines, Toast.LENGTH_LONG).show();
- finish();
- }
- }
-
- @Override
- public boolean onNavigationItemSelected(int itemPosition, long itemId) {
- map.setMapType(MAP_TYPES[itemPosition]);
-
- return(true);
- }
-
- @Override
- public void onInfoWindowClick(Marker marker) {
- Toast.makeText(this, marker.getTitle(), Toast.LENGTH_LONG).show();
- }
-
- private void initListNav() {
- ArrayList<String> items=new ArrayList<String>();
- ArrayAdapter<String> nav=null;
- ActionBar bar=getSupportActionBar();
-
- for (int type : MAP_TYPE_NAMES) {
- items.add(getString(type));
- }
-
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
- nav=
- new ArrayAdapter<String>(
- bar.getThemedContext(),
- android.R.layout.simple_spinner_item,
- items);
- }
- else {
- nav=
- new ArrayAdapter<String>(
- this,
- android.R.layout.simple_spinner_item,
- items);
- }
-
- nav.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
- bar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
- bar.setListNavigationCallbacks(nav, this);
- }
-
- private void addMarker(GoogleMap map, double lat, double lon,
- int title, int snippet) {
- map.addMarker(new MarkerOptions().position(new LatLng(lat, lon))
- .title(getString(title))
- .snippet(getString(snippet)));
- }
-}
View
129 MapsV2/Fallback/src/com/commonsware/android/mapsv2/fallback/MapFragment.java
@@ -1,129 +0,0 @@
-/***
- Copyright (c) 2008-2012 CommonsWare, LLC
- Licensed under the Apache License, Version 2.0 (the "License"); you may not
- use this file except in compliance with the License. You may obtain a copy
- of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required
- by applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- OF ANY KIND, either express or implied. See the License for the specific
- language governing permissions and limitations under the License.
-
- From _The Busy Coder's Guide to Android Development_
- http://commonsware.com/Android
- */
-
-package com.commonsware.android.mapsv2.fallback;
-
-import android.app.Fragment;
-import android.os.Bundle;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.FrameLayout;
-import android.widget.Toast;
-import java.util.ArrayList;
-import java.util.List;
-import com.google.android.maps.GeoPoint;
-import com.google.android.maps.ItemizedOverlay;
-import com.google.android.maps.MapView;
-import com.google.android.maps.MyLocationOverlay;
-import com.google.android.maps.OverlayItem;
-
-public class MapFragment extends Fragment {
- private MapView map=null;
- private MyLocationOverlay me=null;
-
- @Override
- public View onCreateView(LayoutInflater inflater,
- ViewGroup container,
- Bundle savedInstanceState) {
- setHasOptionsMenu(true);
-
- return(new FrameLayout(getActivity()));
- }
-
- @Override
- public void onActivityCreated(Bundle savedInstanceState) {
- super.onActivityCreated(savedInstanceState);
-
- map=
- new MapView(getActivity(),
- "0mjl6OufrY-tHs6WFurtL7rsYyEMpdEqBCbyjXg");
- map.setClickable(true);
-
- map.getController().setCenter(getPoint(40.76793169992044,
- -73.98180484771729));
- map.getController().setZoom(17);
- map.setBuiltInZoomControls(true);
-
- map.getOverlays().add(new SitesOverlay());
-
- me=new MyLocationOverlay(getActivity(), map);
- map.getOverlays().add(me);
-
- ((ViewGroup)getView()).addView(map);
- }
-
- @Override
- public void onResume() {
- super.onResume();
-
- me.enableCompass();
- }
-
- @Override
- public void onPause() {
- super.onPause();
-
- me.disableCompass();
- }
-
- private static GeoPoint getPoint(double lat, double lon) {
- return(new GeoPoint((int)(lat * 1000000.0), (int)(lon * 1000000.0)));
- }
-
- private class SitesOverlay extends ItemizedOverlay<OverlayItem> {
- private List<OverlayItem> items=new ArrayList<OverlayItem>();
-
- public SitesOverlay() {
- super(
- boundCenterBottom(getResources().getDrawable(R.drawable.marker)));
-
- items.add(new OverlayItem(getPoint(40.748963847316034,
- -73.96807193756104), "UN",
- "United Nations"));
- items.add(new OverlayItem(getPoint(40.76866299974387,
- -73.98268461227417),
- "Lincoln Center",
- "Home of Jazz at Lincoln Center"));
- items.add(new OverlayItem(getPoint(40.765136435316755,
- -73.97989511489868),
- "Carnegie Hall",
- "Where you go with practice, practice, practice"));
- items.add(new OverlayItem(getPoint(40.70686417491799,
- -74.01572942733765),
- "The Downtown Club",
- "Original home of the Heisman Trophy"));
-
- populate();
- }
-
- @Override
- protected OverlayItem createItem(int i) {
- return(items.get(i));
- }
-
- @Override
- protected boolean onTap(int i) {
- Toast.makeText(getActivity(), items.get(i).getSnippet(),
- Toast.LENGTH_LONG).show();
-
- return(true);
- }
-
- @Override
- public int size() {
- return(items.size());
- }
- }
-}
View
31 MapsV2/Fallback/src/com/commonsware/android/mapsv2/fallback/NooYawk.java
@@ -1,31 +0,0 @@
-/***
- Copyright (c) 2008-2012 CommonsWare, LLC
- Licensed under the Apache License, Version 2.0 (the "License"); you may not
- use this file except in compliance with the License. You may obtain a copy
- of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required
- by applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- OF ANY KIND, either express or implied. See the License for the specific
- language governing permissions and limitations under the License.
-
- From _The Busy Coder's Guide to Android Development_
- http://commonsware.com/Android
-*/
-
-package com.commonsware.android.mapsv2.fallback;
-
-import android.os.Bundle;
-import com.actionbarsherlock.app.SherlockMapActivity;
-
-public class NooYawk extends SherlockMapActivity {
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- }
-
- @Override
- protected boolean isRouteDisplayed() {
- return(false);
- }
-}
View
47 MapsV2/Fallback/src/com/commonsware/android/mapsv2/fallback/PopupAdapter.java
@@ -1,47 +0,0 @@
-/***
- Copyright (c) 2012 CommonsWare, LLC
- Licensed under the Apache License, Version 2.0 (the "License"); you may not
- use this file except in compliance with the License. You may obtain a copy
- of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required
- by applicable law or agreed to in writing, software distributed under the
- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- OF ANY KIND, either express or implied. See the License for the specific
- language governing permissions and limitations under the License.
-
- From _The Busy Coder's Guide to Android Development_
- http://commonsware.com/Android
- */
-
-package com.commonsware.android.mapsv2.fallback;
-
-import android.view.LayoutInflater;
-import android.view.View;
-import android.widget.TextView;
-import com.google.android.gms.maps.GoogleMap.InfoWindowAdapter;
-import com.google.android.gms.maps.model.Marker;
-
-class PopupAdapter implements InfoWindowAdapter {
- LayoutInflater inflater=null;
-
- PopupAdapter(LayoutInflater inflater) {
- this.inflater=inflater;
- }
-
- @Override
- public View getInfoWindow(Marker marker) {
- return(null);
- }
-
- @Override
- public View getInfoContents(Marker marker) {
- View popup=inflater.inflate(R.layout.popup, null);
-
- TextView tv=(TextView)popup.findViewById(R.id.title);
-
- tv.setText(marker.getTitle());
- tv=(TextView)popup.findViewById(R.id.snippet);
- tv.setText(marker.getSnippet());
-
- return(popup);
- }
-}
Please sign in to comment.
Something went wrong with that request. Please try again.