Updated Shortcut icons to use new launcher icon.

removed skyhook location services from mapview

fixed map progress wheel
This commit is contained in:
2012-07-23 00:52:54 -04:00
parent 79873c8efc
commit 1e45d7911a
6 changed files with 26 additions and 82 deletions

View File

@@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.TwentyCodes.android.LocationRinger"
android:installLocation="internalOnly"
android:versionCode="76"
android:versionName="0cf56e8" >
android:versionCode="80"
android:versionName="79873c8" >
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16"/>

View File

@@ -131,7 +131,7 @@ public class CheckLocationShortcut extends Activity {
final Intent intent = new Intent();
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
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);
// Now, return the result to the launcher

View File

@@ -37,14 +37,10 @@ import com.TwentyCodes.android.LocationRinger.db.RingerDatabase;
import com.TwentyCodes.android.LocationRinger.debug.Debug;
import com.TwentyCodes.android.LocationRinger.receivers.PassiveLocationChangedReceiver;
import com.TwentyCodes.android.LocationRinger.services.LocationService;
import com.TwentyCodes.android.SkyHook.SkyHookRegistration;
import com.TwentyCodes.android.location.PassiveLocationListener;
import com.skyhookwireless.wps.RegistrationCallback;
import com.skyhookwireless.wps.WPSContinuation;
import com.skyhookwireless.wps.WPSReturnCode;
@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 ListView mListView;
@@ -52,7 +48,6 @@ public class ListActivity extends Activity implements OnItemClickListener, OnCli
private ProgressDialog mProgress;
private Dialog mSplashDialog;
public static final String NO_SPLASH = "no splash";
public static final String KEY_RINGER = "key_ringer";
public static final String KEY_INFO = "key_info";
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";
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)
*
@@ -187,12 +166,6 @@ public class ListActivity extends Activity implements OnItemClickListener, OnCli
if (mSettings.getBoolean(SettingsActivity.IS_FIRST_BOOT, true))
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.equals(ACTION_NEW_RINGER))
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();
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
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);
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);
// }
}

View File

@@ -190,7 +190,7 @@ public class RingerInformationActivity extends FragmentActivity implements OnCon
save();
break;
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);
return true;
}

View File

@@ -185,7 +185,7 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
public boolean onOptionsItemSelected(final MenuItem item) {
switch (item.getItemId()) {
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);
return true;
}

View File

@@ -29,7 +29,7 @@ import com.TwentyCodes.android.LocationRinger.SearchRequestedListener;
import com.TwentyCodes.android.LocationRinger.db.RingerDatabase;
import com.TwentyCodes.android.LocationRinger.debug.Debug;
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.OnLocationSelectedListener;
import com.TwentyCodes.android.overlays.RadiusOverlay;
@@ -54,7 +54,7 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca
private ToggleButton mMapEditToggle;
private RadiusOverlay mRadiusOverlay;
private GeoPoint mPoint;
private SkyHook mSkyHook;
private AndroidGPS mGPS;
private View view;
/**
@@ -81,10 +81,13 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca
if (mEnableScrollingListener != null)
mEnableScrollingListener.setScrollEnabled(!isChecked);
if (isChecked)
mSkyHook.getUpdates();
else
mSkyHook.removeUpdates();
if (isChecked) {
mGPS.enableLocationUpdates(this);
mMap.enableGPSProgess();
} else {
mGPS.disableLocationUpdates();
mMap.disableGPSProgess();
}
mMap.setDoubleTapZoonEnabled(isChecked);
// buttons
@@ -123,8 +126,7 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca
public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) {
view = inflater.inflate(R.layout.map_info_fragment, container, false);
mSkyHook = new SkyHook(getActivity());
mSkyHook.setLocationListener(this);
mGPS = new AndroidGPS(getActivity());
mMap = (MapFragment) getFragmentManager().findFragmentById(R.id.mapview);
mRadius = (SeekBar) view.findViewById(R.id.radius);
@@ -169,23 +171,22 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca
*/
@Override
public void onFirstFix(final boolean isFirstFix) {
if (isFirstFix)
mMap.enableGPSProgess();
else
mMap.disableGPSProgess();
if (mPoint != null)
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)
if (isFirstFix) {
mMap.disableGPSProgess();
if (mRadiusOverlay.getLocation() == null)
if (mMap != null) {
mMap.setMapCenter(mPoint);
mMap.setZoom(mMap.getMap().getMaxZoomLevel() - 5);
}
}
} else
mMap.enableGPSProgess();
}
/**
@@ -231,7 +232,7 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca
*/
@Override
public void onPause() {
mSkyHook.removeUpdates();
mGPS.disableLocationUpdates();
super.onPause();
}
@@ -263,7 +264,7 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca
@Override
public void onResume() {
if (mMapEditToggle.isChecked())
mSkyHook.getUpdates();
mGPS.enableLocationUpdates(this);
super.onResume();
}
@@ -291,7 +292,7 @@ public class LocationInfomationFragment extends Fragment implements GeoPointLoca
*/
@Override
public void onStop() {
mSkyHook.removeUpdates();
mGPS.disableLocationUpdates();
super.onDestroy();
}