Merge pull request #487 from dosiecki/master

Android: Workaround buggy text size setting migrations.
This commit is contained in:
Samuel Clay 2014-02-11 11:08:06 -08:00
commit f48201d662

View file

@ -242,7 +242,14 @@ public class PrefsUtils {
public static float getTextSize(Context context) {
SharedPreferences preferences = context.getSharedPreferences(PrefConstants.PREFERENCES, 0);
return preferences.getFloat(PrefConstants.PREFERENCE_TEXT_SIZE, 1.0f);
float storedValue = preferences.getFloat(PrefConstants.PREFERENCE_TEXT_SIZE, 1.0f);
// some users have wacky, pre-migration values stored that won't render. If the value is below our
// minimum size, soft reset to the defaul size.
if (storedValue < AppConstants.READING_FONT_SIZE[0]) {
return 1.0f;
} else {
return storedValue;
}
}
public static void setTextSize(Context context, float size) {