more code formatting
This commit is contained in:
parent
e85a6a98ac
commit
dc22aaf4dd
@ -112,7 +112,7 @@ public class IITC_DeviceAccountLogin implements AccountManagerCallback<Bundle> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* called to start authenticating using AccountManager.
|
* called to start authenticating using AccountManager.
|
||||||
*
|
* <p/>
|
||||||
* After a token is created, AccountManager will call the run() method.
|
* After a token is created, AccountManager will call the run() method.
|
||||||
*/
|
*/
|
||||||
private void startAuthentication() {
|
private void startAuthentication() {
|
||||||
@ -164,7 +164,7 @@ public class IITC_DeviceAccountLogin implements AccountManagerCallback<Bundle> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* start authentication
|
* start authentication
|
||||||
*
|
* <p/>
|
||||||
* if we already have a username (e.g. because the existing login has timed out), we can directly start
|
* if we already have a username (e.g. because the existing login has timed out), we can directly start
|
||||||
* authentication if an account with that username is found.
|
* authentication if an account with that username is found.
|
||||||
*/
|
*/
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
package com.cradle.iitc_mobile;
|
package com.cradle.iitc_mobile;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
import org.json.JSONArray;
|
|
||||||
import org.json.JSONException;
|
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.content.ClipData;
|
import android.content.ClipData;
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
@ -18,6 +13,11 @@ import android.util.Log;
|
|||||||
import android.webkit.JavascriptInterface;
|
import android.webkit.JavascriptInterface;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import org.json.JSONArray;
|
||||||
|
import org.json.JSONException;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
// provide communication between IITC script and android app
|
// provide communication between IITC script and android app
|
||||||
public class IITC_JSInterface {
|
public class IITC_JSInterface {
|
||||||
|
|
||||||
@ -74,28 +74,22 @@ public class IITC_JSInterface {
|
|||||||
if (id.equals("map")) {
|
if (id.equals("map")) {
|
||||||
button_id = android.R.id.home;
|
button_id = android.R.id.home;
|
||||||
title = iitcm.getString(R.string.app_name);
|
title = iitcm.getString(R.string.app_name);
|
||||||
}
|
} else if (id.equals("info")) {
|
||||||
else if (id.equals("info")) {
|
|
||||||
button_id = R.id.menu_info;
|
button_id = R.id.menu_info;
|
||||||
title = "Info";
|
title = "Info";
|
||||||
}
|
} else if (id.equals("full")) {
|
||||||
else if (id.equals("full")) {
|
|
||||||
button_id = R.id.menu_full;
|
button_id = R.id.menu_full;
|
||||||
title = "Full";
|
title = "Full";
|
||||||
}
|
} else if (id.equals("compact")) {
|
||||||
else if (id.equals("compact")) {
|
|
||||||
button_id = R.id.menu_compact;
|
button_id = R.id.menu_compact;
|
||||||
title = "Compact";
|
title = "Compact";
|
||||||
}
|
} else if (id.equals("public")) {
|
||||||
else if (id.equals("public")) {
|
|
||||||
button_id = R.id.menu_public;
|
button_id = R.id.menu_public;
|
||||||
title = "Public";
|
title = "Public";
|
||||||
}
|
} else if (id.equals("faction")) {
|
||||||
else if (id.equals("faction")) {
|
|
||||||
button_id = R.id.menu_faction;
|
button_id = R.id.menu_faction;
|
||||||
title = "Faction";
|
title = "Faction";
|
||||||
}
|
} else if (id.equals("debug")) {
|
||||||
else if (id.equals("debug")) {
|
|
||||||
button_id = R.id.menu_debug;
|
button_id = R.id.menu_debug;
|
||||||
title = "Debug";
|
title = "Debug";
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
package com.cradle.iitc_mobile;
|
package com.cradle.iitc_mobile;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import android.app.ActionBar;
|
import android.app.ActionBar;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.SearchManager;
|
import android.app.SearchManager;
|
||||||
@ -31,6 +28,9 @@ import android.webkit.WebView;
|
|||||||
import android.widget.SearchView;
|
import android.widget.SearchView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class IITC_Mobile extends Activity {
|
public class IITC_Mobile extends Activity {
|
||||||
|
|
||||||
private static final int REQUEST_LOGIN = 1;
|
private static final int REQUEST_LOGIN = 1;
|
||||||
@ -92,8 +92,7 @@ public class IITC_Mobile extends Activity {
|
|||||||
if (desktop) {
|
if (desktop) {
|
||||||
setActionBarHomeEnabledWithUp(false);
|
setActionBarHomeEnabledWithUp(false);
|
||||||
actionBar.setTitle(getString(R.string.app_name));
|
actionBar.setTitle(getString(R.string.app_name));
|
||||||
}
|
} else actionBar.setHomeButtonEnabled(true);
|
||||||
else actionBar.setHomeButtonEnabled(true);
|
|
||||||
invalidateOptionsMenu();
|
invalidateOptionsMenu();
|
||||||
}
|
}
|
||||||
if (key.equals("pref_user_loc"))
|
if (key.equals("pref_user_loc"))
|
||||||
|
@ -6,7 +6,6 @@ import android.content.pm.PackageManager.NameNotFoundException;
|
|||||||
import android.content.res.AssetManager;
|
import android.content.res.AssetManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.preference.CheckBoxPreference;
|
|
||||||
import android.preference.EditTextPreference;
|
import android.preference.EditTextPreference;
|
||||||
import android.preference.ListPreference;
|
import android.preference.ListPreference;
|
||||||
import android.preference.Preference;
|
import android.preference.Preference;
|
||||||
|
@ -11,10 +11,10 @@ import android.os.Build;
|
|||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.webkit.GeolocationPermissions;
|
||||||
import android.webkit.WebChromeClient;
|
import android.webkit.WebChromeClient;
|
||||||
import android.webkit.WebSettings;
|
import android.webkit.WebSettings;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
import android.webkit.GeolocationPermissions;
|
|
||||||
|
|
||||||
@SuppressLint("SetJavaScriptEnabled")
|
@SuppressLint("SetJavaScriptEnabled")
|
||||||
public class IITC_WebView extends WebView {
|
public class IITC_WebView extends WebView {
|
||||||
@ -95,8 +95,7 @@ public class IITC_WebView extends WebView {
|
|||||||
public void loadUrl(String url) {
|
public void loadUrl(String url) {
|
||||||
// if in edit text mode, don't load javascript otherwise the keyboard closes.
|
// if in edit text mode, don't load javascript otherwise the keyboard closes.
|
||||||
HitTestResult testResult = this.getHitTestResult();
|
HitTestResult testResult = this.getHitTestResult();
|
||||||
if (url.startsWith("javascript:") && testResult != null && testResult.getType() == HitTestResult.EDIT_TEXT_TYPE)
|
if (url.startsWith("javascript:") && testResult != null && testResult.getType() == HitTestResult.EDIT_TEXT_TYPE) {
|
||||||
{
|
|
||||||
// let window.show(...) interupt input
|
// let window.show(...) interupt input
|
||||||
// window.show(...) is called if one of the action bar buttons
|
// window.show(...) is called if one of the action bar buttons
|
||||||
// is clicked
|
// is clicked
|
||||||
|
@ -23,7 +23,6 @@ import java.io.IOException;
|
|||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
public class IITC_WebViewClient extends WebViewClient {
|
public class IITC_WebViewClient extends WebViewClient {
|
||||||
private static final ByteArrayInputStream style = new ByteArrayInputStream(
|
private static final ByteArrayInputStream style = new ByteArrayInputStream(
|
||||||
@ -278,6 +277,7 @@ public class IITC_WebViewClient extends WebViewClient {
|
|||||||
}
|
}
|
||||||
return js;
|
return js;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check every external resource if it’s okay to load it and maybe replace
|
// Check every external resource if it’s okay to load it and maybe replace
|
||||||
// it
|
// it
|
||||||
// with our own content. This is used to block loading Niantic resources
|
// with our own content. This is used to block loading Niantic resources
|
||||||
|
Loading…
x
Reference in New Issue
Block a user