This commit is contained in:
Jon Atkins 2013-09-02 21:21:24 +01:00
commit 105a19adc3
6 changed files with 56 additions and 24 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cradle.iitc_mobile" package="com.cradle.iitc_mobile"
android:versionCode="40" android:versionCode="41"
android:versionName="0.5.6"> android:versionName="0.5.7">
<uses-sdk <uses-sdk
android:minSdkVersion="14" android:minSdkVersion="14"

View File

@ -24,10 +24,30 @@
Ingress Intel Total Conversion (IITC) userscript by <a href="https://github.com/breunigs"><b>breunigs</b></a>. Ingress Intel Total Conversion (IITC) userscript by <a href="https://github.com/breunigs"><b>breunigs</b></a>.
After Niantic asked the main developer to shut down his github project, development After Niantic asked the main developer to shut down his github project, development
is continued on a fork of <a href="https://github.com/jonatkins"><b>jonatkins</b></a>.<br><br> is continued on a fork of <a href="https://github.com/jonatkins"><b>jonatkins</b></a>.<br><br>
<b>Website:</b><br> <b>Community:</b><br>
<a href="http://iitc.jonatkins.com/">http://iitc.jonatkins.com/</a><br><br> • Visit the <a href="http://iitc.jonatkins.com/">IITC website</a> for new releases and the desktop version.<br>
<b>IITC on Github:</b><br> • Follow the <a href="https://plus.google.com/105383756361375410867">IITC Google+ page</a>
<a href="https://github.com/jonatkins/ingress-intel-total-conversion">https://github.com/jonatkins/ingress-intel-total-conversion</a>]]> for release announcements.<br>
• Join the <a href="https://plus.google.com/communities/105647403088015055797">IITC Google+ community</a>
- a place to ask for help and discuss with other users.<br><br>
<b>Developers:</b><br>
<a href="https://github.com/jonatkins/ingress-intel-total-conversion">IITC on Github</a><br><br>
<b>Licence:</b><br>
Copyright © 2013 Stefan Breunig, Philipp Schäfer, Jon Atkins and others<br><br>
Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted, provided that the
above copyright notice and this permission notice appear in all
copies.<br><br>
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
AUTHORS BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA
OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.]]>
</string> </string>
<string name="pref_ui_cat">UI</string> <string name="pref_ui_cat">UI</string>

View File

@ -13,6 +13,8 @@ import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener; import android.content.DialogInterface.OnClickListener;
import android.content.DialogInterface.OnMultiChoiceClickListener; import android.content.DialogInterface.OnMultiChoiceClickListener;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.webkit.JavascriptInterface; import android.webkit.JavascriptInterface;
@ -79,6 +81,19 @@ public class IITC_JSInterface {
.show(); .show();
} }
@JavascriptInterface
public int getVersionCode() {
int versionCode = 0;
try {
PackageInfo pInfo = mContext.getPackageManager()
.getPackageInfo(mContext.getPackageName(), 0);
versionCode = pInfo.versionCode;
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
return versionCode;
}
@JavascriptInterface @JavascriptInterface
public void switchToPane(String id) { public void switchToPane(String id) {

View File

@ -475,7 +475,7 @@ public class IITC_Mobile extends Activity {
if (!mIsLocEnabled) { if (!mIsLocEnabled) {
mIitcWebView.loadUrl("javascript: " + mIitcWebView.loadUrl("javascript: " +
"window.map.locate({setView : true, maxZoom: 15});"); "window.map.locate({setView : true, maxZoom: 15});");
// if gps location is displayed we can use a better location without any costs // if gps location is displayed we can use a better location without any costs
} else { } else {
if (mLastLocation != null) if (mLastLocation != null)
mIitcWebView.loadUrl("javascript: window.map.setView(new L.LatLng(" + mIitcWebView.loadUrl("javascript: window.map.setView(new L.LatLng(" +
@ -554,9 +554,12 @@ public class IITC_Mobile extends Activity {
// throw away all positions with accuracy > 100 meters // throw away all positions with accuracy > 100 meters
// should avoid gps glitches // should avoid gps glitches
if (loc.getAccuracy() < 100) { if (loc.getAccuracy() < 100) {
mIitcWebView.loadUrl("javascript: " // do not touch the javascript while iitc boots
+ "window.plugin.userLocation.updateLocation( " if (findViewById(R.id.imageLoading).getVisibility() == View.GONE) {
+ loc.getLatitude() + ", " + loc.getLongitude() + ");"); mIitcWebView.loadUrl("javascript: "
+ "window.plugin.userLocation.updateLocation( "
+ loc.getLatitude() + ", " + loc.getLongitude() + ");");
}
} }
} }

View File

@ -79,19 +79,13 @@ public class ShareActivity extends FragmentActivity implements ActionBar.TabList
// we merge gmaps intents with geo intents since it is not possible // we merge gmaps intents with geo intents since it is not possible
// anymore to set a labeled marker on geo intents // anymore to set a labeled marker on geo intents
ArrayList<Intent> intents = new ArrayList<Intent>(); ArrayList<Intent> intents = new ArrayList<Intent>();
DecimalFormatSymbols decFormat = new DecimalFormatSymbols();
// thx to gmaps, this only works for the decimal point separator
String gMapsUri; String gMapsUri;
if (decFormat.getDecimalSeparator() == '.') try {
try { gMapsUri = "http://maps.google.com/?daddr=" + mLl + "%20(" + URLEncoder.encode(mTitle, "UTF-8") + ")";
gMapsUri = "http://maps.google.com/maps?q=loc:" + mLl + } catch (UnsupportedEncodingException e) {
"%20(" + URLEncoder.encode(mTitle, "UTF-8") + ")&z=" + mZoom; gMapsUri = "http://maps.google.com/?daddr=" + mLl;
} catch (UnsupportedEncodingException e) { e.printStackTrace();
gMapsUri = "http://maps.google.com/maps?ll=" + mLl + "&z=" + mZoom; }
e.printStackTrace();
}
else
gMapsUri = "http://maps.google.com/maps?ll=" + mLl + "&z=" + mZoom;
Intent gMapsIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(gMapsUri)); Intent gMapsIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(gMapsUri));
intents.add(gMapsIntent); intents.add(gMapsIntent);
String geoUri = "geo:" + mLl; String geoUri = "geo:" + mLl;

View File

@ -31,10 +31,10 @@ any purpose with or without fee is hereby granted, provided that the
above copyright notice and this permission notice appear in all above copyright notice and this permission notice appear in all
copies. copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL AUTHORS BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA
OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR