Repository: cordova-plugin-inappbrowser
Updated Branches:
  refs/heads/master e785533ab -> 2c4bef1f9


Amazon specific changes:
Removed reference to closebuttoncaption according to
https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-inappbrowser.git;a=commit;h=50a78baf22843b0df96ccb4ca83a45bd9ef3fc39


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/commit/2c4bef1f
Tree: 
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/2c4bef1f
Diff: 
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/2c4bef1f

Branch: refs/heads/master
Commit: 2c4bef1f9729ace12c9c42f985510df4600312d8
Parents: e785533
Author: Ajitha <[email protected]>
Authored: Thu Oct 30 19:54:43 2014 +0530
Committer: Archana Naik <[email protected]>
Committed: Sat Nov 22 12:08:22 2014 -0800

----------------------------------------------------------------------
 src/amazon/InAppBrowser.java | 23 +++++------------------
 1 file changed, 5 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/2c4bef1f/src/amazon/InAppBrowser.java
----------------------------------------------------------------------
diff --git a/src/amazon/InAppBrowser.java b/src/amazon/InAppBrowser.java
index 250a58c..cdcf49e 100644
--- a/src/amazon/InAppBrowser.java
+++ b/src/amazon/InAppBrowser.java
@@ -81,7 +81,6 @@ public class InAppBrowser extends CordovaPlugin {
     private static final String LOAD_START_EVENT = "loadstart";
     private static final String LOAD_STOP_EVENT = "loadstop";
     private static final String LOAD_ERROR_EVENT = "loaderror";
-    private static final String CLOSE_BUTTON_CAPTION = "closebuttoncaption";
     private static final String CLEAR_ALL_CACHE = "clearcache";
     private static final String CLEAR_SESSION_CACHE = "clearsessioncache";
 
@@ -91,7 +90,6 @@ public class InAppBrowser extends CordovaPlugin {
     private CallbackContext callbackContext;
     private boolean showLocationBar = true;
     private boolean openWindowHidden = false;
-    private String buttonLabel = "Done";
     private boolean clearAllCache= false;
     private boolean clearSessionCache=false;
 
@@ -293,12 +291,8 @@ public class InAppBrowser extends CordovaPlugin {
                 option = new StringTokenizer(features.nextToken(), "=");
                 if (option.hasMoreElements()) {
                     String key = option.nextToken();
-                    if (key.equalsIgnoreCase(CLOSE_BUTTON_CAPTION)) {
-                        this.buttonLabel = option.nextToken();
-                    } else {
-                        Boolean value = option.nextToken().equals("no") ? 
Boolean.FALSE : Boolean.TRUE;
-                        map.put(key, value);
-                    }
+                    Boolean value = option.nextToken().equals("no") ? 
Boolean.FALSE : Boolean.TRUE;
+                    map.put(key, value);
                 }
             }
             return map;
@@ -477,6 +471,7 @@ public class InAppBrowser extends CordovaPlugin {
                 return value;
             }
 
+            @SuppressLint("NewApi")
             public void run() {
                 // Let's create the main dialog
                 dialog = new InAppBrowserDialog(cordova.getActivity(), 
android.R.style.Theme_NoTitleBar);
@@ -512,9 +507,6 @@ public class InAppBrowser extends CordovaPlugin {
                 back.setLayoutParams(backLayoutParams);
                 back.setContentDescription("Back Button");
                 back.setId(2);
-                /*
-                 back.setText("<");
-                 */
                 Resources activityRes = cordova.getActivity().getResources();
                 int backResId = 
activityRes.getIdentifier("ic_action_previous_item", "drawable", 
cordova.getActivity().getPackageName());
                 Drawable backIcon = activityRes.getDrawable(backResId);
@@ -540,7 +532,6 @@ public class InAppBrowser extends CordovaPlugin {
                 forward.setLayoutParams(forwardLayoutParams);
                 forward.setContentDescription("Forward Button");
                 forward.setId(3);
-                //forward.setText(">");
                 int fwdResId = 
activityRes.getIdentifier("ic_action_next_item", "drawable", 
cordova.getActivity().getPackageName());
                 Drawable fwdIcon = activityRes.getDrawable(fwdResId);
                 if(android.os.Build.VERSION.SDK_INT < 
android.os.Build.VERSION_CODES.JELLY_BEAN)
@@ -580,14 +571,13 @@ public class InAppBrowser extends CordovaPlugin {
                     }
                 });
 
-                // Close button
+                // Close/Done button
                 Button close = new Button(cordova.getActivity());
                 RelativeLayout.LayoutParams closeLayoutParams = new 
RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, 
LayoutParams.MATCH_PARENT);
                 closeLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
                 close.setLayoutParams(closeLayoutParams);
                 forward.setContentDescription("Close Button");
                 close.setId(5);
-                //close.setText(buttonLabel);
                 int closeResId = activityRes.getIdentifier("ic_action_remove", 
"drawable", cordova.getActivity().getPackageName());
                 Drawable closeIcon = activityRes.getDrawable(closeResId);
                 if(android.os.Build.VERSION.SDK_INT < 
android.os.Build.VERSION_CODES.JELLY_BEAN)
@@ -672,7 +662,7 @@ public class InAppBrowser extends CordovaPlugin {
                 // the goal of openhidden is to load the url and not display it
                 // Show() needs to be called to cause the URL to be loaded
                 if(openWindowHidden) {
-                       dialog.hide();
+                    dialog.hide();
                 }
             }
         };
@@ -705,8 +695,6 @@ public class InAppBrowser extends CordovaPlugin {
             }
         }
     }
-
-
     
     /**
      * The webview client receives notifications about appView
@@ -837,7 +825,6 @@ public class InAppBrowser extends CordovaPlugin {
             } catch (JSONException ex) {
                 Log.d(LOG_TAG, "Should never happen");
             }
-               
         }
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to