reformat code

This commit is contained in:
Philipp Schaefer
2013-10-22 20:05:58 +02:00
parent 7fae77099f
commit 3d7192ecd6
12 changed files with 120 additions and 66 deletions

View File

@@ -133,8 +133,10 @@ public class IITC_Mobile extends Activity implements OnSharedPreferenceChangeLis
|| key.equals("pref_share_selected_tab")
|| key.equals("pref_messages")
|| key.equals("pref_external_storage"))
// no reload needed
// no reload needed
{
return;
}
mReloadNeeded = true;
}
@@ -233,8 +235,9 @@ public class IITC_Mobile extends Activity implements OnSharedPreferenceChangeLis
// parts[0] may contain an 'uncertainty' parameter, delimited by a semicolon
String[] pos = parts[0].split(";", 2)[0].split(",", 2);
if (pos.length != 2)
if (pos.length != 2) {
throw new URISyntaxException(uri.toString(), "URI does not contain a valid position");
}
try {
lat = Double.valueOf(pos[0]);
@@ -262,8 +265,9 @@ public class IITC_Mobile extends Activity implements OnSharedPreferenceChangeLis
}
String url = "http://www.ingress.com/intel?ll=" + lat + "," + lon;
if (z != null)
if (z != null) {
url += "&z=" + z;
}
this.loadUrl(url);
}
@@ -298,8 +302,9 @@ public class IITC_Mobile extends Activity implements OnSharedPreferenceChangeLis
Log.d("iitcm", "stopping iitcm");
mIitcWebView.loadUrl("javascript: window.idleSet();");
if (mIsLocEnabled)
if (mIsLocEnabled) {
mLocMngr.removeUpdates(this);
}
super.onStop();
}
@@ -383,10 +388,11 @@ public class IITC_Mobile extends Activity implements OnSharedPreferenceChangeLis
// ensure no double adds
if (pane == mCurrentPane) return;
if (mBackStackPush)
if (mBackStackPush) {
mBackStack.push(mCurrentPane);
else
} else {
mBackStackPush = true;
}
mCurrentPane = pane;
mNavigationHelper.switchTo(pane);
@@ -433,8 +439,9 @@ public class IITC_Mobile extends Activity implements OnSharedPreferenceChangeLis
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (mNavigationHelper.onOptionsItemSelected(item))
if (mNavigationHelper.onOptionsItemSelected(item)) {
return true;
}
// Handle item selection
final int itemId = item.getItemId();
@@ -462,10 +469,11 @@ public class IITC_Mobile extends Activity implements OnSharedPreferenceChangeLis
"window.map.locate({setView : true, maxZoom: 15});");
// if gps location is displayed we can use a better location without any costs
} else {
if (mLastLocation != null)
if (mLastLocation != null) {
mIitcWebView.loadUrl("javascript: window.map.setView(new L.LatLng(" +
mLastLocation.getLatitude() + "," +
mLastLocation.getLongitude() + "), 15);");
}
}
return true;
case R.id.action_settings: // start settings activity
@@ -511,10 +519,11 @@ public class IITC_Mobile extends Activity implements OnSharedPreferenceChangeLis
// vp=f enables mDesktopMode mode...vp=m is the defaul mobile view
private String addUrlParam(String url) {
if (mDesktopMode)
if (mDesktopMode) {
return (url + "?vp=f");
else
} else {
return (url + "?vp=m");
}
}
// inject the iitc-script and load the intel url