summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/values/strings.xml4
-rw-r--r--res/xml/browser_preferences.xml6
-rw-r--r--src/com/android/browser/BrowserSettings.java9
3 files changed, 19 insertions, 0 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 98142ac..82e4602 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -282,6 +282,10 @@
<string name="pref_content_autofit">Auto-fit pages</string>
<!-- Settings summary -->
<string name="pref_content_autofit_summary">Format Web pages to fit the screen</string>
+ <!-- Settings label for enabling a mode where the browser is always set to landscape mode -->
+ <string name="pref_content_landscape_only">Landscape only display</string>
+ <!-- Settings summary -->
+ <string name="pref_content_landscape_only_summary">Always read pages in the wider, landscape screen orientation</string>
<!-- Settings screen, section title -->
<string name="pref_privacy_title">Privacy settings</string>
<!-- Settings label -->
diff --git a/res/xml/browser_preferences.xml b/res/xml/browser_preferences.xml
index fdfa839..79dfb92 100644
--- a/res/xml/browser_preferences.xml
+++ b/res/xml/browser_preferences.xml
@@ -54,6 +54,12 @@
android:summary="@string/pref_content_autofit_summary" />
<CheckBoxPreference
+ android:key="landscape_only"
+ android:defaultValue="false"
+ android:title="@string/pref_content_landscape_only"
+ android:summary="@string/pref_content_landscape_only_summary" />
+
+ <CheckBoxPreference
android:key="enable_javascript"
android:defaultValue="true"
android:title="@string/pref_content_javascript" />
diff --git a/src/com/android/browser/BrowserSettings.java b/src/com/android/browser/BrowserSettings.java
index 0e2c5af..39f1d7f 100644
--- a/src/com/android/browser/BrowserSettings.java
+++ b/src/com/android/browser/BrowserSettings.java
@@ -70,6 +70,7 @@ class BrowserSettings extends Observable {
private String homeUrl = "http://www.google.com/m?client=ms-";
private boolean loginInitialized = false;
private boolean autoFitPage = true;
+ private boolean landscapeOnly = false;
private boolean showDebugSettings = false;
// Development settings
@@ -237,6 +238,14 @@ class BrowserSettings extends Observable {
textSize = WebSettings.TextSize.valueOf(
p.getString(PREF_TEXT_SIZE, textSize.name()));
autoFitPage = p.getBoolean("autofit_pages", autoFitPage);
+ boolean landscapeOnlyTemp =
+ p.getBoolean("landscape_only", landscapeOnly);
+ if (landscapeOnlyTemp != landscapeOnly) {
+ landscapeOnly = landscapeOnlyTemp;
+ mTabControl.getBrowserActivity().setRequestedOrientation(
+ landscapeOnly ? ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
+ : ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
+ }
useWideViewPort = true; // use wide view port for either setting
if (autoFitPage) {
layoutAlgorithm = WebSettings.LayoutAlgorithm.NARROW_COLUMNS;