- added developer preference to disable splash screen
- disable splash screen on login screen
This commit is contained in:
parent
e2ab17fa81
commit
f342aeab0a
3
mobile/.idea/compiler.xml
generated
3
mobile/.idea/compiler.xml
generated
@ -2,6 +2,9 @@
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<option name="DEFAULT_COMPILER" value="Javac" />
|
||||
<excludeFromCompile>
|
||||
<directory url="file://$PROJECT_DIR$/gen" includeSubdirectories="true" />
|
||||
</excludeFromCompile>
|
||||
<resourceExtensions />
|
||||
<wildcardResourcePatterns>
|
||||
<entry name="!?*.java" />
|
||||
|
@ -2,7 +2,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.cradle.iitc_mobile"
|
||||
android:versionCode="31"
|
||||
android:versionName="0.5.0">
|
||||
android:versionName="0.5">
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="14"
|
||||
|
@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @id iitc-plugin-user-location@cradle
|
||||
// @name IITC plugin: User Location
|
||||
// @version 0.1.1.@@DATETIMEVERSION@@
|
||||
// @version 0.1.2.@@DATETIMEVERSION@@
|
||||
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
|
||||
// @updateURL @@UPDATEURL@@
|
||||
// @downloadURL @@DOWNLOADURL@@
|
||||
|
@ -50,6 +50,7 @@
|
||||
<string name="pref_enable_dev_mode">Enable developer mode</string>
|
||||
<string name="pref_enable_dev_mode_sum">If enabled, all IITC sources will be loaded from external storage of the Android device.
|
||||
Please copy all sources from $IITC_folder/build/mobile/ to /sdcard/IITC_Mobile/dev/.</string>
|
||||
<string name="pref_disable_splash">Disable Splash Screen</string>
|
||||
<string name="pref_select_iitc">IITC source</string>
|
||||
<string name="pref_select_iitc_sum">Load IITC main script from url or use local script. Currently used source:</string>
|
||||
|
||||
|
@ -67,6 +67,11 @@
|
||||
android:summary="@string/pref_enable_dev_mode_sum"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:key="pref_disable_splash"
|
||||
android:title="@string/pref_disable_splash"
|
||||
android:defaultValue="false" />
|
||||
|
||||
<ListPreference
|
||||
android:key="pref_build_version"
|
||||
android:title="@string/build_version"
|
||||
|
@ -464,8 +464,7 @@ public class IITC_Mobile extends Activity {
|
||||
// inject the iitc-script and load the intel url
|
||||
// plugins are injected onPageFinished
|
||||
public void loadUrl(String url) {
|
||||
findViewById(R.id.imageLoading).setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.iitc_webview).setVisibility(View.GONE);
|
||||
showSplashScreen();
|
||||
url = addUrlParam(url);
|
||||
loadIITC();
|
||||
iitc_view.loadUrl(url);
|
||||
@ -483,8 +482,6 @@ public class IITC_Mobile extends Activity {
|
||||
}
|
||||
|
||||
public void toggleFullscreen() {
|
||||
// TODO: Figure out how to handle this with new back stack?
|
||||
|
||||
if (fullscreen_mode) {
|
||||
if (fullscreen_actionbar)
|
||||
this.getActionBar().show();
|
||||
@ -546,6 +543,7 @@ public class IITC_Mobile extends Activity {
|
||||
public void loginSucceeded() {
|
||||
// garbage collection
|
||||
mLogin = null;
|
||||
showSplashScreen();
|
||||
}
|
||||
|
||||
// disable/enable some menu buttons...
|
||||
@ -578,4 +576,11 @@ public class IITC_Mobile extends Activity {
|
||||
dialogStack.remove(id);
|
||||
}
|
||||
}
|
||||
|
||||
public void showSplashScreen() {
|
||||
if (!sharedPref.getBoolean("pref_disable_splash", false)) {
|
||||
findViewById(R.id.iitc_webview).setVisibility(View.GONE);
|
||||
findViewById(R.id.imageLoading).setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import android.net.http.SslError;
|
||||
import android.os.Environment;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.webkit.SslErrorHandler;
|
||||
import android.webkit.WebResourceResponse;
|
||||
import android.webkit.WebSettings;
|
||||
@ -150,8 +151,11 @@ public class IITC_WebViewClient extends WebViewClient {
|
||||
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
Log.d("iitcm", "injecting iitc..");
|
||||
view.loadUrl("javascript: " + this.js);
|
||||
if (url.startsWith("http://www.ingress.com/intel")
|
||||
|| url.startsWith("https://www.ingress.com/intel")) {
|
||||
Log.d("iitcm", "injecting iitc..");
|
||||
view.loadUrl("javascript: " + this.js);
|
||||
}
|
||||
super.onPageFinished(view, url);
|
||||
}
|
||||
|
||||
@ -288,6 +292,18 @@ public class IITC_WebViewClient extends WebViewClient {
|
||||
return js;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadResource(WebView view, String url) {
|
||||
if(url.contains("css/basic.css")) {
|
||||
Log.d("iitcm", "basic.css received...should be ingress intel login");
|
||||
// get rid of loading screen to log in
|
||||
IITC_Mobile iitc = (IITC_Mobile) context;
|
||||
iitc.findViewById(R.id.iitc_webview).setVisibility(View.VISIBLE);
|
||||
iitc.findViewById(R.id.imageLoading).setVisibility(View.GONE);
|
||||
}
|
||||
super.onLoadResource(view, url);
|
||||
}
|
||||
|
||||
// Check every external resource if it’s okay to load it and maybe replace
|
||||
// it
|
||||
// with our own content. This is used to block loading Niantic resources
|
||||
|
Loading…
x
Reference in New Issue
Block a user