@@ -437,7 +437,7 @@ private HashMap<String, String> parseFeature(String optString) {
437
437
if (option .hasMoreElements ()) {
438
438
String key = option .nextToken ();
439
439
String value = option .nextToken ();
440
- if (!customizableOptions .contains (key )){
440
+ if (!customizableOptions .contains (key )) {
441
441
value = value .equals ("yes" ) || value .equals ("no" ) ? value : "yes" ;
442
442
}
443
443
map .put (key , value );
@@ -616,7 +616,7 @@ private boolean getShowLocationBar() {
616
616
return this .showLocationBar ;
617
617
}
618
618
619
- private InAppBrowser getInAppBrowser (){
619
+ private InAppBrowser getInAppBrowser () {
620
620
return this ;
621
621
}
622
622
@@ -730,7 +730,7 @@ private int dpToPixels(int dipValue) {
730
730
return value ;
731
731
}
732
732
733
- private View createCloseButton (int id ){
733
+ private View createCloseButton (int id ) {
734
734
View _close ;
735
735
Resources activityRes = cordova .getActivity ().getResources ();
736
736
@@ -906,9 +906,9 @@ public boolean onKey(View v, int keyCode, KeyEvent event) {
906
906
// Footer
907
907
RelativeLayout footer = new RelativeLayout (cordova .getActivity ());
908
908
int _footerColor ;
909
- if (footerColor != "" ){
909
+ if (footerColor != "" ) {
910
910
_footerColor = Color .parseColor (footerColor );
911
- }else {
911
+ } else {
912
912
_footerColor = android .graphics .Color .LTGRAY ;
913
913
}
914
914
footer .setBackgroundColor (_footerColor );
@@ -1208,26 +1208,26 @@ public boolean shouldOverrideUrlLoading(String url, String method) {
1208
1208
1209
1209
if (beforeload .equals ("yes" ) && method == null ) {
1210
1210
useBeforeload = true ;
1211
- }else if (beforeload .equals ("yes" )
1211
+ } else if (beforeload .equals ("yes" )
1212
1212
//TODO handle POST requests then this condition can be removed:
1213
1213
&& !method .equals ("POST" ))
1214
1214
{
1215
1215
useBeforeload = true ;
1216
- }else if (beforeload .equals ("get" ) && (method == null || method .equals ("GET" ))){
1216
+ } else if (beforeload .equals ("get" ) && (method == null || method .equals ("GET" ))) {
1217
1217
useBeforeload = true ;
1218
- }else if (beforeload .equals ("post" ) && (method == null || method .equals ("POST" ))){
1218
+ } else if (beforeload .equals ("post" ) && (method == null || method .equals ("POST" ))) {
1219
1219
//TODO handle POST requests
1220
1220
errorMessage = "beforeload doesn't yet support POST requests" ;
1221
1221
}
1222
1222
1223
1223
// On first URL change, initiate JS callback. Only after the beforeload event, continue.
1224
1224
if (useBeforeload && this .waitForBeforeload ) {
1225
- if (sendBeforeLoad (url , method )){
1225
+ if (sendBeforeLoad (url , method )) {
1226
1226
return true ;
1227
1227
}
1228
1228
}
1229
1229
1230
- if (errorMessage != null ){
1230
+ if (errorMessage != null ) {
1231
1231
try {
1232
1232
LOG .e (LOG_TAG , errorMessage );
1233
1233
JSONObject obj = new JSONObject ();
@@ -1236,7 +1236,7 @@ public boolean shouldOverrideUrlLoading(String url, String method) {
1236
1236
obj .put ("code" , -1 );
1237
1237
obj .put ("message" , errorMessage );
1238
1238
sendUpdate (obj , true , PluginResult .Status .ERROR );
1239
- }catch (Exception e ){
1239
+ } catch (Exception e ) {
1240
1240
LOG .e (LOG_TAG , "Error sending loaderror for " + url + ": " + e .toString ());
1241
1241
}
1242
1242
}
@@ -1322,12 +1322,12 @@ else if (!url.startsWith("http:") && !url.startsWith("https:") && url.matches("^
1322
1322
return override ;
1323
1323
}
1324
1324
1325
- private boolean sendBeforeLoad (String url , String method ){
1325
+ private boolean sendBeforeLoad (String url , String method ) {
1326
1326
try {
1327
1327
JSONObject obj = new JSONObject ();
1328
- obj .put ("type" , "beforeload" );
1328
+ obj .put ("type" , BEFORELOAD );
1329
1329
obj .put ("url" , url );
1330
- if (method != null ){
1330
+ if (method != null ) {
1331
1331
obj .put ("method" , method );
1332
1332
}
1333
1333
sendUpdate (obj , true );
@@ -1365,7 +1365,7 @@ public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceReque
1365
1365
return shouldInterceptRequest (request .getUrl ().toString (), super .shouldInterceptRequest (view , request ), request .getMethod ());
1366
1366
}
1367
1367
1368
- public WebResourceResponse shouldInterceptRequest (String url , WebResourceResponse response , String method ){
1368
+ public WebResourceResponse shouldInterceptRequest (String url , WebResourceResponse response , String method ) {
1369
1369
return response ;
1370
1370
}
1371
1371
@@ -1406,13 +1406,11 @@ public void onPageStarted(WebView view, String url, Bitmap favicon) {
1406
1406
}
1407
1407
}
1408
1408
1409
-
1410
-
1411
1409
public void onPageFinished (WebView view , String url ) {
1412
1410
super .onPageFinished (view , url );
1413
1411
1414
1412
// Set the namespace for postMessage()
1415
- if (Build .VERSION .SDK_INT >= android .os .Build .VERSION_CODES .JELLY_BEAN_MR1 ){
1413
+ if (Build .VERSION .SDK_INT >= android .os .Build .VERSION_CODES .JELLY_BEAN_MR1 ) {
1416
1414
injectDeferredObject ("window.webkit={messageHandlers:{cordova_iab:cordova_iab}}" , null );
1417
1415
}
1418
1416
0 commit comments