move text size getter in an extension

This commit is contained in:
tibbi
2016-11-21 20:59:22 +01:00
parent 2f46805271
commit 625ee1ac90
6 changed files with 24 additions and 30 deletions

View File

@ -0,0 +1,12 @@
package com.simplemobiletools.notes.extensions
import android.content.Context
import com.simplemobiletools.notes.*
fun Context.getTextSize() =
when (Config.newInstance(this).fontSize) {
FONT_SIZE_SMALL -> resources.getDimension(R.dimen.small_text_size)
FONT_SIZE_LARGE -> resources.getDimension(R.dimen.large_text_size)
FONT_SIZE_EXTRA_LARGE -> resources.getDimension(R.dimen.extra_large_text_size)
else -> resources.getDimension(R.dimen.medium_text_size)
}