mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Workaround buggy text size setting migrations.
This commit is contained in:
parent
0b3e64232f
commit
3576eab4ba
1 changed files with 8 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue