diff --git a/.idea/libraries/android_support_v13.xml b/.idea/libraries/android_support_v13.xml new file mode 100644 index 0000000..da83257 --- /dev/null +++ b/.idea/libraries/android_support_v13.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/google_play_services.xml b/.idea/libraries/google_play_services.xml new file mode 100644 index 0000000..70d7068 --- /dev/null +++ b/.idea/libraries/google_play_services.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..3b00020 --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LocationRinger/.classpath b/LocationRinger/.classpath index fc68d0c..413ce3d 100644 --- a/LocationRinger/.classpath +++ b/LocationRinger/.classpath @@ -3,6 +3,7 @@ - + + diff --git a/LocationRinger/AndroidManifest.xml b/LocationRinger/AndroidManifest.xml index ce111c9..fafa2f5 100644 --- a/LocationRinger/AndroidManifest.xml +++ b/LocationRinger/AndroidManifest.xml @@ -2,10 +2,10 @@ + android:versionCode="248" + android:versionName="8cc52de" > - + - - - @@ -140,6 +135,26 @@ + + + + + + + + \ No newline at end of file diff --git a/LocationRinger/LocationRinger.iml b/LocationRinger/LocationRinger.iml new file mode 100644 index 0000000..f51daf2 --- /dev/null +++ b/LocationRinger/LocationRinger.iml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LocationRinger/libs/android-support-v13.jar b/LocationRinger/libs/android-support-v13.jar new file mode 100644 index 0000000..e2ea95a Binary files /dev/null and b/LocationRinger/libs/android-support-v13.jar differ diff --git a/LocationRinger/project.properties b/LocationRinger/project.properties index 3e47f6c..72b53b0 100644 --- a/LocationRinger/project.properties +++ b/LocationRinger/project.properties @@ -7,9 +7,10 @@ # "ant.properties", and override values to adapt the script to your # project structure. -android.library.reference.1=../exception_handler_library/ExceptionHandlerLib -android.library.reference.2=../location_library/LocationLib #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard.cfg # Project target. -target=Google Inc.:Google APIs:17 +target=Google Inc.:Google APIs:18 +android.library.reference.1=../exception_handler_library/ExceptionHandlerLib +android.library.reference.2=../location_library/LocationLib +android.library.reference.3=../google-play-services_lib diff --git a/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/ListActivity.java b/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/ListActivity.java index bc076a3..93c80aa 100644 --- a/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/ListActivity.java +++ b/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/ListActivity.java @@ -296,7 +296,7 @@ public class ListActivity extends Activity implements OnItemClickListener, OnCli @Override public void onItemClick(final AdapterView arg0, final View v, final int postion, final long id) { - final ProgressDialog progress = ProgressDialog.show(this, "", getText(R.string.loading), true, true); + final ProgressDialog progress = null; //ProgressDialog.show(this.getParent(), "", getText(R.string.loading), true, true); new Thread(new Runnable() { @Override diff --git a/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/RingerInformationActivity.java b/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/RingerInformationActivity.java index 5f23904..798671d 100644 --- a/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/RingerInformationActivity.java +++ b/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/RingerInformationActivity.java @@ -67,7 +67,6 @@ public class RingerInformationActivity extends FragmentActivity implements OnCon /** * Called when the activity is first created (non-Javadoc) * - * @see android.support.v4.app.FragmentActivity#onCreate(android.os.Bundle) */ @SuppressLint("NewApi") @Override diff --git a/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/fragments/AboutRingerFragment.java b/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/fragments/AboutRingerFragment.java index 602c007..3d77682 100644 --- a/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/fragments/AboutRingerFragment.java +++ b/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/fragments/AboutRingerFragment.java @@ -6,13 +6,6 @@ */ package org.RickBarrette.android.LocationRinger.ui.fragments; -import java.util.Map.Entry; - -import org.RickBarrette.android.LocationRinger.Log; -import org.RickBarrette.android.LocationRinger.OnContentChangedListener; -import org.RickBarrette.android.LocationRinger.R; -import org.RickBarrette.android.LocationRinger.db.RingerDatabase; - import android.annotation.SuppressLint; import android.content.ContentValues; import android.content.Context; @@ -28,6 +21,12 @@ import android.widget.CompoundButton; import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.EditText; import android.widget.ToggleButton; +import org.RickBarrette.android.LocationRinger.Log; +import org.RickBarrette.android.LocationRinger.OnContentChangedListener; +import org.RickBarrette.android.LocationRinger.R; +import org.RickBarrette.android.LocationRinger.db.RingerDatabase; + +import java.util.Map.Entry; /** * This fragment will used to allow the user to enter/edit ringer information diff --git a/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/fragments/BaseFeatureFragment.java b/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/fragments/BaseFeatureFragment.java index b347d60..b3c308b 100644 --- a/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/fragments/BaseFeatureFragment.java +++ b/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/fragments/BaseFeatureFragment.java @@ -6,17 +6,16 @@ */ package org.RickBarrette.android.LocationRinger.ui.fragments; -import org.RickBarrette.android.LocationRinger.FeatureRemovedListener; -import org.RickBarrette.android.LocationRinger.R; - import android.annotation.SuppressLint; -import android.os.Bundle; import android.support.v4.app.Fragment; +import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.ImageView; +import org.RickBarrette.android.LocationRinger.FeatureRemovedListener; +import org.RickBarrette.android.LocationRinger.R; /** * This is a simple extention of a fragment that will allow for storage of an id diff --git a/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/fragments/BaseFragmentListFragment.java b/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/fragments/BaseFragmentListFragment.java index 4d66f56..a7d8665 100644 --- a/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/fragments/BaseFragmentListFragment.java +++ b/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/fragments/BaseFragmentListFragment.java @@ -111,7 +111,7 @@ public abstract class BaseFragmentListFragment extends Fragment { /** * (non-Javadoc) - * + * * @see android.support.v4.app.Fragment#onActivityResult(int, int, * android.content.Intent) */ @@ -124,7 +124,7 @@ public abstract class BaseFragmentListFragment extends Fragment { /** * (non-Javadoc) - * + * * @see android.support.v4.app.ListFragment#onCreateView(android.view.LayoutInflater, * android.view.ViewGroup, android.os.Bundle) */ diff --git a/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/fragments/FeatureListFragment.java b/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/fragments/FeatureListFragment.java index 0c75d3a..b103917 100644 --- a/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/fragments/FeatureListFragment.java +++ b/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/fragments/FeatureListFragment.java @@ -6,13 +6,6 @@ */ package org.RickBarrette.android.LocationRinger.ui.fragments; -import java.util.ArrayList; - -import org.RickBarrette.android.LocationRinger.FeatureRemovedListener; -import org.RickBarrette.android.LocationRinger.OnContentChangedListener; -import org.RickBarrette.android.LocationRinger.R; -import org.RickBarrette.android.LocationRinger.db.RingerDatabase; - import android.annotation.SuppressLint; import android.app.AlertDialog; import android.content.ContentValues; @@ -27,6 +20,12 @@ import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.TextView; +import org.RickBarrette.android.LocationRinger.FeatureRemovedListener; +import org.RickBarrette.android.LocationRinger.OnContentChangedListener; +import org.RickBarrette.android.LocationRinger.R; +import org.RickBarrette.android.LocationRinger.db.RingerDatabase; + +import java.util.ArrayList; /** * This fragment will be used to display a list of features @@ -48,7 +47,7 @@ public class FeatureListFragment extends BaseFragmentListFragment implements OnC private final ArrayList mAdded; /** - * Creates a new empty feature list fragment + * Creates a new .gitkeep feature list fragment * * @param info * @param listener @@ -228,7 +227,7 @@ public class FeatureListFragment extends BaseFragmentListFragment implements OnC /** * Called when the activity is first created (non-Javadoc) - * + * * @see android.support.v4.app.Fragment#onCreate(android.os.Bundle) */ @Override @@ -252,7 +251,7 @@ public class FeatureListFragment extends BaseFragmentListFragment implements OnC /** * Called when a fragment needs to be removed (non-Javadoc) - * + * * @see org.RickBarrette.android.LocationRinger.FeatureRemovedListener#onFeatureRemoved(android.support.v4.app.Fragment) */ @Override diff --git a/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/fragments/LocationInfomationFragment.java b/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/fragments/LocationInfomationFragment.java index 8cb92e9..6e3a5d6 100644 --- a/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/fragments/LocationInfomationFragment.java +++ b/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/fragments/LocationInfomationFragment.java @@ -6,15 +6,6 @@ */ package org.RickBarrette.android.LocationRinger.ui.fragments; -import org.RickBarrette.android.LocationRinger.Constraints; -import org.RickBarrette.android.LocationRinger.EnableScrollingListener; -import org.RickBarrette.android.LocationRinger.Log; -import org.RickBarrette.android.LocationRinger.OnContentChangedListener; -import org.RickBarrette.android.LocationRinger.R; -import org.RickBarrette.android.LocationRinger.SearchRequestedListener; -import org.RickBarrette.android.LocationRinger.db.RingerDatabase; -import org.RickBarrette.android.LocationRinger.ui.SearchDialog; - import android.annotation.SuppressLint; import android.content.ContentValues; import android.os.Bundle; @@ -23,20 +14,21 @@ import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; -import android.widget.CompoundButton; +import android.widget.*; import android.widget.CompoundButton.OnCheckedChangeListener; -import android.widget.SeekBar; import android.widget.SeekBar.OnSeekBarChangeListener; -import android.widget.TextView; -import android.widget.Toast; -import android.widget.ToggleButton; - import com.TwentyCodes.android.location.AndroidGPS; -import com.TwentyCodes.android.location.GeoPointLocationListener; import com.TwentyCodes.android.location.GeoUtils; +import com.TwentyCodes.android.location.LatLngListener; import com.TwentyCodes.android.location.OnLocationSelectedListener; import com.TwentyCodes.android.overlays.RadiusOverlay; -import com.google.android.maps.GeoPoint; +import com.google.android.gms.maps.CameraUpdateFactory; +import com.google.android.gms.maps.GoogleMap; +import com.google.android.gms.maps.MapFragment; +import com.google.android.gms.maps.model.LatLng; +import org.RickBarrette.android.LocationRinger.*; +import org.RickBarrette.android.LocationRinger.db.RingerDatabase; +import org.RickBarrette.android.LocationRinger.ui.SearchDialog; /** * This fragment will be used to display and allow the user to edit the ringers @@ -45,7 +37,7 @@ import com.google.android.maps.GeoPoint; * @author ricky */ @SuppressLint("ValidFragment") -public class LocationInfomationFragment extends Fragment implements GeoPointLocationListener, OnClickListener, OnCheckedChangeListener, OnSeekBarChangeListener, +public class LocationInfomationFragment extends Fragment implements LatLngListener, OnClickListener, OnCheckedChangeListener, OnSeekBarChangeListener, OnLocationSelectedListener, SearchRequestedListener { private static final String TAG = "RingerInformationHowActivity"; @@ -56,7 +48,7 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca private MapFragment mMap; private ToggleButton mMapEditToggle; private RadiusOverlay mRadiusOverlay; - private GeoPoint mPoint; + private LatLng mPoint; private AndroidGPS mGPS; private View view; private TextView mRadiusTextView; @@ -65,7 +57,6 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca * Creates a new MapFragment * * @author ricky barrette - * @param ringerInformationActivity */ public LocationInfomationFragment(final ContentValues info, final OnContentChangedListener listener, final EnableScrollingListener enabledListener) { mInfo = info; @@ -85,18 +76,18 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca if (mEnableScrollingListener != null) mEnableScrollingListener.setScrollEnabled(!isChecked); - if (isChecked) { - mGPS.enableLocationUpdates(this); - mMap.enableGPSProgess(); - } else { - mGPS.disableLocationUpdates(); - mMap.disableGPSProgess(); - } - - mMap.setDoubleTapZoonEnabled(isChecked); - // buttons - mMap.setBuiltInZoomControls(isChecked); - mMap.setClickable(isChecked); +// /*if (isChecked) { +// mGPS.enableLocationUpdates(this); +// mMap.enableGPSProgess(); +// } else { +// mGPS.disableLocationUpdates(); +// mMap.disableGPSProgess(); +// } +// +// mMap.setDoubleTapZoonEnabled(isChecked); +// // buttons +// mMap.setBuiltInZoomControls(isChecked); +// mMap.setClickable(isChecked);*/ mRadius.setEnabled(isChecked); Toast.makeText(getActivity(), isChecked ? getString(R.string.map_editing_enabled) : getString(R.string.map_editiing_disabled), Toast.LENGTH_SHORT).show(); } @@ -115,10 +106,10 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca break; case R.id.my_location: if (mPoint != null) - mMap.setMapCenter(mPoint); + mMap.getMap().moveCamera(CameraUpdateFactory.newLatLng(mPoint)); break; case R.id.map_mode: - mMap.setSatellite(mMap.isSatellite() ? false : true); + mMap.getMap().setMapType(mMap.getMap().getMapType() == GoogleMap.MAP_TYPE_NORMAL ? GoogleMap.MAP_TYPE_NORMAL : GoogleMap.MAP_TYPE_SATELLITE); break; case R.id.search: new SearchDialog(getActivity(), this).show(); @@ -132,34 +123,39 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca mGPS = new AndroidGPS(getActivity()); - mMap = (MapFragment) getFragmentManager().findFragmentById(R.id.mapview); +// mMap = (MapFragment) getFragmentManager().findFragmentById(R.id.mapview); mRadius = (SeekBar) view.findViewById(R.id.radius); mRadiusTextView = (TextView) view.findViewById(R.id.radius_textview); mRadius.setMax(Constraints.MAX_RADIUS_IN_METERS); - mMap.setClickable(false); + + //TODO extend GoogleMap to intercept clicks +// mMap.setClickable(false); + mMapEditToggle = (ToggleButton) view.findViewById(R.id.map_edit_toggle); mMapEditToggle.setChecked(false); mMapEditToggle.setOnCheckedChangeListener(this); mRadiusOverlay = new RadiusOverlay(); mRadiusOverlay.setLocationSelectedListener(this); mRadius.setOnSeekBarChangeListener(this); - mMap.addOverlay(mRadiusOverlay); + mMap.getMap().addCircle(mRadiusOverlay.getCircleOptions()); mRadius.setEnabled(false); if (mInfo.get(RingerDatabase.KEY_LOCATION) != null) { final String[] point = mInfo.getAsString(RingerDatabase.KEY_LOCATION).split(","); - mRadiusOverlay.setLocation(new GeoPoint(Integer.parseInt(point[0]), Integer.parseInt(point[1]))); + mRadiusOverlay.setLocation(new LatLng(Integer.parseInt(point[0]), Integer.parseInt(point[1]))); } if (mInfo.get(RingerDatabase.KEY_RADIUS) != null) mRadius.setProgress(mInfo.getAsInteger(RingerDatabase.KEY_RADIUS)); if (mRadiusOverlay.getLocation() != null) { - mMap.setMapCenter(mRadiusOverlay.getLocation()); - mMap.setZoom(16); + mMap.getMap().moveCamera(CameraUpdateFactory.newLatLng(mRadiusOverlay.getLocation())); + //todo zoom +// mMap.setZoom(16); } - mMap.setDoubleTapZoonEnabled(false); + // +// mMap.setDoubleTapZoonEnabled(false); view.findViewById(R.id.my_location).setOnClickListener(this); view.findViewById(R.id.mark_my_location).setOnClickListener(this); @@ -171,27 +167,29 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca /** * Called when the location is a first fix (non-Javadoc) + * + * todo fix this * - * @see com.TwentyCodes.android.location.GeoPointLocationListener#onFirstFix(boolean) + * @see com.TwentyCodes.android.location.LatLngListener#onFirstFix(boolean) */ @Override public void onFirstFix(final boolean isFirstFix) { - if (mPoint != null) { - /* - * if this is the first fix and the radius overlay does not have a - * point specified then pan the map, and zoom in to the users - * current location - */ - if (isFirstFix) { - mMap.disableGPSProgess(); - if (mRadiusOverlay.getLocation() == null) - if (mMap != null) { - mMap.setMapCenter(mPoint); - mMap.setZoom(mMap.getMap().getMaxZoomLevel() - 5); - } - } - } else - mMap.enableGPSProgess(); +// if (mPoint != null) { +// /* +// * if this is the first fix and the radius overlay does not have a +// * point specified then pan the map, and zoom in to the users +// * current location +// */ +// if (isFirstFix) { +// mMap.disableGPSProgess(); +// if (mRadiusOverlay.getLocation() == null) +// if (mMap != null) { +// mMap.setMapCenter(mPoint); +// mMap.setZoom(mMap.getMap().getMaxZoomLevel() - 5); +// } +// } +// } else +// mMap.enableGPSProgess(); } /** @@ -200,17 +198,17 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca * @author ricky barrette */ @Override - public void onLocationChanged(final GeoPoint point, final int accuracy) { + public void onLocationChanged(final LatLng point, final int accuracy) { mPoint = point; } /** * Called when a location has been selected (non-Javadoc) * - * @see com.TwentyCodes.android.location.OnLocationSelectedListener#onLocationSelected(com.google.android.maps.GeoPoint) +// * @see com.TwentyCodes.android.location.OnLocationSelectedListener#onLocationSelected(com.google.android.maps.GeoPoint) */ @Override - public void onLocationSelected(final GeoPoint point) { + public void onLocationSelected(final LatLng point) { if (point != null) { Log.d(TAG, "onLocationSelected() " + point.toString()); @@ -218,7 +216,7 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca mRadiusOverlay.setLocation(point); if (mMap != null) - mMap.setMapCenter(point); + mMap.getMap().moveCamera(CameraUpdateFactory.newLatLng(point)); if (mListener != null) { final ContentValues info = new ContentValues(); @@ -232,7 +230,6 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca /** * (non-Javadoc) * - * @see android.support.v4.app.Fragment#onPause() */ @Override public void onPause() { @@ -251,7 +248,8 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca case R.id.radius: mRadiusTextView.setText(GeoUtils.distanceToString(Float.valueOf(progress) / 1000, true)); mRadiusOverlay.setRadius(progress); - mMap.invalidate(); + //todo invalidate this shit +// mMap.invalidate(); if (mListener != null) { final ContentValues info = new ContentValues(); info.put(RingerDatabase.KEY_RADIUS, progress); @@ -264,7 +262,6 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca /** * (non-Javadoc) * - * @see android.support.v4.app.Fragment#onResume() */ @Override public void onResume() { diff --git a/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/fragments/MapFragment.java b/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/fragments/MapFragment.java deleted file mode 100644 index 7210882..0000000 --- a/LocationRinger/src/org/RickBarrette/android/LocationRinger/ui/fragments/MapFragment.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * MapFragment.java - * @date May 12, 2012 - * @author ricky barrette - * @author Twenty Codes, LLC - */ -package org.RickBarrette.android.LocationRinger.ui.fragments; - -import com.TwentyCodes.android.fragments.BaseMapFragment; -import com.TwentyCodes.android.location.MapView; - -/** - * @author ricky barrette - */ -public class MapFragment extends BaseMapFragment { - - /** - * - * @author ricky barrette - */ - public MapFragment() { - // TODO Auto-generated constructor stub - } - - /** - * (non-Javadoc) - * - * @see com.TwentyCodes.android.fragments.BaseMapFragment#onMapViewCreate(com.TwentyCodes.android.location.MapView) - */ - @Override - public void onMapViewCreate(final MapView map) { - // TODO Auto-generated method stub - - } - -} diff --git a/exception_handler_library b/exception_handler_library index ab75dd3..6b9cbde 160000 --- a/exception_handler_library +++ b/exception_handler_library @@ -1 +1 @@ -Subproject commit ab75dd3bb19fa67ba536a9b397adf8e8c46f0d8c +Subproject commit 6b9cbdef84c0e79d58571e4dcac436e370e0b1df diff --git a/google-play-services_lib/google-play-services_lib.iml b/google-play-services_lib/google-play-services_lib.iml new file mode 100644 index 0000000..cefdb8c --- /dev/null +++ b/google-play-services_lib/google-play-services_lib.iml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + +