();
u.put(12, new SettingsUpgraderV12());
u.put(24, new SettingsUpgraderV24());
+ u.put(31, new SettingsUpgraderV31());
UPGRADERS = Collections.unmodifiableMap(u);
}
@@ -321,6 +326,49 @@ public class GlobalSettings {
}
}
+ /**
+ * Upgrades the settings from version 30 to 31.
+ *
+ *
+ * Convert value from fontSizeMessageViewContent to
+ * fontSizeMessageViewContentPercent.
+ *
+ */
+ public static class SettingsUpgraderV31 implements SettingsUpgrader {
+
+ @Override
+ public Set upgrade(Map settings) {
+ int oldSize = ((Integer) settings.get("fontSizeMessageViewContent")).intValue();
+
+ int newSize = convertFromOldSize(oldSize);
+
+ settings.put("fontSizeMessageViewContentPercent", newSize);
+
+ return new HashSet(Arrays.asList("fontSizeMessageViewContent"));
+ }
+
+ public static int convertFromOldSize(int oldSize) {
+ switch (oldSize) {
+ case 1: {
+ return 40;
+ }
+ case 2: {
+ return 75;
+ }
+ case 4: {
+ return 175;
+ }
+ case 5: {
+ return 250;
+ }
+ case 3:
+ default: {
+ return 100;
+ }
+ }
+ }
+ }
+
/**
* The gallery bug work-around setting.
*
diff --git a/src/com/fsck/k9/preferences/Settings.java b/src/com/fsck/k9/preferences/Settings.java
index 127865ee8..11ecc921a 100644
--- a/src/com/fsck/k9/preferences/Settings.java
+++ b/src/com/fsck/k9/preferences/Settings.java
@@ -35,7 +35,7 @@ public class Settings {
*
* @see SettingsExporter
*/
- public static final int VERSION = 30;
+ public static final int VERSION = 31;
public static Map validate(int version, Map> settings,
diff --git a/src/com/fsck/k9/view/MessageWebView.java b/src/com/fsck/k9/view/MessageWebView.java
index 192165dcd..0e37c069c 100644
--- a/src/com/fsck/k9/view/MessageWebView.java
+++ b/src/com/fsck/k9/view/MessageWebView.java
@@ -109,15 +109,10 @@ public class MessageWebView extends RigidWebView {
disableOverscrolling();
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
- webSettings.setTextZoom(K9.getFontSizes().getMessageViewContentAsPercent());
- } else {
- webSettings.setTextSize(K9.getFontSizes().getMessageViewContent());
- }
+ webSettings.setTextZoom(K9.getFontSizes().getMessageViewContentAsPercent());
// Disable network images by default. This is overridden by preferences.
blockNetworkData(true);
-
}
/**