remove unused imports and fields; code formatting
This commit is contained in:
parent
dc25b820d7
commit
7f82671276
@ -2,7 +2,6 @@ package com.cradle.iitc_mobile;
|
|||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.net.ConnectivityManager;
|
import android.net.ConnectivityManager;
|
||||||
@ -13,9 +12,6 @@ import android.util.AttributeSet;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.webkit.ConsoleMessage;
|
|
||||||
import android.webkit.GeolocationPermissions;
|
|
||||||
import android.webkit.WebChromeClient;
|
|
||||||
import android.webkit.WebSettings;
|
import android.webkit.WebSettings;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
@ -131,7 +127,7 @@ public class IITC_WebView extends WebView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// disable splash screen if a http error code is responded
|
// disable splash screen if a http error code is responded
|
||||||
new CheckHttpResponse(mJsInterface, mIitc).execute(url);
|
new CheckHttpResponse(mIitc).execute(url);
|
||||||
Log.d("iitcm", "loading url: " + url);
|
Log.d("iitcm", "loading url: " + url);
|
||||||
super.loadUrl(url);
|
super.loadUrl(url);
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
package com.cradle.iitc_mobile.async;
|
package com.cradle.iitc_mobile.async;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.content.Context;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.cradle.iitc_mobile.IITC_JSInterface;
|
|
||||||
import com.cradle.iitc_mobile.IITC_Mobile;
|
import com.cradle.iitc_mobile.IITC_Mobile;
|
||||||
|
|
||||||
import org.apache.http.HttpResponse;
|
import org.apache.http.HttpResponse;
|
||||||
@ -24,12 +22,10 @@ import java.io.IOException;
|
|||||||
*/
|
*/
|
||||||
public class CheckHttpResponse extends AsyncTask<String, Void, Boolean> {
|
public class CheckHttpResponse extends AsyncTask<String, Void, Boolean> {
|
||||||
|
|
||||||
private final IITC_JSInterface mJsInterface;
|
private final IITC_Mobile mIitc;
|
||||||
private final Context mContext;
|
|
||||||
|
|
||||||
public CheckHttpResponse(IITC_JSInterface jsInterface, Context c) {
|
public CheckHttpResponse(IITC_Mobile iitc) {
|
||||||
mContext = c;
|
mIitc = iitc;
|
||||||
mJsInterface = jsInterface;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -43,11 +39,10 @@ public class CheckHttpResponse extends AsyncTask<String, Void, Boolean> {
|
|||||||
int code = response.getStatusLine().getStatusCode();
|
int code = response.getStatusLine().getStatusCode();
|
||||||
if (code != HttpStatus.SC_OK) {
|
if (code != HttpStatus.SC_OK) {
|
||||||
Log.d("iitcm", "received error code: " + code);
|
Log.d("iitcm", "received error code: " + code);
|
||||||
final IITC_Mobile iitc = (IITC_Mobile) mContext;
|
mIitc.runOnUiThread(new Runnable() {
|
||||||
iitc.runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
iitc.setLoadingState(false);
|
mIitc.setLoadingState(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// TODO: remove when google login issue is fixed
|
// TODO: remove when google login issue is fixed
|
||||||
@ -68,7 +63,7 @@ public class CheckHttpResponse extends AsyncTask<String, Void, Boolean> {
|
|||||||
protected void onPostExecute(Boolean aBoolean) {
|
protected void onPostExecute(Boolean aBoolean) {
|
||||||
if (aBoolean) {
|
if (aBoolean) {
|
||||||
Log.d("iitcm", "google auth error, redirecting to work-around page");
|
Log.d("iitcm", "google auth error, redirecting to work-around page");
|
||||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(mContext);
|
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(mIitc);
|
||||||
|
|
||||||
// set title
|
// set title
|
||||||
alertDialogBuilder.setTitle("LOGIN FAILED!");
|
alertDialogBuilder.setTitle("LOGIN FAILED!");
|
||||||
@ -86,8 +81,7 @@ public class CheckHttpResponse extends AsyncTask<String, Void, Boolean> {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
dialog.cancel();
|
dialog.cancel();
|
||||||
IITC_Mobile iitc_mobile = (IITC_Mobile) mContext;
|
mIitc.reloadIITC();
|
||||||
iitc_mobile.reloadIITC();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user