adding an extra large font size

This commit is contained in:
tibbi 2020-02-06 20:49:13 +01:00
parent 53c88f1ab2
commit 89ddffa3f2
2 changed files with 5 additions and 2 deletions

View File

@ -505,7 +505,8 @@ class SettingsActivity : SimpleActivity() {
val items = arrayListOf(
RadioItem(FONT_SIZE_SMALL, res.getString(R.string.small)),
RadioItem(FONT_SIZE_MEDIUM, res.getString(R.string.medium)),
RadioItem(FONT_SIZE_LARGE, res.getString(R.string.large)))
RadioItem(FONT_SIZE_LARGE, res.getString(R.string.large)),
RadioItem(FONT_SIZE_EXTRA_LARGE, res.getString(R.string.extra_large)))
RadioGroupDialog(this@SettingsActivity, items, config.fontSize) {
config.fontSize = it as Int

View File

@ -517,9 +517,11 @@ fun Context.refreshCalDAVCalendars(ids: String, showToasts: Boolean) {
fun Context.getWidgetFontSize() = when (config.fontSize) {
FONT_SIZE_SMALL -> getWidgetSmallFontSize()
FONT_SIZE_MEDIUM -> getWidgetMediumFontSize()
else -> getWidgetLargeFontSize()
FONT_SIZE_LARGE -> getWidgetLargeFontSize()
else -> getWidgetExtraLargeFontSize()
}
fun Context.getWidgetSmallFontSize() = getWidgetMediumFontSize() - 3f
fun Context.getWidgetMediumFontSize() = resources.getDimension(R.dimen.day_text_size) / resources.displayMetrics.density
fun Context.getWidgetLargeFontSize() = getWidgetMediumFontSize() + 3f
fun Context.getWidgetExtraLargeFontSize() = getWidgetMediumFontSize() + 6f