Loading app/core/src/main/java/com/fsck/k9/K9.kt +2 −2 Original line number Diff line number Diff line Loading @@ -171,7 +171,7 @@ object K9 : EarlyInit { var isChangeContactNameColor = false @JvmStatic var contactNameColor = 0xff00008f.toInt() var contactNameColor = 0xFF1093F5.toInt() @JvmStatic var isShowContactPicture = true Loading Loading @@ -315,7 +315,7 @@ object K9 : EarlyInit { isShowContactName = storage.getBoolean("showContactName", false) isShowContactPicture = storage.getBoolean("showContactPicture", true) isChangeContactNameColor = storage.getBoolean("changeRegisteredNameColor", false) contactNameColor = storage.getInt("registeredNameColor", -0xffff71) contactNameColor = storage.getInt("registeredNameColor", 0xFF1093F5.toInt()) isUseMessageViewFixedWidthFont = storage.getBoolean("messageViewFixedWidthFont", false) isMessageViewReturnToList = storage.getBoolean("messageViewReturnToList", false) isMessageViewShowNext = storage.getBoolean("messageViewShowNext", false) Loading app/core/src/main/java/com/fsck/k9/preferences/GeneralSettingsDescriptions.java +25 −1 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ import java.util.Set; import java.util.TreeMap; import android.content.Context; import android.graphics.Color; import com.fsck.k9.Account; import com.fsck.k9.Account.SortType; Loading Loading @@ -157,7 +158,8 @@ public class GeneralSettingsDescriptions { new V(1, new TimeSetting("21:00")) )); s.put("registeredNameColor", Settings.versions( new V(1, new ColorSetting(0xFF00008F)) new V(1, new ColorSetting(0xFF00008F)), new V(79, new ColorSetting(0xFF1093F5)) )); s.put("showContactName", Settings.versions( new V(1, new BooleanSetting(false)) Loading Loading @@ -284,6 +286,7 @@ public class GeneralSettingsDescriptions { u.put(31, new SettingsUpgraderV31()); u.put(58, new SettingsUpgraderV58()); u.put(69, new SettingsUpgraderV69()); u.put(79, new SettingsUpgraderV79()); UPGRADERS = Collections.unmodifiableMap(u); } Loading Loading @@ -416,6 +419,27 @@ public class GeneralSettingsDescriptions { } } /** * Upgrades the settings from version 78 to 79. * * <p> * Change default value of {@code registeredNameColor} to have enough contrast in both the light and dark theme. * </p> */ private static class SettingsUpgraderV79 implements SettingsUpgrader { @Override public Set<String> upgrade(Map<String, Object> settings) { final Integer registeredNameColorValue = (Integer) settings.get("registeredNameColor"); if (registeredNameColorValue != null && registeredNameColorValue == 0xFF00008F) { settings.put("registeredNameColor", 0xFF1093F5); } return null; } } private static class LanguageSetting extends PseudoEnumSetting<String> { private final Context context = DI.get(Context.class); private final Map<String, String> mapping; Loading app/core/src/main/java/com/fsck/k9/preferences/Settings.java +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ public class Settings { * * @see SettingsExporter */ public static final int VERSION = 78; public static final int VERSION = 79; static Map<String, Object> validate(int version, Map<String, TreeMap<Integer, SettingsDescription>> settings, Map<String, String> importedSettings, boolean useDefaultValues) { Loading app/storage/src/main/java/com/fsck/k9/preferences/K9StoragePersister.java +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ import timber.log.Timber; public class K9StoragePersister implements StoragePersister { private static final int DB_VERSION = 15; private static final int DB_VERSION = 16; private static final String DB_NAME = "preferences_storage"; private final Context context; Loading app/storage/src/main/java/com/fsck/k9/preferences/migrations/StorageMigrationTo16.kt 0 → 100644 +18 −0 Original line number Diff line number Diff line package com.fsck.k9.preferences.migrations import android.database.sqlite.SQLiteDatabase /** * Change default value of `registeredNameColor` to have enough contrast in both the light and dark theme. */ class StorageMigrationTo16( private val db: SQLiteDatabase, private val migrationsHelper: StorageMigrationsHelper ) { fun changeDefaultRegisteredNameColor() { val registeredNameColorValue = migrationsHelper.readValue(db, "registeredNameColor")?.toInt() if (registeredNameColorValue == 0xFF00008F.toInt()) { migrationsHelper.writeValue(db, "registeredNameColor", 0xFF1093F5.toInt().toString()) } } } Loading
app/core/src/main/java/com/fsck/k9/K9.kt +2 −2 Original line number Diff line number Diff line Loading @@ -171,7 +171,7 @@ object K9 : EarlyInit { var isChangeContactNameColor = false @JvmStatic var contactNameColor = 0xff00008f.toInt() var contactNameColor = 0xFF1093F5.toInt() @JvmStatic var isShowContactPicture = true Loading Loading @@ -315,7 +315,7 @@ object K9 : EarlyInit { isShowContactName = storage.getBoolean("showContactName", false) isShowContactPicture = storage.getBoolean("showContactPicture", true) isChangeContactNameColor = storage.getBoolean("changeRegisteredNameColor", false) contactNameColor = storage.getInt("registeredNameColor", -0xffff71) contactNameColor = storage.getInt("registeredNameColor", 0xFF1093F5.toInt()) isUseMessageViewFixedWidthFont = storage.getBoolean("messageViewFixedWidthFont", false) isMessageViewReturnToList = storage.getBoolean("messageViewReturnToList", false) isMessageViewShowNext = storage.getBoolean("messageViewShowNext", false) Loading
app/core/src/main/java/com/fsck/k9/preferences/GeneralSettingsDescriptions.java +25 −1 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ import java.util.Set; import java.util.TreeMap; import android.content.Context; import android.graphics.Color; import com.fsck.k9.Account; import com.fsck.k9.Account.SortType; Loading Loading @@ -157,7 +158,8 @@ public class GeneralSettingsDescriptions { new V(1, new TimeSetting("21:00")) )); s.put("registeredNameColor", Settings.versions( new V(1, new ColorSetting(0xFF00008F)) new V(1, new ColorSetting(0xFF00008F)), new V(79, new ColorSetting(0xFF1093F5)) )); s.put("showContactName", Settings.versions( new V(1, new BooleanSetting(false)) Loading Loading @@ -284,6 +286,7 @@ public class GeneralSettingsDescriptions { u.put(31, new SettingsUpgraderV31()); u.put(58, new SettingsUpgraderV58()); u.put(69, new SettingsUpgraderV69()); u.put(79, new SettingsUpgraderV79()); UPGRADERS = Collections.unmodifiableMap(u); } Loading Loading @@ -416,6 +419,27 @@ public class GeneralSettingsDescriptions { } } /** * Upgrades the settings from version 78 to 79. * * <p> * Change default value of {@code registeredNameColor} to have enough contrast in both the light and dark theme. * </p> */ private static class SettingsUpgraderV79 implements SettingsUpgrader { @Override public Set<String> upgrade(Map<String, Object> settings) { final Integer registeredNameColorValue = (Integer) settings.get("registeredNameColor"); if (registeredNameColorValue != null && registeredNameColorValue == 0xFF00008F) { settings.put("registeredNameColor", 0xFF1093F5); } return null; } } private static class LanguageSetting extends PseudoEnumSetting<String> { private final Context context = DI.get(Context.class); private final Map<String, String> mapping; Loading
app/core/src/main/java/com/fsck/k9/preferences/Settings.java +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ public class Settings { * * @see SettingsExporter */ public static final int VERSION = 78; public static final int VERSION = 79; static Map<String, Object> validate(int version, Map<String, TreeMap<Integer, SettingsDescription>> settings, Map<String, String> importedSettings, boolean useDefaultValues) { Loading
app/storage/src/main/java/com/fsck/k9/preferences/K9StoragePersister.java +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ import timber.log.Timber; public class K9StoragePersister implements StoragePersister { private static final int DB_VERSION = 15; private static final int DB_VERSION = 16; private static final String DB_NAME = "preferences_storage"; private final Context context; Loading
app/storage/src/main/java/com/fsck/k9/preferences/migrations/StorageMigrationTo16.kt 0 → 100644 +18 −0 Original line number Diff line number Diff line package com.fsck.k9.preferences.migrations import android.database.sqlite.SQLiteDatabase /** * Change default value of `registeredNameColor` to have enough contrast in both the light and dark theme. */ class StorageMigrationTo16( private val db: SQLiteDatabase, private val migrationsHelper: StorageMigrationsHelper ) { fun changeDefaultRegisteredNameColor() { val registeredNameColorValue = migrationsHelper.readValue(db, "registeredNameColor")?.toInt() if (registeredNameColorValue == 0xFF00008F.toInt()) { migrationsHelper.writeValue(db, "registeredNameColor", 0xFF1093F5.toInt().toString()) } } }