Hide drawer while loading

This commit is contained in:
fkloft
2013-09-22 18:50:40 +02:00
parent 5884619024
commit 94b1663df6
3 changed files with 95 additions and 78 deletions

View File

@@ -505,7 +505,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) {
showSplashScreen();
setLoadingState(true);
url = addUrlParam(url);
loadIITC();
mIitcWebView.loadUrl(url);
@@ -577,7 +577,7 @@ public class IITC_Mobile extends Activity {
public void loginSucceeded() {
// garbage collection
mLogin = null;
showSplashScreen();
setLoadingState(true);
}
// disable/enable some menu buttons...
@@ -611,10 +611,15 @@ public class IITC_Mobile extends Activity {
}
}
public void showSplashScreen() {
if (!mSharedPrefs.getBoolean("pref_disable_splash", false)) {
public void setLoadingState(boolean isLoading) {
mNavigationHelper.setLoadingState(isLoading);
if (isLoading && !mSharedPrefs.getBoolean("pref_disable_splash", false)) {
findViewById(R.id.iitc_webview).setVisibility(View.GONE);
findViewById(R.id.imageLoading).setVisibility(View.VISIBLE);
} else {
findViewById(R.id.iitc_webview).setVisibility(View.VISIBLE);
findViewById(R.id.imageLoading).setVisibility(View.GONE);
}
}