Import to intelij, started updating to use maps v2

This commit is contained in:
2014-08-30 11:29:50 -04:00
parent 8cc52de5f6
commit bf157e9008
18 changed files with 313 additions and 139 deletions

9
.idea/libraries/android_support_v13.xml generated Normal file
View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="android-support-v13">
<CLASSES>
<root url="jar://$PROJECT_DIR$/LocationRinger/libs/android-support-v13.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="google-play-services">
<CLASSES>
<root url="jar://$PROJECT_DIR$/google-play-services_lib/libs/google-play-services.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

125
.idea/uiDesigner.xml generated Normal file
View File

@@ -0,0 +1,125 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

View File

@@ -3,6 +3,7 @@
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="src" path="gen"/> <classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="output" path="bin/classes"/> <classpathentry kind="output" path="bin/classes"/>
</classpath> </classpath>

View File

@@ -2,10 +2,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.RickBarrette.android.LocationRinger" package="org.RickBarrette.android.LocationRinger"
android:installLocation="internalOnly" android:installLocation="internalOnly"
android:versionCode="236" android:versionCode="248"
android:versionName="ff72f9d" > android:versionName="8cc52de" >
<uses-sdk android:minSdkVersion="8" /> <uses-sdk android:minSdkVersion="11" />
<uses-feature <uses-feature
android:name="android.hardware.location" android:name="android.hardware.location"
@@ -42,9 +42,6 @@
android:icon="@drawable/ic_launcher" android:icon="@drawable/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:theme="@style/Theme.Custom" > android:theme="@style/Theme.Custom" >
<uses-library
android:name="com.google.android.maps"
android:required="true" />
<activity <activity
android:name=".ui.ListActivity" android:name=".ui.ListActivity"
@@ -60,8 +57,6 @@
</intent-filter> </intent-filter>
</activity> </activity>
<uses-library android:name="com.google.android.maps" />
<activity <activity
android:name=".ui.RingerInformationActivity" android:name=".ui.RingerInformationActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize" /> android:configChanges="keyboard|keyboardHidden|orientation|screenSize" />
@@ -140,6 +135,26 @@
<action android:name="android.bluetooth.device.action.ACL_DISCONNECTED"/> <action android:name="android.bluetooth.device.action.ACL_DISCONNECTED"/>
</intent-filter> </intent-filter>
</receiver> </receiver>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<!--
Maps V1
ricky beta release 0rKmsWMM0D-IRAEgcSZEqwZCs_8AUwxjYjj0bnA
ricky 0rKmsWMM0D-LWOndcfwrmW-S0OXlnQl2SJCMeTg
TWENTYCODES 0rKmsWMM0D-K15bEM_kwabPbNhsn4dp4rcq2q5Q
-->
<!--
Maps v2
Debug AIzaSyCSqR3sQvE957QUuSfrIgLdhmneB__ljXQ
-->
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyCSqR3sQvE957QUuSfrIgLdhmneB__ljXQ"/>
</application> </application>
</manifest> </manifest>

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="EclipseModuleManager" forced_jdk="true">
<conelement value="com.android.ide.eclipse.adt.DEPENDENCIES" />
<src_description expected_position="1">
<src_folder value="file://$MODULE_DIR$/src" expected_position="0" />
<src_folder value="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK" expected_position="1" />
<src_folder value="file://$MODULE_DIR$/gen" expected_position="2" />
<src_folder value="com.android.ide.eclipse.adt.LIBRARIES" expected_position="3" />
</src_description>
</component>
<component name="FacetManager">
<facet type="android" name="Android">
<configuration>
<option name="UPDATE_PROPERTY_FILES" value="true" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/bin/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$" type="java-resource" />
</content>
<orderEntry type="jdk" jdkName="Android 4.3 Google APIs" jdkType="Android SDK" />
<orderEntry type="module" module-name="ExceptionHandlerLib" />
<orderEntry type="module" module-name="LocationLib" />
<orderEntry type="module" module-name="google-play-services_lib" />
<orderEntry type="library" name="google-play-services" level="project" />
<orderEntry type="library" name="android-support-v13" level="project" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

Binary file not shown.

View File

@@ -7,9 +7,10 @@
# "ant.properties", and override values to adapt the script to your # "ant.properties", and override values to adapt the script to your
# project structure. # 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 #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard.cfg
# Project target. # 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

View File

