You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bo...@apache.org on 2012/05/08 23:09:50 UTC

android commit: Updating the history configuration. We can switch between histories

Updated Branches:
  refs/heads/CordovaWebView 8ab173337 -> 4ce585be0


Updating the history configuration.  We can switch between histories


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/4ce585be
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/4ce585be
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/4ce585be

Branch: refs/heads/CordovaWebView
Commit: 4ce585be026cab7d18db3b8e759180fc9fae2810
Parents: 8ab1733
Author: Joe Bowser <bo...@apache.org>
Authored: Tue May 8 13:58:24 2012 -0700
Committer: Joe Bowser <bo...@apache.org>
Committed: Tue May 8 13:58:24 2012 -0700

----------------------------------------------------------------------
 .../org/apache/cordova/CordovaWebViewClient.java   |    9 +++++--
 framework/src/org/apache/cordova/DroidGap.java     |   18 +++++---------
 2 files changed, 13 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/4ce585be/framework/src/org/apache/cordova/CordovaWebViewClient.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaWebViewClient.java b/framework/src/org/apache/cordova/CordovaWebViewClient.java
index e101c8b..e313945 100755
--- a/framework/src/org/apache/cordova/CordovaWebViewClient.java
+++ b/framework/src/org/apache/cordova/CordovaWebViewClient.java
@@ -203,9 +203,12 @@ public class CordovaWebViewClient extends WebViewClient {
     @Override
     public void onPageStarted(WebView view, String url, Bitmap favicon) {
         // Clear history so history.back() doesn't do anything.  
-        // So we can reinit() native side CallbackServer & PluginManager.
-        view.clearHistory(); 
-        this.doClearHistory = true;
+        // So we can reinit() native side CallbackServer & PluginManager.\
+        if(!appView.useBrowserHistory)
+        {
+          view.clearHistory(); 
+          this.doClearHistory = true;
+        }
     }
     
     /**

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/4ce585be/framework/src/org/apache/cordova/DroidGap.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/DroidGap.java b/framework/src/org/apache/cordova/DroidGap.java
index 21e14aa..33499b4 100755
--- a/framework/src/org/apache/cordova/DroidGap.java
+++ b/framework/src/org/apache/cordova/DroidGap.java
@@ -225,16 +225,9 @@ public class DroidGap extends Activity implements CordovaInterface {
 
         getWindow().requestFeature(Window.FEATURE_NO_TITLE);
 
-        if (preferences.prefMatches("fullscreen","true")) {
-            getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
-                    WindowManager.LayoutParams.FLAG_FULLSCREEN);
-        } else if(preferences.prefMatches("useBrowserHistory", "true")) {
-          useBrowserHistory = true;
-        } else {
-            getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,
+        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,
                     WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
-        }
-
+        
         // This builds the view.  We could probably get away with NOT having a LinearLayout, but I like having a bucket!
         Display display = getWindowManager().getDefaultDisplay(); 
         int width = display.getWidth();
@@ -283,7 +276,11 @@ public class DroidGap extends Activity implements CordovaInterface {
         //      white list of allowed URLs
         //      debug setting
         this.loadConfiguration();
-
+        //Now we can check the preference
+        appView.useBrowserHistory = preferences.prefMatches("useBrowserHistory", "true");
+        
+        //
+        
         this.appView.setLayoutParams(new LinearLayout.LayoutParams(
                 ViewGroup.LayoutParams.MATCH_PARENT,
                 ViewGroup.LayoutParams.MATCH_PARENT, 
@@ -291,7 +288,6 @@ public class DroidGap extends Activity implements CordovaInterface {
 
         // Add web view but make it invisible while loading URL
         this.appView.setVisibility(View.INVISIBLE);
-        this.appView.useBrowserHistory = useBrowserHistory;
         root.addView(this.appView);
         setContentView(root);