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/01/24 00:05:55 UTC
[13/17] git commit: using preference=fullscreen for fullscreen view
using preference=fullscreen for fullscreen view
involves loading configuration before the layout is set up
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/3af4d6b1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/3af4d6b1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/3af4d6b1
Branch: refs/heads/master
Commit: 3af4d6b13990e746fe82c1ee43bb115818a7ab1b
Parents: 752b1b0
Author: alunny <al...@gmail.com>
Authored: Fri Dec 30 17:23:34 2011 -0800
Committer: alunny <al...@gmail.com>
Committed: Mon Jan 9 17:31:50 2012 -0800
----------------------------------------------------------------------
framework/src/com/phonegap/DroidGap.java | 23 +++++++++++++++--------
1 files changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/3af4d6b1/framework/src/com/phonegap/DroidGap.java
----------------------------------------------------------------------
diff --git a/framework/src/com/phonegap/DroidGap.java b/framework/src/com/phonegap/DroidGap.java
index 2b92ef6..893471f 100755
--- a/framework/src/com/phonegap/DroidGap.java
+++ b/framework/src/com/phonegap/DroidGap.java
@@ -319,13 +319,25 @@ public class DroidGap extends PhonegapActivity {
public void onCreate(Bundle savedInstanceState) {
preferences = new PreferenceSet();
+ // Load PhoneGap configuration:
+ // white list of allowed URLs
+ // debug setting
+ this.loadConfiguration();
+
LOG.d(TAG, "DroidGap.onCreate()");
super.onCreate(savedInstanceState);
+
getWindow().requestFeature(Window.FEATURE_NO_TITLE);
- 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!
+ if (preferences.pref("fullscreen").equals("true")) {
+ 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();
int height = display.getHeight();
@@ -335,11 +347,6 @@ public class DroidGap extends PhonegapActivity {
root.setBackgroundColor(this.backgroundColor);
root.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.FILL_PARENT, 0.0F));
-
- // Load PhoneGap configuration:
- // white list of allowed URLs
- // debug setting
- this.loadConfiguration();
// If url was passed in to intent, then init webview, which will load the url
Bundle bundle = this.getIntent().getExtras();