updated mobile README

This commit is contained in:
Philipp Schaefer 2014-03-31 14:57:33 +02:00
parent 16212b2032
commit c2823c7dab
4 changed files with 18 additions and 21 deletions

View File

@ -1,5 +1,3 @@
<component name="CopyrightManager"> <component name="CopyrightManager">
<settings default=""> <settings default="" />
<module2copyright />
</settings>
</component> </component>

View File

@ -1,9 +1,8 @@
How does this basically work? How does this basically work?
----------------------------- -----------------------------
At the moment, the Android App is a WebView which renders the normal web page. The IITC script is injected by calling ```iitc_view.loadIITC_JS(Context)```. The app uses a local version of the script, which is located in the assets folder, if no external source is given (see "pref\_iitc\_source"). At the moment, the Android App is a WebView which renders the normal web page. The IITC script is injected by calling ```iitc_view.loadIITC_JS(Context)```. The app uses a local version of the script, which is located in the assets folder.
Communication from app to script is handled by loading Javascript function calls. For example: ```iitc_view.loadUrl("javascript: window.alert('foo');");```
Communication from app to script is handled by loading Javascript function calls. For example: ```iitc_view.loadUrl("javascript: window.goBack();");```
Communication from script to app is handled by the JavascriptInterface (see /mobile/src/com/cradle/iitc\_mobile/IITC_JSInterface.java). If a method ```foo(String)``` is defined in JSInterface, it can be called by ```android.foo("Hello World")``` in the IITC script. Communication from script to app is handled by the JavascriptInterface (see /mobile/src/com/cradle/iitc\_mobile/IITC_JSInterface.java). If a method ```foo(String)``` is defined in JSInterface, it can be called by ```android.foo("Hello World")``` in the IITC script.

View File

@ -1,11 +1,13 @@
ingress intel total conversion mobile (IITCM) ingress intel total conversion mobile (IITCm)
===================================== =====================================
The Android App behaves like the desktop version, but uses the mobile view, which is optimized for mobile devices, as default. Furthermore, there are some nice additions: The Android App behaves like the desktop version, but uses the mobile view, which is optimized for mobile devices, as default. Furthermore, there are some nice additions:
- it should be much faster than the standard mobile ingress intel map - it should be much faster than the standard mobile ingress intel map
- plugin support - supports all official IITC plugins
- easy installation of unofficial plugins (installation via plugin preference, click on *.user.js file or URL, email attachement etc.)
- show users current location - show users current location
@ -13,17 +15,13 @@ The Android App behaves like the desktop version, but uses the mobile view, whic
- a geolocate button (you have to enable GPS satellites + location access to use this feature) - a geolocate button (you have to enable GPS satellites + location access to use this feature)
- possibility to use a custom IITC script source
- a click on Portal link copies it to clipboard
- in-app layer chooser
- in-app IITC buttons
- in-app search - in-app search
- support for unofficial plugins. Just copy the *.user.js files to ```<storage_path>/IITC_Mobile/plugins/``` and they should appear at the top of the plugin list. Note: For every option a new persistent database entry is created. If you want to remove a plugin from your external storage you want to ensure that it is disabled in the settings, otherwise IITCM will always try to load it on start-up. If you messed this up you can wipe app data or add the plugin back to storage, disable it and remove it. Another option would be: Do nothing...it should work even so. - configurable fullscreen modes (includes immersive mode on Android 4.4+)
- navigation drawers for IITC views, layer chooser and highlighters
- in-app screenshots
- developer mode: all script source will be loaded from ```<storage_path>/IITC_Mobile/dev/``` - developer mode: all script source will be loaded from ```<storage_path>/IITC_Mobile/dev/```

View File

@ -72,8 +72,8 @@ window.plugin.portalLevelNumbers.addLabel = function(guid,latLng) {
window.plugin.portalLevelNumbers.updatePortalLabels = function() { window.plugin.portalLevelNumbers.updatePortalLabels = function() {
var SQUARE_SIZE = L.Browser.mobile ? (window.plugin.portalLevelNumbers.ICON_SIZE + 3) * window.plugin.portalLevelNumbers.MOBILE_SCALE var SQUARE_SIZE = L.Browser.mobile ? (window.plugin.portalLevelNumbers.ICON_SIZE) * window.plugin.portalLevelNumbers.MOBILE_SCALE
: (window.plugin.portalLevelNumbers.ICON_SIZE + 3); : (window.plugin.portalLevelNumbers.ICON_SIZE);
// as this is called every time layers are toggled, there's no point in doing it when the layer is off // as this is called every time layers are toggled, there's no point in doing it when the layer is off
if (!map.hasLayer(window.plugin.portalLevelNumbers.levelLayerGroup)) { if (!map.hasLayer(window.plugin.portalLevelNumbers.levelLayerGroup)) {
@ -96,9 +96,11 @@ window.plugin.portalLevelNumbers.updatePortalLabels = function() {
var point = portalPoints[guid]; var point = portalPoints[guid];
var bucketId = L.point([Math.floor(point.x/(SQUARE_SIZE*2)),Math.floor(point.y/SQUARE_SIZE*2)]); var bucketId = L.point([Math.floor(point.x/(SQUARE_SIZE*2)),Math.floor(point.y/SQUARE_SIZE*2)]);
// the guid is added to four buckets. this way, when testing for overlap we don't need to test // the guid is added to all eight neighbour buckets. this way, when testing for overlap we don't need to test
// all 8 buckets surrounding the one around the particular portal, only the bucket it is in itself // all 8 buckets surrounding the one around the particular portal, only the bucket it is in itself
var bucketIds = [bucketId, bucketId.add([1,0]), bucketId.add([0,1]), bucketId.add([1,1])]; var bucketIds = [bucketId, bucketId.add([1,0]), bucketId.add([0,1]), bucketId.add([1,1]),
bucketId.subtract([1,0]), bucketId.subtract([0,1]), bucketId.subtract([1,1]),
bucketId.add([-1,1]), bucketId.add([1,-1])];
for (var i in bucketIds) { for (var i in bucketIds) {
var b = bucketIds[i].toString(); var b = bucketIds[i].toString();
if (!buckets[b]) buckets[b] = {}; if (!buckets[b]) buckets[b] = {};