mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-06-05 17:00:23 +02:00
move text size getter in an extension
This commit is contained in:
@ -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)
|
||||
}
|
Reference in New Issue
Block a user