Per Leland's requst, change "Set text size" to "Text size" and etc.
<!-- Settings summary -->
<string name="pref_security_accept_cookies_summary">Allow sites to save and read \"cookie\" data</string>
<!-- Settings label -->
- <string name="pref_text_size">Set text size</string>
+ <string name="pref_text_size">Text size</string>
<!-- Settings text size options; appear in Text size dialog box -->
<string-array name="pref_text_size_choices">
<item>Tiny</item>
<item><xliff:g>LARGER</xliff:g></item>
<item><xliff:g>LARGEST</xliff:g></item>
</string-array>
+ <!-- Settings label -->
+ <string name="pref_default_zoom">Default zoom</string>
+ <!-- Settings default zoom options; appear in default zoom dialog box -->
+ <string-array name="pref_default_zoom_choices">
+ <item>Far</item>
+ <item>Medium</item>
+ <item>Close</item>
+ </string-array>
+ <!-- Title of dialog for setting the default zoom -->
+ <string name="pref_default_zoom_dialogtitle">Default zoom</string>
+ <!-- Do not translate -->
+ <string-array name="pref_default_zoom_values" translatable="false">
+ <item><xliff:g>FAR</xliff:g></item>
+ <item><xliff:g>MEDIUM</xliff:g></item>
+ <item><xliff:g>CLOSE</xliff:g></item>
+ </string-array>
<!-- Settings screen, section title -->
<string name="pref_extras_title">Advanced settings</string>
<!-- Settings label -->
<item>2</item>
</string-array>
<!-- Settings screen, setting option name -->
- <string name="pref_default_text_encoding">Set text encoding</string>
+ <string name="pref_default_text_encoding">Text encoding</string>
<!-- Options in the Default encoding dialog box -->
<string-array name="pref_default_text_encoding_choices">
<item>Latin-1 (ISO-8859-1)</item>
android:dialogTitle="@string/pref_text_size_dialogtitle" />
<ListPreference
+ android:key="default_zoom"
+ android:title="@string/pref_default_zoom"
+ android:defaultValue="MEDIUM"
+ android:entries="@array/pref_default_zoom_choices"
+ android:entryValues="@array/pref_default_zoom_values"
+ android:dialogTitle="@string/pref_default_zoom_dialogtitle" />
+
+ <ListPreference
android:key="default_text_encoding"
android:title="@string/pref_default_text_encoding"
android:defaultValue="@string/pref_default_text_encoding_default"
getPreferenceScreen().getSharedPreferences()
.getString(BrowserSettings.PREF_TEXT_SIZE, null)) );
+ e = findPreference(BrowserSettings.PREF_DEFAULT_ZOOM);
+ e.setOnPreferenceChangeListener(this);
+ e.setSummary(getVisualDefaultZoomName(
+ getPreferenceScreen().getSharedPreferences()
+ .getString(BrowserSettings.PREF_DEFAULT_ZOOM, null)) );
+
e = findPreference(BrowserSettings.PREF_DEFAULT_TEXT_ENCODING);
e.setOnPreferenceChangeListener(this);
} else if (pref.getKey().equals(BrowserSettings.PREF_TEXT_SIZE)) {
pref.setSummary(getVisualTextSizeName((String) objValue));
return true;
+ } else if (pref.getKey().equals(BrowserSettings.PREF_DEFAULT_ZOOM)) {
+ pref.setSummary(getVisualDefaultZoomName((String) objValue));
+ return true;
} else if (pref.getKey().equals(
BrowserSettings.PREF_DEFAULT_TEXT_ENCODING)) {
pref.setSummary((String) objValue);
}
return true;
}
-
+
private CharSequence getVisualTextSizeName(String enumName) {
- CharSequence[] visualNames =
- getResources().getTextArray(R.array.pref_text_size_choices);
- CharSequence[] enumNames =
- getResources().getTextArray(R.array.pref_text_size_values);
-
+ CharSequence[] visualNames = getResources().getTextArray(
+ R.array.pref_text_size_choices);
+ CharSequence[] enumNames = getResources().getTextArray(
+ R.array.pref_text_size_values);
+
// Sanity check
if (visualNames.length != enumNames.length) {
return "";
}
-
+
for (int i = 0; i < enumNames.length; i++) {
if (enumNames[i].equals(enumName)) {
return visualNames[i];
}
}
-
+
+ return "";
+ }
+
+ private CharSequence getVisualDefaultZoomName(String enumName) {
+ CharSequence[] visualNames = getResources().getTextArray(
+ R.array.pref_default_zoom_choices);
+ CharSequence[] enumNames = getResources().getTextArray(
+ R.array.pref_default_zoom_values);
+
+ // Sanity check
+ if (visualNames.length != enumNames.length) {
+ return "";
+ }
+
+ for (int i = 0; i < enumNames.length; i++) {
+ if (enumNames[i].equals(enumName)) {
+ return visualNames[i];
+ }
+ }
+
return "";
}
}
private static int defaultFixedFontSize = 13;
private static WebSettings.TextSize textSize =
WebSettings.TextSize.NORMAL;
+ private static WebSettings.ZoomDensity zoomDensity =
+ WebSettings.ZoomDensity.MEDIUM;
// Preference keys that are used outside this class
public final static String PREF_CLEAR_CACHE = "privacy_clear_cache";
public final static String PREF_DEBUG_SETTINGS = "debug_menu";
public final static String PREF_GEARS_SETTINGS = "gears_settings";
public final static String PREF_TEXT_SIZE = "text_size";
+ public final static String PREF_DEFAULT_ZOOM = "default_zoom";
public final static String PREF_DEFAULT_TEXT_ENCODING =
"default_text_encoding";
s.setDefaultFixedFontSize(b.defaultFixedFontSize);
s.setNavDump(b.navDump);
s.setTextSize(b.textSize);
+ s.setDefaultZoom(b.zoomDensity);
s.setLightTouchEnabled(b.lightTouch);
s.setSaveFormData(b.saveFormData);
s.setSavePassword(b.rememberPasswords);
loginInitialized = p.getBoolean("login_initialized", loginInitialized);
textSize = WebSettings.TextSize.valueOf(
p.getString(PREF_TEXT_SIZE, textSize.name()));
+ zoomDensity = WebSettings.ZoomDensity.valueOf(
+ p.getString(PREF_DEFAULT_ZOOM, zoomDensity.name()));
autoFitPage = p.getBoolean("autofit_pages", autoFitPage);
useWideViewPort = true; // use wide view port for either setting
if (autoFitPage) {
return textSize;
}
+ public WebSettings.ZoomDensity getDefaultZoom() {
+ return zoomDensity;
+ }
+
public boolean openInBackground() {
return openInBackground;
}