@@ -296,7 +296,7 @@ public class ListActivity extends Activity implements OnItemClickListener, OnCli
@Override @Override
public void onItemClick(final AdapterView<?> arg0, final View v, final int postion, final long id) { 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() { new Thread(new Runnable() {
@Override @Override

View File

@@ -67,7 +67,6 @@ public class RingerInformationActivity extends FragmentActivity implements OnCon
/** /**
* Called when the activity is first created (non-Javadoc) * Called when the activity is first created (non-Javadoc)
* *
* @see android.support.v4.app.FragmentActivity#onCreate(android.os.Bundle)
*/ */
@SuppressLint("NewApi") @SuppressLint("NewApi")
@Override @Override

View File

@@ -6,13 +6,6 @@
*/ */
package org.RickBarrette.android.LocationRinger.ui.fragments; 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.annotation.SuppressLint;
import android.content.ContentValues; import android.content.ContentValues;
import android.content.Context; import android.content.Context;
@@ -28,6 +21,12 @@ import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ToggleButton; 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 * This fragment will used to allow the user to enter/edit ringer information

View File

@@ -6,17 +6,16 @@
*/ */
package org.RickBarrette.android.LocationRinger.ui.fragments; 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.annotation.SuppressLint;
import android.os.Bundle;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView; 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 * This is a simple extention of a fragment that will allow for storage of an id

View File

@@ -111,7 +111,7 @@ public abstract class BaseFragmentListFragment extends Fragment {
/** /**
* (non-Javadoc) * (non-Javadoc)
* *
* @see android.support.v4.app.Fragment#onActivityResult(int, int, * @see android.support.v4.app.Fragment#onActivityResult(int, int,
* android.content.Intent) * android.content.Intent)
*/ */
@@ -124,7 +124,7 @@ public abstract class BaseFragmentListFragment extends Fragment {
/** /**
* (non-Javadoc) * (non-Javadoc)
* *
* @see android.support.v4.app.ListFragment#onCreateView(android.view.LayoutInflater, * @see android.support.v4.app.ListFragment#onCreateView(android.view.LayoutInflater,
* android.view.ViewGroup, android.os.Bundle) * android.view.ViewGroup, android.os.Bundle)
*/ */

View File

@@ -6,13 +6,6 @@
*/ */
package org.RickBarrette.android.LocationRinger.ui.fragments; 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.annotation.SuppressLint;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.ContentValues; import android.content.ContentValues;
@@ -27,6 +20,12 @@ import android.view.View.OnClickListener;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.TextView; 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 * 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<Integer> mAdded; private final ArrayList<Integer> mAdded;
/** /**
* Creates a new empty feature list fragment * Creates a new .gitkeep feature list fragment
* *
* @param info * @param info
* @param listener * @param listener
@@ -228,7 +227,7 @@ public class FeatureListFragment extends BaseFragmentListFragment implements OnC
/** /**
* Called when the activity is first created (non-Javadoc) * Called when the activity is first created (non-Javadoc)
* *
* @see android.support.v4.app.Fragment#onCreate(android.os.Bundle) * @see android.support.v4.app.Fragment#onCreate(android.os.Bundle)
*/ */
@Override @Override
@@ -252,7 +251,7 @@ public class FeatureListFragment extends BaseFragmentListFragment implements OnC
/** /**
* Called when a fragment needs to be removed (non-Javadoc) * Called when a fragment needs to be removed (non-Javadoc)
* *
* @see org.RickBarrette.android.LocationRinger.FeatureRemovedListener#onFeatureRemoved(android.support.v4.app.Fragment) * @see org.RickBarrette.android.LocationRinger.FeatureRemovedListener#onFeatureRemoved(android.support.v4.app.Fragment)
*/ */
@Override @Override

View File

@@ -6,15 +6,6 @@
*/ */
package org.RickBarrette.android.LocationRinger.ui.fragments; 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.annotation.SuppressLint;
import android.content.ContentValues; import android.content.ContentValues;
import android.os.Bundle; import android.os.Bundle;
@@ -23,20 +14,21 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.CompoundButton; import android.widget.*;
import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener; 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.AndroidGPS;
import com.TwentyCodes.android.location.GeoPointLocationListener;
import com.TwentyCodes.android.location.GeoUtils; import com.TwentyCodes.android.location.GeoUtils;
import com.TwentyCodes.android.location.LatLngListener;
import com.TwentyCodes.android.location.OnLocationSelectedListener; import com.TwentyCodes.android.location.OnLocationSelectedListener;
import com.TwentyCodes.android.overlays.RadiusOverlay; 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 * 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 * @author ricky
*/ */
@SuppressLint("ValidFragment") @SuppressLint("ValidFragment")
public class LocationInfomationFragment extends Fragment implements GeoPointLocationListener, OnClickListener, OnCheckedChangeListener, OnSeekBarChangeListener, public class LocationInfomationFragment extends Fragment implements LatLngListener, OnClickListener, OnCheckedChangeListener, OnSeekBarChangeListener,
OnLocationSelectedListener, SearchRequestedListener { OnLocationSelectedListener, SearchRequestedListener {
private static final String TAG = "RingerInformationHowActivity"; private static final String TAG = "RingerInformationHowActivity";
@@ -56,7 +48,7 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca
private MapFragment mMap; private MapFragment mMap;
private ToggleButton mMapEditToggle; private ToggleButton mMapEditToggle;
private RadiusOverlay mRadiusOverlay; private RadiusOverlay mRadiusOverlay;
private GeoPoint mPoint; private LatLng mPoint;
private AndroidGPS mGPS; private AndroidGPS mGPS;
private View view; private View view;
private TextView mRadiusTextView; private TextView mRadiusTextView;
@@ -65,7 +57,6 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca
* Creates a new MapFragment * Creates a new MapFragment
* *
* @author ricky barrette * @author ricky barrette
* @param ringerInformationActivity
*/ */
public LocationInfomationFragment(final ContentValues info, final OnContentChangedListener listener, final EnableScrollingListener enabledListener) { public LocationInfomationFragment(final ContentValues info, final OnContentChangedListener listener, final EnableScrollingListener enabledListener) {
mInfo = info; mInfo = info;
@@ -85,18 +76,18 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca
if (mEnableScrollingListener != null) if (mEnableScrollingListener != null)
mEnableScrollingListener.setScrollEnabled(!isChecked); mEnableScrollingListener.setScrollEnabled(!isChecked);
if (isChecked) { // /*if (isChecked) {
mGPS.enableLocationUpdates(this); // mGPS.enableLocationUpdates(this);
mMap.enableGPSProgess(); // mMap.enableGPSProgess();
} else { // } else {
mGPS.disableLocationUpdates(); // mGPS.disableLocationUpdates();
mMap.disableGPSProgess(); // mMap.disableGPSProgess();
} // }
//
mMap.setDoubleTapZoonEnabled(isChecked); // mMap.setDoubleTapZoonEnabled(isChecked);
// buttons // // buttons
mMap.setBuiltInZoomControls(isChecked); // mMap.setBuiltInZoomControls(isChecked);
mMap.setClickable(isChecked); // mMap.setClickable(isChecked);*/
mRadius.setEnabled(isChecked); mRadius.setEnabled(isChecked);
Toast.makeText(getActivity(), isChecked ? getString(R.string.map_editing_enabled) : getString(R.string.map_editiing_disabled), Toast.LENGTH_SHORT).show(); 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; break;
case R.id.my_location: case R.id.my_location:
if (mPoint != null) if (mPoint != null)
mMap.setMapCenter(mPoint); mMap.getMap().moveCamera(CameraUpdateFactory.newLatLng(mPoint));
break; break;
case R.id.map_mode: 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; break;
case R.id.search: case R.id.search:
new SearchDialog(getActivity(), this).show(); new SearchDialog(getActivity(), this).show();
@@ -132,34 +123,39 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca
mGPS = new AndroidGPS(getActivity()); 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); mRadius = (SeekBar) view.findViewById(R.id.radius);
mRadiusTextView = (TextView) view.findViewById(R.id.radius_textview); mRadiusTextView = (TextView) view.findViewById(R.id.radius_textview);
mRadius.setMax(Constraints.MAX_RADIUS_IN_METERS); 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 = (ToggleButton) view.findViewById(R.id.map_edit_toggle);
mMapEditToggle.setChecked(false); mMapEditToggle.setChecked(false);
mMapEditToggle.setOnCheckedChangeListener(this); mMapEditToggle.setOnCheckedChangeListener(this);
mRadiusOverlay = new RadiusOverlay(); mRadiusOverlay = new RadiusOverlay();
mRadiusOverlay.setLocationSelectedListener(this); mRadiusOverlay.setLocationSelectedListener(this);
mRadius.setOnSeekBarChangeListener(this); mRadius.setOnSeekBarChangeListener(this);
mMap.addOverlay(mRadiusOverlay); mMap.getMap().addCircle(mRadiusOverlay.getCircleOptions());
mRadius.setEnabled(false); mRadius.setEnabled(false);
if (mInfo.get(RingerDatabase.KEY_LOCATION) != null) { if (mInfo.get(RingerDatabase.KEY_LOCATION) != null) {
final String[] point = mInfo.getAsString(RingerDatabase.KEY_LOCATION).split(","); 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) if (mInfo.get(RingerDatabase.KEY_RADIUS) != null)
mRadius.setProgress(mInfo.getAsInteger(RingerDatabase.KEY_RADIUS)); mRadius.setProgress(mInfo.getAsInteger(RingerDatabase.KEY_RADIUS));
if (mRadiusOverlay.getLocation() != null) { if (mRadiusOverlay.getLocation() != null) {
mMap.setMapCenter(mRadiusOverlay.getLocation()); mMap.getMap().moveCamera(CameraUpdateFactory.newLatLng(mRadiusOverlay.getLocation()));
mMap.setZoom(16); //todo zoom
// mMap.setZoom(16);
} }
mMap.setDoubleTapZoonEnabled(false); //
// mMap.setDoubleTapZoonEnabled(false);
view.findViewById(R.id.my_location).setOnClickListener(this); view.findViewById(R.id.my_location).setOnClickListener(this);
view.findViewById(R.id.mark_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) * 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 @Override
public void onFirstFix(final boolean isFirstFix) { public void onFirstFix(final boolean isFirstFix) {
if (mPoint != null) { // if (mPoint != null) {
/* // /*
* if this is the first fix and the radius overlay does not have a // * 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 // * point specified then pan the map, and zoom in to the users
* current location // * current location
*/ // */
if (isFirstFix) { // if (isFirstFix) {
mMap.disableGPSProgess(); // mMap.disableGPSProgess();
if (mRadiusOverlay.getLocation() == null) // if (mRadiusOverlay.getLocation() == null)
if (mMap != null) { // if (mMap != null) {
mMap.setMapCenter(mPoint); // mMap.setMapCenter(mPoint);
mMap.setZoom(mMap.getMap().getMaxZoomLevel() - 5); // mMap.setZoom(mMap.getMap().getMaxZoomLevel() - 5);
} // }
} // }
} else // } else
mMap.enableGPSProgess(); // mMap.enableGPSProgess();
} }
/** /**
@@ -200,17 +198,17 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca
* @author ricky barrette * @author ricky barrette
*/ */
@Override @Override
public void onLocationChanged(final GeoPoint point, final int accuracy) { public void onLocationChanged(final LatLng point, final int accuracy) {
mPoint = point; mPoint = point;
} }
/** /**
* Called when a location has been selected (non-Javadoc) * 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 @Override
public void onLocationSelected(final GeoPoint point) { public void onLocationSelected(final LatLng point) {
if (point != null) { if (point != null) {
Log.d(TAG, "onLocationSelected() " + point.toString()); Log.d(TAG, "onLocationSelected() " + point.toString());
@@ -218,7 +216,7 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca
mRadiusOverlay.setLocation(point); mRadiusOverlay.setLocation(point);
if (mMap != null) if (mMap != null)
mMap.setMapCenter(point); mMap.getMap().moveCamera(CameraUpdateFactory.newLatLng(point));
if (mListener != null) { if (mListener != null) {
final ContentValues info = new ContentValues(); final ContentValues info = new ContentValues();
@@ -232,7 +230,6 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca
/** /**
* (non-Javadoc) * (non-Javadoc)
* *
* @see android.support.v4.app.Fragment#onPause()
*/ */
@Override @Override
public void onPause() { public void onPause() {
@@ -251,7 +248,8 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca
case R.id.radius: case R.id.radius:
mRadiusTextView.setText(GeoUtils.distanceToString(Float.valueOf(progress) / 1000, true)); mRadiusTextView.setText(GeoUtils.distanceToString(Float.valueOf(progress) / 1000, true));
mRadiusOverlay.setRadius(progress); mRadiusOverlay.setRadius(progress);
mMap.invalidate(); //todo invalidate this shit
// mMap.invalidate();
if (mListener != null) { if (mListener != null) {
final ContentValues info = new ContentValues(); final ContentValues info = new ContentValues();
info.put(RingerDatabase.KEY_RADIUS, progress); info.put(RingerDatabase.KEY_RADIUS, progress);
@@ -264,7 +262,6 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca
/** /**
* (non-Javadoc) * (non-Javadoc)
* *
* @see android.support.v4.app.Fragment#onResume()
*/ */
@Override @Override
public void onResume() { public void onResume() {

View File

@@ -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
}
}

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android" name="Android">
<configuration>
<option name="LIBRARY_PROJECT" value="true" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="Android 4.3 Google APIs" jdkType="Android SDK" />
<orderEntry type="library" name="google-play-services" level="project" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>