forked from github/cordova-android
using preference=fullscreen for fullscreen view
involves loading configuration before the layout is set up
This commit is contained in:
parent
752b1b0e30
commit
3af4d6b139
@ -319,13 +319,25 @@ public class DroidGap extends PhonegapActivity {
|
|||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
preferences = new PreferenceSet();
|
preferences = new PreferenceSet();
|
||||||
|
|
||||||
|
// Load PhoneGap configuration:
|
||||||
|
// white list of allowed URLs
|
||||||
|
// debug setting
|
||||||
|
this.loadConfiguration();
|
||||||
|
|
||||||
LOG.d(TAG, "DroidGap.onCreate()");
|
LOG.d(TAG, "DroidGap.onCreate()");
|
||||||
super.onCreate(savedInstanceState);
|
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!
|
|
||||||
|
|
||||||
|
getWindow().requestFeature(Window.FEATURE_NO_TITLE);
|
||||||
|
|
||||||
|
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();
|
Display display = getWindowManager().getDefaultDisplay();
|
||||||
int width = display.getWidth();
|
int width = display.getWidth();
|
||||||
int height = display.getHeight();
|
int height = display.getHeight();
|
||||||
@ -335,11 +347,6 @@ public class DroidGap extends PhonegapActivity {
|
|||||||
root.setBackgroundColor(this.backgroundColor);
|
root.setBackgroundColor(this.backgroundColor);
|
||||||
root.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
|
root.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
|
||||||
ViewGroup.LayoutParams.FILL_PARENT, 0.0F));
|
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
|
// If url was passed in to intent, then init webview, which will load the url
|
||||||
Bundle bundle = this.getIntent().getExtras();
|
Bundle bundle = this.getIntent().getExtras();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user