cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [1/7] android commit: Move handling of Fullscreen preference to CordovaActivity
Date Mon, 07 Jul 2014 17:10:09 GMT
Repository: cordova-android
Updated Branches:
  refs/heads/master 79aa3e159 -> 0f1560817


Move handling of Fullscreen preference to CordovaActivity

Makes more sense here since that's where the other FullScreen related
changes are.


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

Branch: refs/heads/master
Commit: 663a71255ff0e3a7a3d31bda4cd72fa7b4de1283
Parents: 79aa3e1
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Fri Jul 4 12:11:19 2014 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Fri Jul 4 12:11:19 2014 -0400

----------------------------------------------------------------------
 .../src/org/apache/cordova/CordovaActivity.java |  8 +++++---
 .../src/org/apache/cordova/CordovaWebView.java  | 20 --------------------
 2 files changed, 5 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/663a7125/framework/src/org/apache/cordova/CordovaActivity.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaActivity.java b/framework/src/org/apache/cordova/CordovaActivity.java
index 18ac670..89d4c81 100755
--- a/framework/src/org/apache/cordova/CordovaActivity.java
+++ b/framework/src/org/apache/cordova/CordovaActivity.java
@@ -213,12 +213,14 @@ public class CordovaActivity extends Activity implements CordovaInterface
{
             Log.d(TAG, "The SetFullscreen configuration is deprecated in favor of Fullscreen,
and will be removed in a future version.");
             getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                     WindowManager.LayoutParams.FLAG_FULLSCREEN);
-        }
-        else
-        {
+        } else if (this.getBooleanProperty("Fullscreen", false)) {
+            getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
+                    WindowManager.LayoutParams.FLAG_FULLSCREEN);
+        } else {
             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();

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/663a7125/framework/src/org/apache/cordova/CordovaWebView.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaWebView.java b/framework/src/org/apache/cordova/CordovaWebView.java
index ad5c0f0..9401e03 100755
--- a/framework/src/org/apache/cordova/CordovaWebView.java
+++ b/framework/src/org/apache/cordova/CordovaWebView.java
@@ -49,7 +49,6 @@ import android.view.Gravity;
 import android.view.KeyEvent;
 import android.view.View;
 import android.view.ViewGroup;
-import android.view.WindowManager;
 import android.view.inputmethod.InputMethodManager;
 import android.webkit.WebBackForwardList;
 import android.webkit.WebHistoryItem;
@@ -138,7 +137,6 @@ public class CordovaWebView extends WebView {
         {
             Log.d(TAG, "Your activity must implement CordovaInterface to work");
         }
-        this.loadConfiguration();
         this.setup();
     }
 
@@ -160,7 +158,6 @@ public class CordovaWebView extends WebView {
         }
         this.setWebChromeClient(new CordovaChromeClient(this.cordova, this));
         this.initWebViewClient(this.cordova);
-        this.loadConfiguration();
         this.setup();
     }
 
@@ -183,7 +180,6 @@ public class CordovaWebView extends WebView {
             Log.d(TAG, "Your activity must implement CordovaInterface to work");
         }
         this.setWebChromeClient(new CordovaChromeClient(this.cordova, this));
-        this.loadConfiguration();
         this.setup();
     }
 
@@ -208,7 +204,6 @@ public class CordovaWebView extends WebView {
         }
         this.setWebChromeClient(new CordovaChromeClient(this.cordova));
         this.initWebViewClient(this.cordova);
-        this.loadConfiguration();
         this.setup();
     }
 
@@ -655,21 +650,6 @@ public class CordovaWebView extends WebView {
     }
 
     /**
-     * Check configuration parameters from Config.
-     * Approved list of URLs that can be loaded into Cordova
-     *      <access origin="http://server regexp" subdomains="true" />
-     * Log level: ERROR, WARN, INFO, DEBUG, VERBOSE (default=ERROR)
-     *      <log level="DEBUG" />
-     */
-    private void loadConfiguration() {
- 
-        if ("true".equals(this.getProperty("Fullscreen", "false"))) {
-            this.cordova.getActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
-            this.cordova.getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
-        }
-    }
-
-    /**
      * Get string property for activity.
      *
      * @param name


Mime
View raw message