diff options
author | Michael Kolb <kolby@google.com> | 2011-04-27 10:46:06 -0700 |
---|---|---|
committer | Michael Kolb <kolby@google.com> | 2011-04-27 12:59:42 -0700 |
commit | c38c604eca3bd0620cd9284187aace78455e723d (patch) | |
tree | 016df45face1036f9a7fc38f0f7740cdc2faaff6 | |
parent | adc921feeb327ed118711d4abddfaa421c841290 (diff) | |
download | packages_apps_Browser-c38c604eca3bd0620cd9284187aace78455e723d.zip packages_apps_Browser-c38c604eca3bd0620cd9284187aace78455e723d.tar.gz packages_apps_Browser-c38c604eca3bd0620cd9284187aace78455e723d.tar.bz2 |
add fullscreen option
Change-Id: I88299c37a7e809492f806478f41365b56b2687be
-rw-r--r-- | res/values/strings.xml | 5 | ||||
-rw-r--r-- | res/xml/lab_preferences.xml | 5 | ||||
-rw-r--r-- | src/com/android/browser/BaseUi.java | 12 | ||||
-rw-r--r-- | src/com/android/browser/BrowserSettings.java | 9 | ||||
-rw-r--r-- | src/com/android/browser/PreferenceKeys.java | 1 | ||||
-rw-r--r-- | src/com/android/browser/UI.java | 2 |
6 files changed, 34 insertions, 0 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index c30eea8..63f5aef 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -647,6 +647,11 @@ <string name="pref_use_instant_search_summary"> Use Google Instant when you use Google Search, to show results as you type (this can increase data use).</string> + <string name="pref_lab_fullscreen">Fullscreen</string> + <!-- Summary for the fullscreen lab feature [CHAR LIMIT=120] --> + <string name="pref_lab_fullscreen_summary"> + Use fullscreen mode to hide the status bar.</string> + <!-- Title for a dialog displayed when the browser has a data connectivity problem --> <string name="browserFrameNetworkErrorLabel">Data connectivity problem</string> diff --git a/res/xml/lab_preferences.xml b/res/xml/lab_preferences.xml index b33052f..ee00463 100644 --- a/res/xml/lab_preferences.xml +++ b/res/xml/lab_preferences.xml @@ -26,4 +26,9 @@ android:defaultValue="false" android:title="@string/pref_lab_most_visited_homepage" android:summary="@string/pref_lab_most_visited_homepage_summary" /> + <CheckBoxPreference + android:key="fullscreen" + android:defaultValue="false" + android:title="@string/pref_lab_fullscreen" + android:summary="@string/pref_lab_fullscreen_summary" /> </PreferenceScreen> diff --git a/src/com/android/browser/BaseUi.java b/src/com/android/browser/BaseUi.java index 5bb4c1f..e2e313e 100644 --- a/src/com/android/browser/BaseUi.java +++ b/src/com/android/browser/BaseUi.java @@ -116,6 +116,7 @@ public abstract class BaseUi implements UI, WebViewFactory { mCustomViewContainer = (FrameLayout) mBrowserFrameLayout .findViewById(R.id.fullscreen_custom_content); frameLayout.addView(mBrowserFrameLayout, COVER_SCREEN_PARAMS); + setFullscreen(BrowserSettings.getInstance().useFullscreen()); } @Override @@ -783,4 +784,15 @@ public abstract class BaseUi implements UI, WebViewFactory { return menu; } + public void setFullscreen(boolean enabled) { + if (enabled) { + mActivity.getWindow().setFlags( + WindowManager.LayoutParams.FLAG_FULLSCREEN, + WindowManager.LayoutParams.FLAG_FULLSCREEN); + } else { + mActivity.getWindow().clearFlags( + WindowManager.LayoutParams.FLAG_FULLSCREEN); + } + } + } diff --git a/src/com/android/browser/BrowserSettings.java b/src/com/android/browser/BrowserSettings.java index 9456561..eadd57e 100644 --- a/src/com/android/browser/BrowserSettings.java +++ b/src/com/android/browser/BrowserSettings.java @@ -218,6 +218,11 @@ public class BrowserSettings implements OnSharedPreferenceChangeListener, if (PREF_USE_INSTANT_SEARCH.equals(key)) { updateSearchEngine(true); } + if (PREF_FULLSCREEN.equals(key)) { + if (mController.getUi() != null) { + mController.getUi().setFullscreen(useFullscreen()); + } + } } static String getFactoryResetHomeUrl(Context context) { @@ -556,6 +561,10 @@ public class BrowserSettings implements OnSharedPreferenceChangeListener, return mPrefs.getBoolean(PREF_USE_INSTANT_SEARCH, false); } + public boolean useFullscreen() { + return mPrefs.getBoolean(PREF_FULLSCREEN, false); + } + // ----------------------------- // getter/setters for privacy_security_preferences.xml // ----------------------------- diff --git a/src/com/android/browser/PreferenceKeys.java b/src/com/android/browser/PreferenceKeys.java index 929339f..b4c4a68 100644 --- a/src/com/android/browser/PreferenceKeys.java +++ b/src/com/android/browser/PreferenceKeys.java @@ -76,6 +76,7 @@ public interface PreferenceKeys { static final String PREF_ENABLE_QUICK_CONTROLS = "enable_quick_controls"; static final String PREF_USE_MOST_VISITED_HOMEPAGE = "use_most_visited_homepage"; static final String PREF_USE_INSTANT_SEARCH = "use_instant_search"; + static final String PREF_FULLSCREEN = "fullscreen"; // ---------------------- // Keys for privacy_security_preferences.xml diff --git a/src/com/android/browser/UI.java b/src/com/android/browser/UI.java index 40fc14a..bb34ada 100644 --- a/src/com/android/browser/UI.java +++ b/src/com/android/browser/UI.java @@ -132,4 +132,6 @@ public interface UI { void showAutoLogin(Tab tab); void hideAutoLogin(Tab tab); + + void setFullscreen(boolean enabled); } |