Updated Shortcut icons to use new launcher icon.
removed skyhook location services from mapview fixed map progress wheel
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.TwentyCodes.android.LocationRinger"
|
package="com.TwentyCodes.android.LocationRinger"
|
||||||
android:installLocation="internalOnly"
|
android:installLocation="internalOnly"
|
||||||
android:versionCode="76"
|
android:versionCode="80"
|
||||||
android:versionName="0cf56e8" >
|
android:versionName="79873c8" >
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16"/>
|
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16"/>
|
||||||
|
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ public class CheckLocationShortcut extends Activity {
|
|||||||
final Intent intent = new Intent();
|
final Intent intent = new Intent();
|
||||||
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
|
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
|
||||||
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.start_location_service));
|
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.start_location_service));
|
||||||
final Parcelable iconResource = Intent.ShortcutIconResource.fromContext(this, R.drawable.icon);
|
final Parcelable iconResource = Intent.ShortcutIconResource.fromContext(this, R.drawable.ic_launcher);
|
||||||
intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource);
|
intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource);
|
||||||
|
|
||||||
// Now, return the result to the launcher
|
// Now, return the result to the launcher
|
||||||
|
|||||||
@@ -37,14 +37,10 @@ import com.TwentyCodes.android.LocationRinger.db.RingerDatabase;
|
|||||||
import com.TwentyCodes.android.LocationRinger.debug.Debug;
|
import com.TwentyCodes.android.LocationRinger.debug.Debug;
|
||||||
import com.TwentyCodes.android.LocationRinger.receivers.PassiveLocationChangedReceiver;
|
import com.TwentyCodes.android.LocationRinger.receivers.PassiveLocationChangedReceiver;
|
||||||
import com.TwentyCodes.android.LocationRinger.services.LocationService;
|
import com.TwentyCodes.android.LocationRinger.services.LocationService;
|
||||||
import com.TwentyCodes.android.SkyHook.SkyHookRegistration;
|
|
||||||
import com.TwentyCodes.android.location.PassiveLocationListener;
|
import com.TwentyCodes.android.location.PassiveLocationListener;
|
||||||
import com.skyhookwireless.wps.RegistrationCallback;
|
|
||||||
import com.skyhookwireless.wps.WPSContinuation;
|
|
||||||
import com.skyhookwireless.wps.WPSReturnCode;
|
|
||||||
|
|
||||||
@SuppressLint("Registered")
|
@SuppressLint("Registered")
|
||||||
public class ListActivity extends Activity implements OnItemClickListener, OnClickListener, DatabaseListener, RegistrationCallback {
|
public class ListActivity extends Activity implements OnItemClickListener, OnClickListener, DatabaseListener {
|
||||||
|
|
||||||
private RingerDatabase mDb;
|
private RingerDatabase mDb;
|
||||||
private ListView mListView;
|
private ListView mListView;
|
||||||
@@ -52,7 +48,6 @@ public class ListActivity extends Activity implements OnItemClickListener, OnCli
|
|||||||
private ProgressDialog mProgress;
|
private ProgressDialog mProgress;
|
||||||
private Dialog mSplashDialog;
|
private Dialog mSplashDialog;
|
||||||
|
|
||||||
public static final String NO_SPLASH = "no splash";
|
|
||||||
public static final String KEY_RINGER = "key_ringer";
|
public static final String KEY_RINGER = "key_ringer";
|
||||||
public static final String KEY_INFO = "key_info";
|
public static final String KEY_INFO = "key_info";
|
||||||
public static final String KEY_IS_DEFAULT = "key_is_default";
|
public static final String KEY_IS_DEFAULT = "key_is_default";
|
||||||
@@ -61,22 +56,6 @@ public class ListActivity extends Activity implements OnItemClickListener, OnCli
|
|||||||
private static final String KEY_ROWID = "key_row_id";
|
private static final String KEY_ROWID = "key_row_id";
|
||||||
public static final String ACTION_NEW_RINGER = "action_new_ringer";
|
public static final String ACTION_NEW_RINGER = "action_new_ringer";
|
||||||
|
|
||||||
@Override
|
|
||||||
public void done() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public WPSContinuation handleError(final WPSReturnCode arg0) {
|
|
||||||
Toast.makeText(this, R.string.skyhook_error_registration, Toast.LENGTH_SHORT).show();
|
|
||||||
return WPSContinuation.WPS_CONTINUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handleSuccess() {
|
|
||||||
Toast.makeText(this, R.string.registered, Toast.LENGTH_SHORT).show();
|
|
||||||
mSettings.edit().putBoolean(SettingsActivity.IS_REGISTERED, true).commit();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* called when the note edit activity finishes (non-Javadoc)
|
* called when the note edit activity finishes (non-Javadoc)
|
||||||
*
|
*
|
||||||
@@ -187,12 +166,6 @@ public class ListActivity extends Activity implements OnItemClickListener, OnCli
|
|||||||
if (mSettings.getBoolean(SettingsActivity.IS_FIRST_BOOT, true))
|
if (mSettings.getBoolean(SettingsActivity.IS_FIRST_BOOT, true))
|
||||||
new FirstBootDialog(this).show();
|
new FirstBootDialog(this).show();
|
||||||
|
|
||||||
if (!mSettings.getBoolean(SettingsActivity.IS_REGISTERED, false))
|
|
||||||
new SkyHookRegistration(this).registerNewUser(this);
|
|
||||||
|
|
||||||
// if(!this.getIntent().hasExtra(NO_SPLASH))
|
|
||||||
// showSplashScreen();
|
|
||||||
|
|
||||||
if (action != null)
|
if (action != null)
|
||||||
if (action.equals(ACTION_NEW_RINGER))
|
if (action.equals(ACTION_NEW_RINGER))
|
||||||
startActivityForResult(new Intent(this, RingerInformationActivity.class), ACTIVITY_CREATE);
|
startActivityForResult(new Intent(this, RingerInformationActivity.class), ACTIVITY_CREATE);
|
||||||
@@ -418,38 +391,8 @@ public class ListActivity extends Activity implements OnItemClickListener, OnCli
|
|||||||
final Intent intent = new Intent();
|
final Intent intent = new Intent();
|
||||||
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
|
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
|
||||||
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.new_ringer));
|
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.new_ringer));
|
||||||
final Parcelable iconResource = Intent.ShortcutIconResource.fromContext(this, R.drawable.icon);
|
final Parcelable iconResource = Intent.ShortcutIconResource.fromContext(this, R.drawable.ic_launcher);
|
||||||
intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource);
|
intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource);
|
||||||
setResult(RESULT_OK, intent);
|
setResult(RESULT_OK, intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
|
||||||
// * Shows the splash screen over the full Activity
|
|
||||||
// */
|
|
||||||
// protected void showSplashScreen() {
|
|
||||||
// // mMap.setGPSDialogEnabled(false);
|
|
||||||
// mSplashDialog = new Dialog(this, android.R.style.Theme_Translucent);
|
|
||||||
// mSplashDialog.setContentView(R.layout.powered_by_skyhook);
|
|
||||||
// mSplashDialog.setCancelable(false);
|
|
||||||
// mSplashDialog.show();
|
|
||||||
//
|
|
||||||
// // Set Runnable to remove splash screen just in case
|
|
||||||
// final Handler handler = new Handler();
|
|
||||||
// handler.postDelayed(new Runnable() {
|
|
||||||
// @Override
|
|
||||||
// public void run() {
|
|
||||||
// removeSplashScreen();
|
|
||||||
//
|
|
||||||
// /*
|
|
||||||
// * uncomment the following to display the eula
|
|
||||||
// */
|
|
||||||
// // //loads first boot dialog if this is the first boot
|
|
||||||
// // if (! mSettings.getBoolean(Settings.ACCEPTED, false) ||
|
|
||||||
// Debug.FORCE_FIRSTBOOT_DIALOG)
|
|
||||||
// // eulaAlert();
|
|
||||||
// // else
|
|
||||||
// // update();
|
|
||||||
// }
|
|
||||||
// }, 2000);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
@@ -190,7 +190,7 @@ public class RingerInformationActivity extends FragmentActivity implements OnCon
|
|||||||
save();
|
save();
|
||||||
break;
|
break;
|
||||||
case android.R.id.home:
|
case android.R.id.home:
|
||||||
final Intent intent = new Intent(this, this.getClass()).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP).putExtra(ListActivity.NO_SPLASH, ListActivity.NO_SPLASH);
|
final Intent intent = new Intent(this, ListActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
|
|||||||
public boolean onOptionsItemSelected(final MenuItem item) {
|
public boolean onOptionsItemSelected(final MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case android.R.id.home:
|
case android.R.id.home:
|
||||||
final Intent intent = new Intent(this, ListActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP).putExtra(ListActivity.NO_SPLASH, ListActivity.NO_SPLASH);
|
final Intent intent = new Intent(this, ListActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import com.TwentyCodes.android.LocationRinger.SearchRequestedListener;
|
|||||||
import com.TwentyCodes.android.LocationRinger.db.RingerDatabase;
|
import com.TwentyCodes.android.LocationRinger.db.RingerDatabase;
|
||||||
import com.TwentyCodes.android.LocationRinger.debug.Debug;
|
import com.TwentyCodes.android.LocationRinger.debug.Debug;
|
||||||
import com.TwentyCodes.android.LocationRinger.ui.SearchDialog;
|
import com.TwentyCodes.android.LocationRinger.ui.SearchDialog;
|
||||||
import com.TwentyCodes.android.SkyHook.SkyHook;
|
import com.TwentyCodes.android.location.AndroidGPS;
|
||||||
import com.TwentyCodes.android.location.GeoPointLocationListener;
|
import com.TwentyCodes.android.location.GeoPointLocationListener;
|
||||||
import com.TwentyCodes.android.location.OnLocationSelectedListener;
|
import com.TwentyCodes.android.location.OnLocationSelectedListener;
|
||||||
import com.TwentyCodes.android.overlays.RadiusOverlay;
|
import com.TwentyCodes.android.overlays.RadiusOverlay;
|
||||||
@@ -54,7 +54,7 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca
|
|||||||
private ToggleButton mMapEditToggle;
|
private ToggleButton mMapEditToggle;
|
||||||
private RadiusOverlay mRadiusOverlay;
|
private RadiusOverlay mRadiusOverlay;
|
||||||
private GeoPoint mPoint;
|
private GeoPoint mPoint;
|
||||||
private SkyHook mSkyHook;
|
private AndroidGPS mGPS;
|
||||||
private View view;
|
private View view;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -81,10 +81,13 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca
|
|||||||
if (mEnableScrollingListener != null)
|
if (mEnableScrollingListener != null)
|
||||||
mEnableScrollingListener.setScrollEnabled(!isChecked);
|
mEnableScrollingListener.setScrollEnabled(!isChecked);
|
||||||
|
|
||||||
if (isChecked)
|
if (isChecked) {
|
||||||
mSkyHook.getUpdates();
|
mGPS.enableLocationUpdates(this);
|
||||||
else
|
mMap.enableGPSProgess();
|
||||||
mSkyHook.removeUpdates();
|
} else {
|
||||||
|
mGPS.disableLocationUpdates();
|
||||||
|
mMap.disableGPSProgess();
|
||||||
|
}
|
||||||
|
|
||||||
mMap.setDoubleTapZoonEnabled(isChecked);
|
mMap.setDoubleTapZoonEnabled(isChecked);
|
||||||
// buttons
|
// buttons
|
||||||
@@ -123,8 +126,7 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca
|
|||||||
public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) {
|
public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) {
|
||||||
view = inflater.inflate(R.layout.map_info_fragment, container, false);
|
view = inflater.inflate(R.layout.map_info_fragment, container, false);
|
||||||
|
|
||||||
mSkyHook = new SkyHook(getActivity());
|
mGPS = new AndroidGPS(getActivity());
|
||||||
mSkyHook.setLocationListener(this);
|
|
||||||
|
|
||||||
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);
|
||||||
@@ -169,23 +171,22 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onFirstFix(final boolean isFirstFix) {
|
public void onFirstFix(final boolean isFirstFix) {
|
||||||
if (isFirstFix)
|
if (mPoint != null){
|
||||||
mMap.enableGPSProgess();
|
|
||||||
else
|
|
||||||
mMap.disableGPSProgess();
|
|
||||||
|
|
||||||
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();
|
||||||
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
|
||||||
|
mMap.enableGPSProgess();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -231,7 +232,7 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onPause() {
|
public void onPause() {
|
||||||
mSkyHook.removeUpdates();
|
mGPS.disableLocationUpdates();
|
||||||
super.onPause();
|
super.onPause();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,7 +264,7 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca
|
|||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
if (mMapEditToggle.isChecked())
|
if (mMapEditToggle.isChecked())
|
||||||
mSkyHook.getUpdates();
|
mGPS.enableLocationUpdates(this);
|
||||||
super.onResume();
|
super.onResume();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -291,7 +292,7 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onStop() {
|
public void onStop() {
|
||||||
mSkyHook.removeUpdates();
|
mGPS.disableLocationUpdates();
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user